Skip to content

Chat Commands

gatchi edited this page Mar 18, 2017 · 28 revisions

When people say "command" or "GM command" with regards to Teth, they are usually talking about chat commands. Chat commands are game functions that are accessible via the chat interface found in lobbies and in the field. Theyre easy to spot -- they all start with a "/".

Here's a list of vanilla Teth commands: :TODO:

Code (Send06)

Chat commands are handled in ship_server.c on vanilla teth and in funcs4.h on PSONOVA in a function called Send06.

At an if blocked started with "if (commandLen)" (approx. line 91 on PSONOVA) is the code for parsing command text. This is where each command is individually handled. If you want to tweak a command or add a new one, this is where it'd go.

Some variables to consider when tweaking or writing commands:

  • commandLen = the length of the entire command string, including arguments (or in other words, how many characters are in the chat command message sent to the server)
  • myCommand = the command passed in (a pointer to the command input buffer)
  • myCmdArgs = how many arguments were taken in with the command (an integer)
  • myArgs = the list of arguments (string array)

Useful functions

  • SendB0, great for sending feedback to the client user, it displays a text message on their screen
  • SendEE, can be used to alert playerbase of the effects of a command being used
  • WriteGM and WriteLog, for logging command use

Ideally, each chat command if block would run a corresponding function. As is, all the code is stored in the single Send06 function block.

Clone this wiki locally