/************************************************************************/ /* Squery 3.9 Standalone Query code */ /* ================================================= */ /* */ /* Copyright (c) 2005 Curtis Brown (webmaster@squery.com) */ /* http://www.squery.com */ /* */ /* */ /* These files are the base code for all methods of use. */ /* */ /* To configure: */ /* You must edit your settings in the config.php file */ /* located in the /SQuery/lib/ directory. */ /* */ /************************************************************************/ error_reporting(0); // redefine the user error constants - PHP 4 only define("FATAL", E_ERROR); define("ERROR", E_WARNING); define("WARNING", E_NOTICE); define("OTHER", E_PARSE); // error handler function function myErrorHandler($errno, $errstr, $errfile, $errline) { echo ""; } // set to the user defined error handler $old_error_handler = set_error_handler("myErrorHandler"); function showFavorites() { global $favorites; $cnt = count($favorites); if ($cnt > 0) echo "("; for ($i=0;$i<$cnt;$i++) { $z = explode(",", $favorites[$i]); echo " $z[0] "; if ($i+1 < $cnt) echo checkmark(); } if ($cnt > 0) echo ")"; } $blockmode=0; $ip = $_GET['ip']; $port = $_GET['port'];$qgame = $_GET['game']; $blockmode = $_GET['block']; $libpath="./lib/"; // require our main library =) require($libpath.'main.lib.php'); ////////////////////////////////////////////////////////// function queryServer($address, $port, $protocol) { global $libpath; include_once($libpath."gsQuery.php"); if(!$address && !$port && !$protocol) { echo "No parameters given\n"; return FALSE; } $gameserver=gsQuery::createInstance($protocol, $address, $port); if(!$gameserver) { echo "Could not instantiate gsQuery class. Does the protocol you've specified exist?\n"; return FALSE; } if(!$gameserver->query_server(TRUE, TRUE)) { // fetch everything // query was not succesful, dumping some debug info echo "