[bf1942] New gamespy protocol -gs3 (supports BF2) & -a2s updated for HL1

covert covert at optushome.com.au
Mon Jun 13 21:16:01 EDT 2005

The problem is the unread bytes are for only the first packet. I cannot seem to find out how to read the extra packets. php.net and google have not been helpfull.

For reading the data I do

		do {

			if ($this->getmicrotime()>($query_time_start+$timeout_millli)) {
				$this->errmsg="Connection timed out";
		} while($socketstatus["unread_bytes"]); 

If I can get this working my class will be downloadable to the public on dev.kquery.com (when it is back)

> read the online help for the command socket_get_status(), it
> returns an array where one field is named "unread_bytes". You have
> to check if it is non-zero.
> I don't know whether it is changed because I used it for the same
> purpose some time ago but you have to read at least 1 byte of the
> socket buffer to have this "unread_bytes" filled with the right
> value when you invoke the socket_get_status() command. Hope that
> helps...
> covert wrote:
>> I am working on a php version to query bf2 server but I have hit
>> a brick wall with php only wanting to receive 1 UPD packet.
>> Dropping off rules and server info have helped to get me around
>> 45 players but the rest gets lost. Any trick you used to do this
>> in qstat I could also do in php ?

More information about the Bf1942 mailing list