mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 00:38:31 +01:00
54 lines
2.1 KiB
Text
54 lines
2.1 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_21(&$server, &$lgsl_need, &$lgsl_fp)
|
|
{
|
|
//---------------------------------------------------------+
|
|
|
|
fwrite($lgsl_fp,"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffgief");
|
|
|
|
$buffer = fread($lgsl_fp, 4096);
|
|
$buffer = substr($buffer, 20); // REMOVE HEADER
|
|
|
|
if (!$buffer) { return FALSE; }
|
|
|
|
//---------------------------------------------------------+
|
|
|
|
$server['s']['name'] = lgsl_cut_string($buffer);
|
|
$server['s']['map'] = lgsl_cut_string($buffer);
|
|
$server['e']['gamemode'] = lgsl_cut_string($buffer);
|
|
$server['s']['password'] = lgsl_cut_string($buffer);
|
|
$server['e']['progress'] = lgsl_cut_string($buffer)."%";
|
|
$server['s']['players'] = lgsl_cut_string($buffer);
|
|
$server['s']['playersmax'] = lgsl_cut_string($buffer);
|
|
|
|
switch ($server['e']['gamemode'])
|
|
{
|
|
case 0: $server['e']['gamemode'] = "Deathmatch"; break;
|
|
case 1: $server['e']['gamemode'] = "Team Deathmatch"; break;
|
|
case 2: $server['e']['gamemode'] = "Capture The Flag"; break;
|
|
}
|
|
|
|
//---------------------------------------------------------+
|
|
|
|
$player_key = 0;
|
|
|
|
while ($buffer)
|
|
{
|
|
$server['p'][$player_key]['name'] = lgsl_cut_string($buffer);
|
|
$server['p'][$player_key]['score'] = lgsl_cut_string($buffer);
|
|
|
|
$player_key ++;
|
|
}
|
|
|
|
//---------------------------------------------------------+
|
|
|
|
return TRUE;
|
|
}
|