The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change-Speed Detectation
Author Message
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #14
RE: Change-Speed Detectation
(03-16-2014 02:25 AM)Coruja Wrote:  I can filter packet sent to server to get some packet data, but I don't get the point on how to handle everything in the correct order to sync all packets and make they work together

I'll try to describe the (packet key based) complete detection process I'm using on my RunUO, the default method is omitted

Code:
@Player login
-Initialize a new stack with 6 keys and send it to the client
-player tag.stackwarn set to 0
-player tag.moves set to 0
//Stack = array of keys stored on the server

@Player movement
IF player changing direction
    IF stack count > 15
        -Reset the stack, add 6 new keys and store them
    ENDIF
    -Send a new single key and store it to the stack
    -Handle movement
    return;
ENDIF
IF stack contains key AND player tag.moves < 6
    -Remove key from stack
    -increase player tag.moves by 1
    -Initialize the separated thread FastWalkHelper if not initialized (we do not want 2 threads working)
ELSE
    -Possible fastwalk detected, block movement (paralize) for 0.2s (rejecting movement causing client to stop walking until teleport)
    -increase player tag.stackwarn by 1
ENDIF
-Handle movement

@player resync request
-Add a new key to the stack and send it to the player

@FastWalkHelper
WHILE player tag.moves > 0 AND player connected
    -wait run speed seconds (0.1 for mounted / 0.2 for foot)
    -decrease player tag.moves by 1
    IF stack count > 15
        -Reset the stack, add 6 new keys and store them
    ENDIF
    -Add a new key to the stack and send it to the player
    IF player tag.stackwarn > 0
        -decrease player tag.stackwarn by 1
        IF player tag.stackwarn > 5
            -report to the staff team the fastwalking player (movement was already blocked)
            //break while ?
        ENDIF
    ENDIF
ENDWHILE
-player tag.stackwarn set to 0
-thread end, exit and dispose resources

The FastWalkHelper is a separated thread, it runs asynchronous from the main thread, one thread per player (a bit unoptimized here)
The run time for each thread should not be any longer than 1 second and does not consume much memory and processor usage.
Tested with ~100 bots running from the same machine as the server (my pc) with some of them speedhacking


It can be possible to translate the thread to timer(f)-based but I have no idea on how Sphere handles the timers.
SQLite based tables could do the trick, but would require and incredible sync (time<>key<>move speed)

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
(This post was last modified: 03-16-2014 04:31 AM by Feeh.)
03-16-2014 04:14 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Feeh's post
Post Reply 


Messages In This Thread
Change-Speed Detectation - Staff_Stanic - 03-06-2014, 12:29 PM
RE: Change-Speed Detectation - Awaken - 03-07-2014, 01:35 AM
RE: Change-Speed Detectation - Feeh - 03-07-2014, 03:25 AM
RE: Change-Speed Detectation - Coruja - 03-16-2014, 02:25 AM
RE: Change-Speed Detectation - Feeh - 03-16-2014 04:14 AM
RE: Change-Speed Detectation - Feeh - 03-09-2014, 02:27 AM
RE: Change-Speed Detectation - Awaken - 03-11-2014, 09:15 PM
RE: Change-Speed Detectation - XuN - 03-12-2014, 05:49 PM
RE: Change-Speed Detectation - Awaken - 03-14-2014, 10:34 PM
RE: Change-Speed Detectation - darksun84 - 03-15-2014, 12:44 AM
RE: Change-Speed Detectation - Extreme - 03-15-2014, 01:27 AM
RE: Change-Speed Detectation - Coruja - 03-16-2014, 11:23 AM
RE: Change-Speed Detectation - Feeh - 03-16-2014, 01:27 PM
RE: Change-Speed Detectation - Coruja - 03-16-2014, 03:36 PM
RE: Change-Speed Detectation - Feeh - 03-17-2014, 02:09 AM
RE: Change-Speed Detectation - Coruja - 03-17-2014, 02:55 AM
RE: Change-Speed Detectation - XuN - 03-17-2014, 04:30 AM
RE: Change-Speed Detectation - Ben - 03-16-2014, 10:39 PM
RE: Change-Speed Detectation - Ben - 03-17-2014, 07:15 AM
RE: Change-Speed Detectation - Coruja - 03-24-2014, 05:24 AM
RE: Change-Speed Detectation - Ben - 03-24-2014, 05:35 AM
RE: Change-Speed Detectation - xfolder - 09-23-2014, 07:53 AM

Forum Jump:


User(s) browsing this thread: 6 Guest(s)