Technical solution to eliminate desync in single-player sessions
Again, this
Spoiler
// The player attacked a mob out of range, cheater! Note, the server should also check the delta to ensure travel is possible if (packet.Target > MoveSpeed) { Console.WriteLine("The client's packet is hacked, SPEEDHACK!"); return; } is only a valid piece of code if packets are computed at precisely 1s (or whatever time unit is used to relate speed to distance) intervals. Is that true? I would expect a check like if (packet.Target > MoveSpeed * delta), but this is not the case. You mentioned to look at
Spoiler
// Is this the first snapshot? if (LastTimestamp > 0) { delta = packet.Timestamp - LastTimestamp; if (delta <= 0) { Console.WriteLine("The client's packet is hacked, invalid delta. (Delta hack)"); return; } // Check packet timestamp based on movement / attack speed if (delta < (packet.Target / 3)) { Console.WriteLine("The client's packet is hacked, invalid delta. (Distance hack"); return; } } In particular, is the 3 in (packet.Target / 3) a magic number, or is it related to the movespeed? Lastly, packets are rejected on the basis of timestamp if and only if they are received out of order (timestamps not ascending), received in the future from the server (packet.Timestamp exceeds now), or are received in too rapid a succession (delta < (packet.Target / magic_number)). That would seem to have problems. I could cleverly hold my packets for a long period of time, this making the difference between packet.Timestamp and "now" (server current time) very long. Then, I can bypass the third "too rapid a succession" check by expending the buffer. However, your code doesn't currently simulate a sequence of packets, so I cannot demonstrate that by a code modification. IGN: SplitEpimorphism
|
![]() |
" Again, why would the server call Next? " This literally does nothing to invoke calling Next that I cannot intercept and spoof. Note how I ran the code in the same for context, thus I'll still be in lockstep with whatever crap "algorithm" you're running on the server. |
![]() |
" The timestamp has to match the action simulation. The server will be able to determine if you hold the packets because it won't produce the same simulation. " The server uses the same Simulate() function as the client. " The server is running the same algorithm as the client. Last edited by qwave#5074 on Nov 21, 2013, 1:46:00 AM
|
![]() |
" [Removed by Admin] Where the hell do you think I get my hack code concepts? This works on your computer because, guess what, you're running the server and client on the same damn machine. Try running the two modules on two separate machines with at least 50 ms of lag, you'd see quite a big desync situation going on within 200 fucking milliseconds. Last edited by Henry_GGG on Nov 21, 2013, 1:49:30 AM
|
![]() |
" Add a Thread.Sleep then to simulate latency. Latency does not effect the simulation. Last edited by qwave#5074 on Nov 21, 2013, 1:48:12 AM
|
![]() |
" And to get this through your head: I'm running my cheat IN THE SAME FUCKING ALGORITHM YOU'RE PROCLAIMING. WITHIN THE SAME FUCKING FOR LOOP. THEREFORE, MY SEED STATE IS THE SAME AS YOUR MAGICAL SERVER. |
![]() |
" So then what's the problem? The client and server simulation are in sync, no matter how much latency is involved. |
![]() |
This is terrific.
|
![]() |
" Thread.Sleep to simulate latency? You are an idiot, sir. Thread.Sleep sleeps BOTH SERVER AND CLIENT. THAT IS NOT LATENCY, THAT IS SLEEPING THE SAME TWO THINGS. |
![]() |
" Note how when I ran my CHEAT in your SYNCHRONIZED CLIENT it WORKED. Last edited by Sachiru#1510 on Nov 21, 2013, 1:50:31 AM
|
![]() |