Quote:
Originally Posted by Norn
Quote:
Originally Posted by D00Mpy
Quote:
Originally Posted by Norn
Quote:
Originally Posted by D00Mpy
lol, and how do you think, the SA:MP client displays ping?, that's UDP also.......
|
Well i assumed because the developers of the server also created the client that they would know the proper way of pinging it.
As i have tried pinging the server many a times with no proper response, PM me if you find a solution
|
I'll do.
On the wiki https://sampwiki.blast.hk/wiki/Query/Req...e_packet_table check the p opcode..
Thats how sa-mp pings
But it isn't well explained
|
The socket just lags out when i use the p opcode, is it the same for you?
|
yeah..
But i found something:
Код:
<?php
$sPacket = 'SAMP';
$sPacket .= chr(strtok($this->aServer[0], '.'));
$sPacket .= chr(strtok('.'));
$sPacket .= chr(strtok('.'));
$sPacket .= chr(strtok('.'));
$sPacket .= chr($this->aServer[1] & 0xFF);
$sPacket .= chr($this->aServer[1] >> 8 & 0xFF);
$sPacket .= 'p4150';
?>
This is from
Server Query and RCON API - Be an admin at ease! (16/02/2010)
this uses the p opcode, and then sends the 4 pseudo-random numbers.
and then checks if he gets the numbers back from the server. (not to check ping but to check if it's online)
but you can easaly make a ping function out of this.