A long time in the making, I have finally enough courage to release the first beta of my game related code. The code covers the protocols for communicating with game servers and also provides an ASP.NET server control to use in your website.
The servers are for First Person Shooter (FPS) games, where players can connect to put their skills to the test. These games are 3D games that use a particular engine to render the graphics. The servers that allow players to play against each other on LAN or online also offer querying capabilities. This way you can find out which level is currently running and which players are connected. Most types of game servers allow remote control (RCON), so you can send commands to administer the server. This allows you to change the level, or kick players from the server.
The game servers all communicate in a low level byte format, that has nothing to do with HTTP, XML or other common protocols. The exchanges that are made occur on UDP or TCP level and are usually compact sequences of bytes. The challenge is to figure out what the sequences are. These protocols are tied to the rendering engine most of the time, so a game like Day of Defeat and Counter-Strike, which use the same Half-Life engine, also use the same query and rcon protocol.
In this beta 0.1 release you will find two assemblies:
Contains the game server related protocols to communicate with the particular game server. Defines interface for the protocols.
Contains a single ASP.NET server control GameServerStatus that allows you to view the status of a server.
The GameServerStatus control has some cool features:
- Views and templates for Status and Timeout, to allow control over the output for retrieved status and timeouts
- Convert to Template (like some of the ASP.NET 2.0 controls have)
- Supports skinning, theming and localization
- Binding to status data
Currently, the protocols that are supported are:
- Half-Life engine (status and rcon): examples are Counter-Strike 1.6, Condition Zero, Opposing Force
- Source engine (status and rcon): e.g. Counter-Strike Source, Day of Defeat Source, Half-Life 2 Deathmatch and HL2 Capture The Flag.
- Unreal 1 (rcon only): e.g. Unreal Tournament, BattleField 1942.
More protocols are lined up, as soon as I have time for those: Quake 2 and Quake 3, Unreal 2 and GameSpy.
Credit also goes to Terry Henning who wrote GameTracker. I used his code as a starting point. It has since gone into a whole new code branch.