node-gamedig/reference/savage2/lgsl.txt
2014-02-03 15:09:00 -06:00

46 lines
2.3 KiB
Text

/*----------------------------------------------------------------------------------------------------------\
| |
| [ LIVE GAME SERVER LIST ] [ © RICHARD PERRY FROM GREYCUBE.COM ] |
| |
| Released under the terms and conditions of the GNU General Public License Version 3 (http://gnu.org) |
| |
\-----------------------------------------------------------------------------------------------------------*/
//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+
function lgsl_query_18(&$server, &$lgsl_need, &$lgsl_fp)
{
//---------------------------------------------------------+
// REFERENCE: http://masterserver.savage2.s2games.com
fwrite($lgsl_fp, "\x01");
$buffer = fread($lgsl_fp, 4096);
if (!$buffer) { return FALSE; }
//---------------------------------------------------------+
$buffer = substr($buffer, 12); // REMOVE HEADER
$server['s']['name'] = lgsl_cut_string($buffer);
$server['s']['players'] = ord(lgsl_cut_byte($buffer, 1));
$server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 1));
$server['e']['time'] = lgsl_cut_string($buffer);
$server['s']['map'] = lgsl_cut_string($buffer);
$server['e']['nextmap'] = lgsl_cut_string($buffer);
$server['e']['location'] = lgsl_cut_string($buffer);
$server['e']['minimum_players'] = ord(lgsl_cut_string($buffer));
$server['e']['gamemode'] = lgsl_cut_string($buffer);
$server['e']['version'] = lgsl_cut_string($buffer);
$server['e']['minimum_level'] = ord(lgsl_cut_byte($buffer, 1));
// DOES NOT RETURN PLAYER INFORMATION
//---------------------------------------------------------+
return TRUE;
}