Server_Manual - Scorched-Moon/scorched-moon.github.io GitHub Wiki

Dependencies

Scorched Moon server requires python3, it is not backwards compatible with python 2.

Launching Scorched Moon server

Scorched Moon server is designed to run as a standalone application independent of any clients. Simply running scorched_moon_server.py will start the server directly. Once started the server is non-interactive and can only be controlled by logging in remotely with a client or telnet.

Scorched Moon server arguments

Scorched Moon accepts the following arguments on launch

Argument List

  • --log or -l - followed by a number (example -l 3) sets the level of logging. 1 is the highest most complete information while 4 (default) provides only errors
  • --debug or -d - enables debug mode, debug mode overrides logging settings to level 1 regardless of other settings
  • --help or -h - Shows a list of arguments
  • --create or -c - Creates a new settings.conf file with default settings

Scorched Moon server data files

Description and location of non-code data files used by Scorched Moon

scorched_moon.log

Located in the logs folder, this is the primary logfile generated by Scorched Moon to track errors and for debugging.

settings.conf

Located in the main Scorched Moon folder. This file allows customization of the different options in Scorched Moon on launch

  • version - version of Scorched Moon the file was created with, used to identify setting.conf files that are obsolete

  • debug - True launches server in debug mode, False starts server normally

  • loglevel - Logging level server should use, default is 4

  • serverport - Port number the server should listen for standard connections

  • webport - Port number the server should listen for web connections must be different then Serverport

  • useweb - True turns on websockify for websocket functionality (currently not implemented), False keeps websockify off

  • boottime - How long in seconds server should wait for a dropped client to reconnect and login again before completely booting the player, setting to -1 will never boot players automatically

Scorched Moon server commands

As the Scorched Moon server progresses testing will have many commands and responses a client will need to understand, the following is a list of all of the server commands and possible responses server can provide. Usage is the command, followed by any following variables %s represents a string, %i represents an integer. Planned commands and responses are obviously not inclusive and simply list those likely to be implemented relatively soon.

Command List

These are the currently implemented server commands Scorched Moon accepts. All commands can be submitted directly through a telnet connection.

Currently implemented commands

  • exit - Disconnects user from server
  • shutdown - Cleanly shuts down server
  • broadcast %s - Sends a broadcast message to all clients
  • version - Sends user current server version
  • whoall - request list of all connected users and clients
  • login %s - Logs player in with specified username, multiple players can log in from the same client connection to allow for hotseat play
  • logout %s - Logs player out, this does not disconnect client from the server
  • chat %s1 %s2 %s3 - Chat message from %s1 to %s2 with message %s3, %s2 can be either "channel" which is a general chat to everyone in the current channel or "team" which is a message to everyone that is on the same team (not fully implemented), or a specific username of another player which is a private message or whisper. It is vital that all clients send the username this is coming from otherwise it will discard it as an improperly formatted command. The server will confirm that the username is associated with the client but will accept multiple logins from the same client to allow for the potential for clients with multiple users logged in at once (i.e. webclient proxy)

Currently planned commands

  • fire %s1 %s2 %i1 %i2 - fires from building %s1 object %s2 at degree %i1 at power %i2

Response List

These are the currently implemented responses the server can send to a client.

Currently implemented responses

  • broadcast %s - a chat message being sent to all clients even if not logged in
  • unknown %s - server received a command it didn't recognize
  • version %s - current server version number
  • whoall %i %s1 %s2 - list of all connected users %i is their ID, %s1 is username, %s2 is IP address
  • goodbye - server is disconnecting client
  • hello - server confiming new connection to client
  • error %s # generic error message specified in string
  • chat %s1 %s2 %s3 - chat message from %s1 to %s2 with message %s3, %s2 can be either "channel" which is a general chat to everyone in the current chatroom or "team" which is a message to everyone that is on the same team (not fully implemented), or a specific username of another player which is a private message or whisper

Currently planned responses

  • map - sending updated map, there are currently no plans on included variables since this will obviouly have to be long and complicated
  • sound %s - server letting client know what sounds were heard, sound will work this way specifically for explosions and other things that happen in FoW or SoW
  • tetherpopsound %i - to cut down on networking traffic the sound of a tether "popping" will be sent as a single integer rather then as an individual sound