mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +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
65
reference/teeworlds/gameq.txt
Normal file
65
reference/teeworlds/gameq.txt
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?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: teeworlds.php,v 1.2 2009/03/09 13:36:32 tombuskens Exp $
|
||||
*/
|
||||
|
||||
[teeworlds]
|
||||
status = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFFgief"
|
||||
|
||||
|
||||
require_once GAMEQ_BASE . 'Protocol.php';
|
||||
|
||||
|
||||
/**
|
||||
* Teeworlds protocol
|
||||
*
|
||||
* @author Tom Buskens <t.buskens@deviation.nl>
|
||||
* @version $Revision: 1.2 $
|
||||
*/
|
||||
class GameQ_Protocol_teeworlds extends GameQ_Protocol
|
||||
{
|
||||
/*
|
||||
* status packet
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
$this->p->skip(14);
|
||||
|
||||
$this->r->add('version', $this->p->readString());
|
||||
$this->r->add('hostname', $this->p->readString());
|
||||
$this->r->add('map', $this->p->readString());
|
||||
$this->r->add('gametype', $this->p->readString());
|
||||
|
||||
|
||||
$this->r->add('password', $this->p->readString());
|
||||
$this->r->add('ping', $this->p->readString());
|
||||
$this->r->add('num_players', $this->p->readString());
|
||||
$this->r->add('max_players', $this->p->readString());
|
||||
|
||||
$this->players();
|
||||
}
|
||||
|
||||
private function players()
|
||||
{
|
||||
while ($name = $this->p->readString()) {
|
||||
$this->r->addPlayer('name', $name);
|
||||
$this->r->addPlayer('score', $this->p->readString());
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
54
reference/teeworlds/lgsl.txt
Normal file
54
reference/teeworlds/lgsl.txt
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
/*----------------------------------------------------------------------------------------------------------\
|
||||
| |
|
||||
| [ 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue