======Protocol======
Packets follow this layout
  [ID byte][Size of data(byte)][data]

====Authentication====

  -Establish connection with the login server on the Internal Communications Port Default: 7112
  -The login server will send the packet 01 00 which is a request for the account name and password
  -The proper reply to this:

  [0xFE][Data size][Account Name][Password Hash (SHA-256 32 bytes)]

After sending this packet to the server, the server will send one of the following packets in reply.

  *If the account does not have permission to use the admin console

  [0x0C][0x00]

  *If the account passed verification and is now ready for commands

  [0x0D][0x00]

  *If the verification failed due to a database error or any other reason
  
  [0x0E][0x00]

  *If the verification failed due to the account name not existing in the database

  [0x0F][0x00]

====Command Send/Receive====

Once verification succeeds the admin should be presented with a command line. Everything entered on the command line is sent to the server when return or enter is pressed. The buffer for the command line data must be at least 250 bytes in size. These packets use the following format:

  [0xFF][Size of data, max 250][Data max of 250 bytes]

**NOTE: The server only processes ONE command at any given time. The admin console MUST WAIT for a response from the server before sending another command.** The server will reply with a packet using the following format:

  [0xFF][Size of data, max 250][Data max of 250 bytes]

These packets are treated as a single line of data. When a packet is received with the data reading "TERMINATOR" it marks the termination of the command. Meaning the client can send another command after "TERMINATOR" is received. The client is only allowed to send one line per command.

====File Transfers====
The server can send files, but cannot receive them.

**ASCII**

First send the transfer start packet which is just a normal command packet with FILEASCII as the head, a space, and then the filename:
  FILEASCII [filename]
Then start sending the file in chunks of 220 bytes.

**End the file transfer**

To finish the file transfer for both types send FILEEND
  FILEEND

======Command Implementation======
Commands must be issued to the server in lower case. Argument case does not matter. The client should not be consider commands terminated until a command packet arrives with "TERMINATOR" in it. 

Commands that require the user to select something require a bit more work on the client side. Here is an example of what the admin types to retrieve a list of numerical options. (Note: This command may or may not exist, it is only being used as an example)

  target

The server will return a list of all available targets. Switches can then be used to perform actions on that target. Before the terminator packet the server sends a "command select" info packet to the client. Please note, the selection list is always numerical. The packet is as follows:

  [0xFF][size of data][:csp:][command][command arguments(if applicable)]
  
  Example minus protocol:
  
  :csp:target

If the first character of the CMD line is a number the client must assemble the reply packet as follows:

  [0xFF][size of data][command][command arguments(if applicable)][user choice]
  
  Example minus protocol:
  
  target 242

The above example will supposedly list the available actions that can be done to target 242. A more realistic usage of this feature is in navigation of server menus. The admin is permitted to enter an unrelated command instead of selecting an option so check for a numerical entry.

======Command List=====
All commands must be issued in lower case. There are two types of commands, core commands which are hard coded into the servers and external commands which are created with scripts. The external commands only apply to the game server.