Is there anyways to check users ping serverside? If I'm right ping is getting handled by the client and the ping packet just requires you respond back, but is there a way you can check the ping at the server?
Yea, that was what I was thinking as well. Not like it's something important, was just wondering.Quote:
Not really... You could try to keep track of the system time on the client's machine but it would be quite ineffective and resource intensive...
Alternatively you could find a packet that the client responds to and send it and time how long it takes to get a reply... but again, there's no simple way to do it.
MsgTick (1012), it checks for a valid session and if the client doesn't answer correctly or in a valid time range, the client is disconnected. But in general, private servers don't have this packet.Quote:
Not really... You could try to keep track of the system time on the client's machine but it would be quite ineffective and resource intensive...
Alternatively you could find a packet that the client responds to and send it and time how long it takes to get a reply... but again, there's no simple way to do it.
It can be interesting to flush bad client with too high ping... But yeah, in fact, it's useless for a bot check, but anyway, it's not the first function of the packet. The hash method can be a little verification, nothing more.Quote:
I really don't think packet 1012 is necessary. I think it's completely useless. If it's a fake client, they'll just code it in anyways.
By doing a search on my current interest, I couldn't help it notice that what you said here is wrong. The function Socket.Send will just buffer your data in the underlying system to be sent and will not also wait until the data is delivered.Quote:
thats how ive seen it. Doesnt rly check the ping but on laggy connections it will drop the client.PHP Code:bool fSend = false;
try
{
if (fSend = Monitor.TryEnter(this, 50))
{
this.Socket.Send(Packet);
}
}
finally
{
if (!fSend)
FailedSend();
else
Monitor.Exit(this);
}
The code is from Hybrids Send method lul.Quote:
By doing a search on my current interest, I couldn't help it notice that what you said here is wrong. The function Socket.Send will just buffer your data in the underlying system to be sent and will not also wait until the data is delivered.
That Monitor.TryEnter is for locking purposes. If the server can get a lock for 50 ms on the client's class it will send the packet otherwise it will disconnect the client so no important packet can be lost. Once the lock is gone it's no problem, though it wont take more than 1 ms to use the Send function.Quote:
The code is from Hybrids Send method lul.
I know already lol.Quote:
That Monitor.TryEnter is for locking purposes. If the server can get a lock for 50 ms on the client's class it will send the packet otherwise it will disconnect the client so no important packet can be lost. Once the lock is gone it's no problem, though it wont take more than 1 ms to use the Send function.