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
64
reference/ghostrecon/gameq.txt
Normal file
64
reference/ghostrecon/gameq.txt
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?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: ghostrecon.php,v 1.1 2007/07/02 10:14:32 tombuskens Exp $
|
||||
*/
|
||||
|
||||
[ghostrecon]
|
||||
status = "\xc0\xde\xf1\x11\x42\x06\x00\xf5\x03\x00\x78\x30\x63"
|
||||
|
||||
|
||||
require_once GAMEQ_BASE . 'Protocol.php';
|
||||
|
||||
|
||||
/**
|
||||
* Ghost Recon protocol
|
||||
*
|
||||
* @author Tom Buskens <t.buskens@deviation.nl>
|
||||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
class GameQ_Protocol_ghostrecon extends GameQ_Protocol
|
||||
{
|
||||
/*
|
||||
* Status
|
||||
*/
|
||||
public function status()
|
||||
{
|
||||
// Unknown
|
||||
$this->p->skip(25);
|
||||
|
||||
$this->r->add('servername', $this->readGhostString());
|
||||
$this->r->add('map', $this->readGhostString());
|
||||
$this->r->add('mission', $this->readGhostString());
|
||||
$this->r->add('gametype', $this->readGhostString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a Ghost Recon string
|
||||
*
|
||||
* @return string The string
|
||||
*/
|
||||
private function readGhostString()
|
||||
{
|
||||
if ($this->p->getLength() < 4) return '';
|
||||
$this->p->skip(4);
|
||||
|
||||
return $this->p->readString();
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
133
reference/ghostrecon/lgsl.txt
Normal file
133
reference/ghostrecon/lgsl.txt
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
|
||||
/*----------------------------------------------------------------------------------------------------------\
|
||||
| |
|
||||
| [ 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_19(&$server, &$lgsl_need, &$lgsl_fp)
|
||||
{
|
||||
//---------------------------------------------------------+
|
||||
|
||||
fwrite($lgsl_fp, "\xC0\xDE\xF1\x11\x42\x06\x00\xF5\x03\x21\x21\x21\x21");
|
||||
|
||||
$buffer = fread($lgsl_fp, 4096);
|
||||
|
||||
if (!$buffer) { return FALSE; }
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
$buffer = substr($buffer, 25); // REMOVE HEADER
|
||||
|
||||
$server['s']['name'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
$server['s']['map'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
$server['e']['nextmap'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
$server['e']['gametype'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
|
||||
$buffer = substr($buffer, 1);
|
||||
|
||||
$server['s']['password'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['s']['playersmax'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
$server['s']['players'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
for ($player_key=0; $player_key<$server['s']['players']; $player_key++)
|
||||
{
|
||||
$server['p'][$player_key]['name'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
$buffer = substr($buffer, 17);
|
||||
|
||||
$server['e']['version'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
$server['e']['mods'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
$server['e']['dedicated'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['time'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['status'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
$server['e']['gamemode'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
$server['e']['motd'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
$server['e']['respawns'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
$server['e']['time_limit'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['voting'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
|
||||
$buffer = substr($buffer, 2);
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
for ($player_key=0; $player_key<$server['s']['players']; $player_key++)
|
||||
{
|
||||
$server['p'][$player_key]['team'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
|
||||
$unknown = ord(lgsl_cut_byte($buffer, 1));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
$buffer = substr($buffer, 7);
|
||||
|
||||
$server['e']['platoon_1_color'] = ord(lgsl_cut_byte($buffer, 8));
|
||||
$server['e']['platoon_2_color'] = ord(lgsl_cut_byte($buffer, 8));
|
||||
$server['e']['platoon_3_color'] = ord(lgsl_cut_byte($buffer, 8));
|
||||
$server['e']['platoon_4_color'] = ord(lgsl_cut_byte($buffer, 8));
|
||||
$server['e']['timer_on'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['timer_time'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['time_debriefing'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['time_respawn_min'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['time_respawn_max'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['time_respawn_safe'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['difficulty'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
$server['e']['respawn_total'] = ord(lgsl_cut_byte($buffer, 4));
|
||||
$server['e']['random_insertions'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['spectators'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['arcademode'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['ai_backup'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['random_teams'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['time_starting'] = lgsl_time(lgsl_unpack(lgsl_cut_byte($buffer, 4), "f"));
|
||||
$server['e']['identify_friends'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
$server['e']['identify_threats'] = ord(lgsl_cut_byte($buffer, 1));
|
||||
|
||||
$buffer = substr($buffer, 5);
|
||||
|
||||
$server['e']['restrictions'] = lgsl_get_string(lgsl_cut_pascal($buffer, 4, 3, -3));
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
switch ($server['e']['status'])
|
||||
{
|
||||
case 3: $server['e']['status'] = "Joining"; break;
|
||||
case 4: $server['e']['status'] = "Joining"; break;
|
||||
case 5: $server['e']['status'] = "Joining"; break;
|
||||
}
|
||||
|
||||
switch ($server['e']['gamemode'])
|
||||
{
|
||||
case 2: $server['e']['gamemode'] = "Co-Op"; break;
|
||||
case 3: $server['e']['gamemode'] = "Solo"; break;
|
||||
case 4: $server['e']['gamemode'] = "Team"; break;
|
||||
}
|
||||
|
||||
switch ($server['e']['respawns'])
|
||||
{
|
||||
case 0: $server['e']['respawns'] = "None"; break;
|
||||
case 1: $server['e']['respawns'] = "Individual"; break;
|
||||
case 2: $server['e']['respawns'] = "Team"; break;
|
||||
case 3: $server['e']['respawns'] = "Infinite"; break;
|
||||
}
|
||||
|
||||
switch ($server['e']['difficulty'])
|
||||
{
|
||||
case 0: $server['e']['difficulty'] = "Recruit"; break;
|
||||
case 1: $server['e']['difficulty'] = "Veteran"; break;
|
||||
case 2: $server['e']['difficulty'] = "Elite"; break;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
229
reference/ghostrecon/qstat_info.txt
Normal file
229
reference/ghostrecon/qstat_info.txt
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
/*********
|
||||
QStat - Real-time game server stats
|
||||
http://sourceforge.net/p/qstat/
|
||||
License: The Artistic License 2.0
|
||||
*********/
|
||||
|
||||
Ghost Recon - QStat notes
|
||||
-------------------------
|
||||
|
||||
The following Server Stats are pulled from the Ghost Recon Server - NOTE
|
||||
many other stats continue to work as normal due to the base qstat program.
|
||||
|
||||
$SERVERNAME
|
||||
|
||||
The name of the GR Server.
|
||||
|
||||
$PLAYERS
|
||||
|
||||
The number of Players that are playing, oberving or in the Lobby
|
||||
(note the ignoreserverplayer Argument above)
|
||||
|
||||
$MAXPLAYERS
|
||||
|
||||
The maximum players that the server will allow playing, oberving
|
||||
or in the Lobby (note the ignoreserverplayer Argument above)
|
||||
|
||||
$MAP
|
||||
|
||||
The Name of the MAP that is being used (NOTE not the Mission)
|
||||
|
||||
$GAME
|
||||
|
||||
The Mods that the server is running. Ex: mp1; is the Desert
|
||||
Seige Mod
|
||||
|
||||
$(RULE:error)
|
||||
|
||||
If an error occured there may be some detail here. IF the problm
|
||||
occurred very early in the interpretation then $SERVERNAME will
|
||||
hold the details.
|
||||
|
||||
$(RULE:mission)
|
||||
|
||||
The name of the Mission that the server is running.
|
||||
|
||||
$(RULE:gamemode)
|
||||
|
||||
What is the Game Mode that the server is in. Known values are
|
||||
COOP, TEAM and SOLO
|
||||
|
||||
$(RULE:missiontype)
|
||||
|
||||
What is the Mission Type. Known Values are: Mission, Firefight,
|
||||
Recon, Hamburger Hill, Last Man Standing, Sharpshooter, Search
|
||||
And Rescue, Domination, and Seige.
|
||||
|
||||
$(RULE:dedicated)
|
||||
|
||||
Is this server Dedicated; Yes or No.
|
||||
|
||||
$(RULE:status)
|
||||
|
||||
What is the Playing Status of the Server, values are Playing,
|
||||
Joining or Debrief.
|
||||
|
||||
$(RULE:gametime)
|
||||
|
||||
What is the Time limit for the Game. Values are 00:00, 05:00,
|
||||
10:00, 15:00 20:00, 25:00, 30:00, 45:00 and 60:00. The 00:00
|
||||
is for an unlimited game. The format of this uses the -ts,
|
||||
-tc and -tsw command line options.
|
||||
|
||||
$(RULE:timeplayed)
|
||||
|
||||
How long has this game been playing. The format of this uses
|
||||
the -ts, -tc and -tsw command line options.
|
||||
|
||||
$(RULE:remainingtime)
|
||||
|
||||
How much time is left in this game. The format of this uses
|
||||
the -ts, -tc and -tsw command line options.
|
||||
|
||||
$(RULE:version)
|
||||
|
||||
What is the Version number reported by the server. Patch 1.2 =
|
||||
10.1010A, Patch 1.3 = 11.101A
|
||||
|
||||
$(RULE:spawntype)
|
||||
|
||||
What type of spawn is in use. Known Values are None, Infinite,
|
||||
Individual and Team.
|
||||
|
||||
$(RULE:spawncount)
|
||||
|
||||
How many spawns are allowed. Enhancment possibility to add
|
||||
$(IF:SPAWN) to filter out when spawntype is none.
|
||||
|
||||
$(RULE:restrict)
|
||||
|
||||
What Weapon restrictions are in force for the server.
|
||||
|
||||
$(RULE:password)
|
||||
|
||||
Does the Server have a join password defined Yes or No.
|
||||
|
||||
$(RULE:ti)
|
||||
|
||||
Is the server using the Threat Indicator.
|
||||
|
||||
$(RULE:motd)
|
||||
|
||||
What is the Message Of The Day - Note these can be quite big.
|
||||
|
||||
$(RULE:patch)
|
||||
|
||||
What is the patch level of the GR Server.
|
||||
|
||||
$(RULE:usestarttime)
|
||||
|
||||
Is the server configured to start a game after "starttimeset"
|
||||
(Yes) OR does everyone need to click on ready (no).
|
||||
|
||||
$(RULE:starttimeset)
|
||||
|
||||
What time is configured to automatically start the next round.
|
||||
|
||||
$(RULE:debrieftime)
|
||||
|
||||
How long does the server wait at the Debrief screen after
|
||||
a mission.
|
||||
|
||||
$(RULE:respawnmin)
|
||||
|
||||
How long must a dead player wait before he can repawn.
|
||||
|
||||
$(RULE:respawnmax)
|
||||
|
||||
What is the longest time that a user has to respawn.
|
||||
|
||||
$(RULE:respawnsafe)
|
||||
|
||||
How long after respawn is a player invulnerable/cannot damage
|
||||
others.
|
||||
|
||||
$(RULE:allowobservers)
|
||||
|
||||
Does the server allow observers? Yes or No
|
||||
|
||||
$(RULE:startwait)
|
||||
|
||||
How long untill the automatic start timer forces the next game
|
||||
to start.
|
||||
|
||||
$(RULE:iff)
|
||||
|
||||
What Identification - Friend or Foe is configured. None,
|
||||
Reticule or Names
|
||||
|
||||
$PLAYERNAME
|
||||
|
||||
What is the Players Name.
|
||||
|
||||
$TEAMNUM
|
||||
|
||||
What Team Number is the Player On. Known Values are 1,2,3,4,5.
|
||||
1 is Team BLUE, 2 is Team Read, 3 is Team Yellow, 4 is
|
||||
Team Green, 5 is Unassigned (observer or in lobby)
|
||||
|
||||
$TEAMNAME
|
||||
|
||||
What is the Name of the Team, see above.
|
||||
|
||||
$DEATHS
|
||||
|
||||
What is the health of this player. 0 Alive, 1 Dead. Note if the
|
||||
player has spawns remaining this can change from 1 back to 0.
|
||||
Enhancement possibility to add $HEALTH or $(RULE:health).
|
||||
Hopefully RSE/UBI will add the Deaths, Frags, and Ping to the
|
||||
availible information. If this happens then it would be better
|
||||
to have a $HEALTH
|
||||
|
||||
$(IF:DEATHS) and $(IFNOT:DEATHS)
|
||||
|
||||
A Test to see if the player is dead. Usefull in this constuct:
|
||||
$(IF:DEATHS)Dead$(ENDIF)$(IFNOT:DEATHS)Alive$(ENDIF)
|
||||
|
||||
Ghost Recon communicates on two UDP ports and one TCP stream. Normally TCP
|
||||
is on port 2346 and carries the game dialog. This is the port number
|
||||
that is mentioned in the game so we use it and apply an offset to get the
|
||||
port number for status queries. Port 2347 gives some high level server stats
|
||||
and 2348 gives fairly low level server stats. QStat is designed around
|
||||
a single port per server so the 2348 port is used. One down side to this
|
||||
is the lack of many meaningful detail player stats (Deaths, frags, hit
|
||||
percentage, ping etc.). I imagines that some of these are availible in
|
||||
the TCP stream but that would be difficult to add to a program like QStat.
|
||||
|
||||
The Ghost Recon packets are variable structures with a lot of string
|
||||
lengths. This requires fairly defensive programming as Red Storm
|
||||
Entertainment is not forthcoming with any details.
|
||||
|
||||
This release adds support for the GhostRecon game. Number one note
|
||||
is that Red Storm and UBI do not provide the information that many
|
||||
Quake based users expect. Specifically they do not make Frags, Deaths
|
||||
Connect Time or Pings availible - at least not as far as I can tell.
|
||||
That said there are quite a few things that are availible and allow a
|
||||
server administrator to make the status of his or her server available
|
||||
to the public via the web.
|
||||
|
||||
This change uses all undocumented interfaces to the Ghost Recon server
|
||||
so will most likely break when you install a patch. It has been tested
|
||||
against the Desert Seige update and several public servers. It should
|
||||
work against the 1.2, 1.3, and 1.4 patches and Island Thunder add-on to
|
||||
Ghost Recon.
|
||||
|
||||
The Ghost Recon game type is GRS. For command-line queries, use -grs
|
||||
|
||||
There is one query argument to this server, ignoreserverplayer.
|
||||
This option controls whether the first player is ignored. Ghost Recon
|
||||
requires that the dedicated server program take up one of the player slots
|
||||
(always the first slot). The ignoreserverplayer option defaults to 'yes',
|
||||
so the "server player" will normally not be seen. If you are running
|
||||
a non-dedicated server, then set ignoreserverplayer to 'no' like this:
|
||||
|
||||
-grs,ignoreserverplayer=no
|
||||
|
||||
Otherwise you would not be able to display your own stats.
|
||||
|
||||
|
||||
Ghost Recon support provided by Bob Marriott.
|
||||
Loading…
Add table
Add a link
Reference in a new issue