mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Add a bunch of reference docs
This commit is contained in:
parent
bc6b5c9225
commit
473d9544b1
32 changed files with 1282 additions and 0 deletions
55
reference/savage2/gameq.txt
Normal file
55
reference/savage2/gameq.txt
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of GameQ.
|
||||
*
|
||||
* GameQ is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GameQ is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: savage2.php,v 1.1 2008/05/22 14:16:11 tombuskens Exp $
|
||||
*/
|
||||
|
||||
[savage2]
|
||||
status = "\x01"
|
||||
|
||||
|
||||
require_once GAMEQ_BASE . 'Protocol.php';
|
||||
|
||||
|
||||
/**
|
||||
* Savage 2 Protocol
|
||||
*
|
||||
* @author Tom Buskens <t.buskens@deviation.nl>
|
||||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
class GameQ_Protocol_savage2 extends GameQ_Protocol
|
||||
{
|
||||
/*
|
||||
* status packet
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
$this->p->skip(12);
|
||||
$this->r->add('hostname', $this->p->readString());
|
||||
$this->r->add('num_players', $this->p->readInt8());
|
||||
$this->r->add('max_players', $this->p->readInt8());
|
||||
$this->r->add('time', $this->p->readString());
|
||||
$this->r->add('map', $this->p->readString());
|
||||
$this->r->add('nextmap', $this->p->readString());
|
||||
$this->r->add('location', $this->p->readString());
|
||||
$this->r->add('min_players', $this->p->readInt8());
|
||||
$this->r->add('gametype', $this->p->readString());
|
||||
$this->r->add('version', $this->p->readString());
|
||||
$this->r->add('min_level', $this->p->readInt8());
|
||||
}
|
||||
}
|
||||
?>
|
||||
46
reference/savage2/lgsl.txt
Normal file
46
reference/savage2/lgsl.txt
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
/*----------------------------------------------------------------------------------------------------------\
|
||||
| |
|
||||
| [ 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue