|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-09-04 18:30 UTC] sniper@php.net
[2001-09-05 05:06 UTC] beorn at ligarena dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 01:00:01 2025 UTC |
well when i send an UDP packet to my halflife server with fsockopen and fgets, it returns me another packet beginning from the 2nd line instead of the 1st. it means that if i were supposed to get : packet #1-"hello" packet #2-"world" packet #3-"its me" i receive : packet #1-"world" packet #2-"its me" here's a sample of my code : //--------------------------------------------------------- function get_pass_player_cs($serverip,$port,$rcon) { $get_pass_player_cs .= "<BR>Do ".$commande." on :".$serverip.":".$port.'<BR><BR>'; //Open the network for transmission. $serverip = "udp://".$serverip; $fp = fsockopen($serverip,$port, &$errno, &$errstr,10); if (!$fp) { $get_pass_player_cs .= "Server not available :".$errno; } else { //Send statusrequest. fwrite($fp,"????challenge rcon"."\x00"); $challenge = fgets($fp,50); $challenge = substr($challenge, 19); $challenge = trim ($challenge); $rcontxt="????rcon ".$challenge." ".$rcon." status\x00"; fwrite($fp,$rcontxt); $tmp = fgets($fp,100); //debug echo $tmp; $get_pass_player_cs = $tmp; fclose($fp); return $get_pass_player_cs; } $get_pass_player_cs .= "Erreur"; fclose($fp); return $get_pass_player_cs; } //---------------------------------------------------------