Tpserver-cpp/Admin
From Thousand Parsec Wiki
The remote administration project intends to remove the internal console from tpserver-cpp and replace it with a protocol which can be accessed by administration clients in a variety of useful ways. This was originally developed for Google Summer of Code 2008 by Aaron Mavrinac / ezod.
Administration Protocol Extension
Overview
The administration client will connect and authenticate in a manner similar to the game protocol. Once connected, it may receive log messages and issue commands.
The main CLI client must store all available command descriptions locally (for command line verification, tab completion, etc.). It initially grabs the full current command set from the server upon a successful connection. After any operation which could result in new commands becoming available on the server, such as loading a ruleset, this local set must be updated.
Some command IDs are static and reserved for important server commands which all servers support. These include the commands which will be used by tpclient-pywx and other game clients to start a local server for single-player mode.
Summary
The following table contains both existing protocol frames and new administration-related frames (the latter are bold). The server must support all of these frame types and ignore others.
This protocol extension requires version 0.3 or greater of the TP protocol.
| Value | Name | Description | Base | Dir |
|---|---|---|---|---|
| Header Frame | any | |||
| Request Frame | Header | server | ||
| Response Frame | Header | client | ||
| 0 | Okay Frame | A request was successful in some sort of way. | Response | |
| 1 | Fail Frame | A request has failed in some sort of way. | Response | |
| 2 | Sequence Frame | Frame which says that there are multiple frames coming in response to the request. | Response | |
| 3 | Connect Frame | Request | ||
| 4 | Login Frame | Request | ||
| 1000 | Log Message Frame | Frame containing a log message to display at the client. | Header | client |
| 1001 | Command Update Frame | Frame instructing the client to pull command set descriptions. | Header | client |
| Get With ID Frame | Used to get things (commands) using their IDs. | Request | ||
| Get ID Sequence Frame | Request | |||
| ID Sequence Frame | A sequence of IDs. | Response | ||
| 1002 | Get Command Description Frame | Gets a description for a single command. | Get With ID | |
| 1003 | Command Description Frame | Frame describing a command. | Response | |
| 1004 | Get Command Description IDs Frame | Gets a sequence of active commands available on this server. | Get ID Sequence | |
| 1005 | List of Command Description IDs Frame | ID Sequence | ||
| 1006 | Command Frame | Issues a command to the server. | Request | |
| 1007 | Command Result Frame | Response frame with the result of the command. | Response |
