-
Notifications
You must be signed in to change notification settings - Fork 0
Design Ideas
Deaygo edited this page Nov 29, 2014
·
3 revisions
Single Process that daemonizes itself and listens on either a TCP port (to support windows) or a Unix socket. Could also have a built in REST server, or a rest server added on top that communicates via the unix socket.
- config in /etc/gsc.conf
Have a database to track the servers, this could be a sqlite or just plain text files in /etc/gsc.d/
- /usr/share/gsc/games/
Each game type can have a few things:
- a simple file for defining certain actions
- started_when: a regex that triggers the server started event (after all preprocessing is done).
- a python program that handles the chat and can trigger events, etc.
def on_stdout(line):
chat = re.compile('<[A-Za-z0-9_]>\s+(.*)')
m = chat.match(line)
if m is not None:
pass # do stuff with chat message here
When a game server is installed, these template files are copied to the base directory and run from there. Each server is highly customizable but can still use installed python libraries.
gsc list types
List of server types:
- minecraft - vanilla minecraft server
- bukkit - bukkit minecraft server
- counterstrike - counterstrike server
gsc create server <type> <directory>
gsc create server minecraft /home/user/minecraft2/ --name testing
gsc status
{00000000-0000-0000-0000-000000000000} - testing [Minecraft] - Running
{00000000-0000-0000-0001-000000000000} - testing2 [Bukkit] - Running
{00000000-0000-0000-0002-000000000000} - testing3 [counterstrike] - Running
`gsc start testing`
Starting server testing... ... ... ... Started...
`gsc stop testing`
Stopping server testing.... stopped.