Jump to content

andrew89898

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by andrew89898

  1. Hi, I am getting a couple of errors when running my php script PHP Error: 8: Undefined property: ***********::$xmltypehandlers, in ************* ←[32m [xmlServ:0] ←[33;1m[10:31:15]←[1m ←[37mStarted CPSM, version 0.04, Login Se rver communication mode: database ←[00m Connected to MySQL server localhost username *** PHP Error: 8: Use of undefined constant MSG_EOR - assumed 'MSG_EOR', in*******\ClientBase.php at 33! PHP Error: 2: socket_send() expects parameter 4 to be long, string given, in ******\ClientBase.php at 43! ←[32m[xmlServ:1] ←[33;1m[10:31:46]←[1m ←[37mClient created, ID:1, Socket ID: 0, rndK: ?NeR9X3lTWw←[00m PHP Error: 8: Use of undefined constant MSG_EOR - assumed 'MSG_EOR', in *********\ClientBase.php at 33! PHP Error: 2: socket_send() expects parameter 4 to be long, string given, in *********\ClientBase.php at 43! ←[32m[xmlServ:1] ←[33;1m[10:31:46] ←[35;1mMalformed packet <policy-file-request/ > sent by 0←[00m Since most of the errors originate in ClientBase.php Here is that File: <?php class ClientBase{ static $num = 0; static $count = 0; public $properties = array(); public $p = null; public $sock; public $parent; public $room; public $uniqueid = 0; public $inGame = false; public $xpos = 0; public $ypos = 0; public $clientID = 0; public $name = ""; function __construct($sock, $server, $clientid){ self::$num++; self::$count++; $this->parent =& $server; $this->uniqueid = self::$count; $this->sock = $sock; $this->p =& $this->properties;//p and properties are for temporary properties. $this->p['rndK'] = $this->makeRndK(); $this->clientID = $clientid; } /*function __destruct(){ self::$num--; @socket_close($this->sock); }*/ function write($data, $flags = MSG_EOR){ $data .= chr(0); $sendLen = strlen($data); $w = array($this->sock); $a = null; $b = null; $res = @socket_select($a, $w, $b, 0.15); if($res === false){ return $this->parent->removeClient($this->clientid); } $len = @socket_send($this->sock, $data, $sendLen, $flags); //$times = 5; /*while($len === false && $len < $sendLen){ if($len === false){ $ltr = 0; } else $ltr = $len; $data = substr($data, $ltr); $sendLen = strlen($data); $len = @socket_send($this->sock, $data, $sendLen, $flags); usleep(2000); $times--; if($times < 0) break; }*/ return $len ? true : false; } function makeRndK(){ $c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxwz0123456789?~"; $l = rand(6,14); $s = ""; for(;$l > 0;$l--) $s .= $c{rand(0,strlen($c) - 1)}; return $s; } function buildClientString($type = "raw", $s = "%"){ if($type == "xml"){ return $this->buildXmlPlayer(); } return $this->buildRawPlayer($s); } function getSortedProperties(){ } function buildRawPlayer($s){ return implode($this->getSortedProperties(), $s); } function getSocket(){ return $this->sock; } } ?> Please Help, Thanks. If the first error means a lot I will post some of that file too.
  2. Hi, I am getting a couple of errors when running a third party php script PHP Error: 8: Undefined property: ***********::$xmltypehandlers, in ************* ←[32m [xmlServ:0] ←[33;1m[10:31:15]←[1m ←[37mStarted CPSM, version 0.04, Login Se rver communication mode: database ←[00m Connected to MySQL server localhost username *** PHP Error: 8: Use of undefined constant MSG_EOR - assumed 'MSG_EOR', in*******\ClientBase.php at 33! PHP Error: 2: socket_send() expects parameter 4 to be long, string given, in ******\ClientBase.php at 43! ←[32m[xmlServ:1] ←[33;1m[10:31:46]←[1m ←[37mClient created, ID:1, Socket ID: 0, rndK: ?NeR9X3lTWw←[00m PHP Error: 8: Use of undefined constant MSG_EOR - assumed 'MSG_EOR', in *********\ClientBase.php at 33! PHP Error: 2: socket_send() expects parameter 4 to be long, string given, in *********\ClientBase.php at 43! ←[32m[xmlServ:1] ←[33;1m[10:31:46] ←[35;1mMalformed packet <policy-file-request/ > sent by 0←[00m Since most of the errors originate in ClientBase.php Here is that File: <?php class ClientBase{ static $num = 0; static $count = 0; public $properties = array(); public $p = null; public $sock; public $parent; public $room; public $uniqueid = 0; public $inGame = false; public $xpos = 0; public $ypos = 0; public $clientID = 0; public $name = ""; function __construct($sock, $server, $clientid){ self::$num++; self::$count++; $this->parent =& $server; $this->uniqueid = self::$count; $this->sock = $sock; $this->p =& $this->properties;//p and properties are for temporary properties. $this->p['rndK'] = $this->makeRndK(); $this->clientID = $clientid; } /*function __destruct(){ self::$num--; @socket_close($this->sock); }*/ function write($data, $flags = MSG_EOR){ $data .= chr(0); $sendLen = strlen($data); $w = array($this->sock); $a = null; $b = null; $res = @socket_select($a, $w, $b, 0.15); if($res === false){ return $this->parent->removeClient($this->clientid); } $len = @socket_send($this->sock, $data, $sendLen, $flags); //$times = 5; /*while($len === false && $len < $sendLen){ if($len === false){ $ltr = 0; } else $ltr = $len; $data = substr($data, $ltr); $sendLen = strlen($data); $len = @socket_send($this->sock, $data, $sendLen, $flags); usleep(2000); $times--; if($times < 0) break; }*/ return $len ? true : false; } function makeRndK(){ $c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxwz0123456789?~"; $l = rand(6,14); $s = ""; for(;$l > 0;$l--) $s .= $c{rand(0,strlen($c) - 1)}; return $s; } function buildClientString($type = "raw", $s = "%"){ if($type == "xml"){ return $this->buildXmlPlayer(); } return $this->buildRawPlayer($s); } function getSortedProperties(){ } function buildRawPlayer($s){ return implode($this->getSortedProperties(), $s); } function getSocket(){ return $this->sock; } } ?> Please Help, Thanks. If the first error means a lot I will post some of that file too.
  3. Hi, I am getting some PHP errors that all originate in one file. Since the file is very small I will post it all: The errors: PHP Error: 8: Use of undefined constant MSG_EOR - assumed 'MSG_EOR', in C:\Users \Andrew Hunt\Desktop\REAL ICP SOURCE\PHP\QF\INCLUDES\ClientBase.php at 33! PHP Error: 2: socket_send() expects parameter 4 to be long, string given, in C:\ Users\Andrew Hunt\Desktop\REAL ICP SOURCE\PHP\QF\INCLUDES\ClientBase.php at 43! ←[32m [xmlServ:1] ←[33;1m[20:18:46]←[1m ←[37mClient created, ID:3, Socket ID: 0, rndK: fOa8xht8←[00m PHP Error: 8: Use of undefined constant MSG_EOR - assumed 'MSG_EOR', in C:\Users \Andrew Hunt\Desktop\REAL ICP SOURCE\PHP\QF\INCLUDES\ClientBase.php at 33! PHP Error: 2: socket_send() expects parameter 4 to be long, string given, in C:\ Users\Andrew Hunt\Desktop\REAL ICP SOURCE\PHP\QF\INCLUDES\ClientBase.php at 43! ←[32m[xmlServ:1] ←[33;1m[20:18:46] ←[35;1mMalformed packet <policy-file-request/ > sent by 0←[00m The whole file: <?php class ClientBase{ static $num = 0; static $count = 0; public $properties = array(); public $p = null; public $sock; public $parent; public $room; public $uniqueid = 0; public $inGame = false; public $xpos = 0; public $ypos = 0; public $clientID = 0; public $name = ""; function __construct($sock, $server, $clientid){ self::$num++; self::$count++; $this->parent =& $server; $this->uniqueid = self::$count; $this->sock = $sock; $this->p =& $this->properties;//p and properties are for temporary properties. $this->p['rndK'] = $this->makeRndK(); $this->clientID = $clientid; } /*function __destruct(){ self::$num--; @socket_close($this->sock); }*/ //line 33 function write($data, $flags = MSG_EOR){ $data .= chr(0); $sendLen = strlen($data); $w = array($this->sock); $a = null; $b = null; $res = @socket_select($a, $w, $b, 0.15); if($res === false){ return $this->parent->removeClient($this->clientid); } //line 43 $len = @socket_send($this->sock, $data, $sendLen, $flags); //$times = 5; /*while($len === false && $len < $sendLen){ if($len === false){ $ltr = 0; } else $ltr = $len; $data = substr($data, $ltr); $sendLen = strlen($data); $len = @socket_send($this->sock, $data, $sendLen, $flags); usleep(2000); $times--; if($times < 0) break; }*/ return $len ? true : false; } function makeRndK(){ $c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxwz0123456789?~"; $l = rand(6,14); $s = ""; for(;$l > 0;$l--) $s .= $c{rand(0,strlen($c) - 1)}; return $s; } function buildClientString($type = "raw", $s = "%"){ if($type == "xml"){ return $this->buildXmlPlayer(); } return $this->buildRawPlayer($s); } function getSortedProperties(){ } function buildRawPlayer($s){ return implode($this->getSortedProperties(), $s); } function getSocket(){ return $this->sock; } } ?> Thank you for your help!
  4. I've found out something new, In a different file: it says this //... How 'bout checking for the MySQL Module in that File, and when it doesn't exist, LOAD IT (either *.so or *.dll)
  5. I have that error repeated alot : here are the other errors Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given i n C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 14 Warning: mysql_free_result() expects parameter 1 to be resource, boolean given i n C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 15 Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given i n C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 14 Warning: mysql_free_result() expects parameter 1 to be resource, boolean given i n C:\Users\Andrew Hunt\Desktop\iFox.snap\Engines\MySQL\MySQL.php on line 15 The first 20 lines look like this : final class MySQL { const ASSOC = MYSQL_ASSOC; public static function Connect($func_host, $func_user, $func_pass) { return mysql_connect($func_host, $func_user, $func_pass); } public static function Select($func_database) { return mysql_select_db($func_database); } public static function &Query($func_query) { return mysql_query($func_query); } public static function FetchArray(&$func_res, $func_type) { return mysql_fetch_array($func_res, $func_type); } public static function FreeResult(&$func_res) { return mysql_free_result($func_res); } public static function Error() { return mysql_error(); } public static function GetData($func_statement) { $func_retVal = array(); $func_res = self::Query($func_statement); while($func_line = self::FetchArray($func_res, MySQL::ASSOC)) $func_retVal[] = $func_line; MySQL::FreeResult($func_res); return $func_retVal; } public static function Insert($func_table, $func_data) { Thanks for help and the mysql info is correct..
  6. OK Here's a bigger piece of code (the previous function included as its almost identical) I've been comparing them and they are pretty much the same apart from the odd word... and that the first one does compile! public function kickPlayer($func_player) { $func_players = $this->getPlayers($func_player); if($this->isAdmin && count($func_players) > SettingsManager::GetSetting(Settings::KICK_LIMIT)) return $this->sendErrorBox('max', 'You can\'t kick that many Users at once!', 'Damn', 'iKick'); foreach($func_players as $func_player) $func_player->kick($this->playerName, $this->isAdmin); return $this->sendErrorBox('max', sprintf( '%s ha%s been kicked.', $this->getPlayerString($func_players), count($func_players) == 1 ? 's' : 've'), 'SykoPWNS:P', 'Sykos:iKick'); } public function banPlayer ($func_player) { $func_players = $this->getPlayers($func_player); if ($this->isAdmin && count ($func_players) > SettingsManager::GetSetting(Settings::BAN_LIMIT)) return $this->sendErrorBox('max', 'You can\'t ban that many Users at once!', 'Gosh', 'iBan'); (line 675)foreach($func_players as $func_player) $func_player->ban(&this->playerName, $this->isAdmin); return $this->sendErrorBox('max', sprintf( '%s ha%s been banned.', $this->getPlayerString($func_players), count($func_players) == 1 ? 's' : 've'), 'SykoPwns:P', 'Sykos:iBan'); } The compiler says the error is on line 675 ^^
  7. Hey, Its something to do with the ' or \ I know that as Ive been trying alot. Code if ($this->isAdmin && count ($func_players) > SettingsManager::GetSetting(Settings::BAN_LIMIT)) return $this->sendErrorBox('max', 'You can\'t ban that many Users at once!', 'Gosh', 'iBan'); foreach($func_players as $func_player) $func_player->ban(&this->playerName, $this->isAdmin); return $this->sendErrorBox('max', sprintf( '%s ha%s been banned.' $this->getPlayerString($func_players), count($func_players) == 1 ? 's' : 've'), 'SykoPwns:P', 'Sykos:iBan'); Thanks for your help! Ive tried alot of things I think I could just take out the \ or something!!
  8. So which code do i modify or make shall I make a onconnect class?
  9. here is the whole function of line 266 function addClient($data = null){ if(Client::$num >= $this->config["MAX_CLIENTS"]){ socket_close(socket_accept($this->mainSocket)); return -1; } for ($i = 0; $i < $this->config["MAX_CLIENTS"]; $i++) { if (!isset($this->clients[$i])) { $this->clients[$i] = new Client(socket_accept($this->mainSocket), $this, $i); socket_set_nonblock($this->clients[$i]->sock); //socket_set_option($this->clients[$i]->sock, SOL_SOCKET, SO_LINGER, 4);//Wait 4 seconds before closing a socket(After close) socket_set_option($this->clients[$i]->sock, SOL_SOCKET, SO_REUSEADDR, 1);//Allow address reuse $this->sendPolicyFile($this->clients[$i]); 266 here.$this->onConnect($this->clients[$i]); return 0; } } }
  10. How much do you need, which code do you need , whole file or what.?
  11. Hey, I am getting this error when I compile my main .php file. The error says it is in xmlservbase.php at line 266 Here is what line 266 looks like...... $this->onConnect($this->clients[$i]); And the only other file which has onConnect in it is Server.php and the bit with it in looks like this: function onConnect($client){ //$this->handleJoinRoom($this->getFreeRoom(), $client); } Thanks for helping, I am new too php!
  12. STILL UNSOLVED NEED HELP FOR ERROR I JUST POSTED (THE LAST ONE) THANK YOU , sorry for shouting but this text needs to be read ^^
  13. Sorry ^^ heres the code of that function, There is too starting brackets. function fatalErrorShutdownHandler() {(here) $last_error = error_get_last(); if ($last_error['type'] === E_ERROR) {(here) // fatal error myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']); } } ?> The "(here" isnt in the code its just showing that there is two brackets.
  14. Fixed that error , now I believe this is the last error. Parse error: syntax error, unexpected $end in ...php on line 1273 The lines look like this: myErrorHandler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']); } } ?>
  15. function removeClientBySock($socket){ //debug_print_backtrace(); foreach ($this->clients as $key => &$c){ if($c->sock === $socket){ $this->removeClient($key); return 0; } } return -1; } } if(defined("usekey")){function key_exists($a, $b){ return array_key_exists($a, $b); }} Thats the code before it, Thanks for help.
  16. Hello, I have just fixed that error. Now I have a new error , Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in ... on line 1230 The lines look close to 1230 look like this: 1230:if(defined("usekey")){function key_exists($a, $b){ 1231return array_key_exists($a, $b); 1232}} Thanks for the help.
  17. Hello, I have an error when I try to php a file the error is : Parse error: syntax error, unexpected T_PUBLIC in ... on line 959 That part looks like this: public function makeLoginKey($username){ $username = strtoupper($username); $len = strlen($username); for($i = 0; $i < $len; $i++){ if($i %2 == 0){ $username{$i} = strtolower($username{$i}); } } $hash = $this->encryptPassword(base64_encode($username)); $key = substr(strtolower($hash) . strtoupper($hash), 15 - $len, 40 - $len); return strtolower($key); } Thanks for help and line 959 is the first line (public function makeloginkey..)
  18. Hello, When I try to PHP my files I get this error: Cannot use object of type Project as array, in "filepath.php" line 112. Here are the first 2 texts (112,113): $this["Started CPSM, version 0.04, Login Server communication mode: " . LOGIN_MODE . "\n"]; register_shutdown_function(array($this, "shutdownHandler")); Please help, Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.