2 from plomrogue.game import Game
3 from plomrogue.io_websocket import PlomWebSocketServer
4 from plomrogue.io_tcp import PlomTCPServer
5 from plomrogue.commands import (cmd_ALL, cmd_LOGIN, cmd_NICK, cmd_QUERY, cmd_PING,
6 cmd_MAP, cmd_TURN, cmd_MAP_LINE, cmd_GET_ANNOTATION,
7 cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE,
8 cmd_TASKS, cmd_MAP_CONTROL_LINE, cmd_MAP_CONTROL_PW,
9 cmd_GOD_ANNOTATE, cmd_GOD_PORTAL)
10 from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE,
11 Task_FLATTEN_SURROUNDINGS)
14 if len(sys.argv) != 2:
15 print('wrong number of arguments, expected one (save file)')
17 savefile = sys.argv[1]
19 game.register_command(cmd_PING)
20 game.register_command(cmd_ALL)
21 game.register_command(cmd_LOGIN)
22 game.register_command(cmd_NICK)
23 game.register_command(cmd_QUERY)
24 game.register_command(cmd_TURN)
25 game.register_command(cmd_MAP)
26 game.register_command(cmd_MAP_LINE)
27 game.register_command(cmd_MAP_CONTROL_LINE)
28 game.register_command(cmd_MAP_CONTROL_PW)
29 game.register_command(cmd_GET_ANNOTATION)
30 game.register_command(cmd_ANNOTATE)
31 game.register_command(cmd_PORTAL)
32 game.register_command(cmd_GOD_ANNOTATE)
33 game.register_command(cmd_GOD_PORTAL)
34 game.register_command(cmd_GET_GAMESTATE)
35 game.register_command(cmd_TASKS)
36 game.register_task(Task_WAIT)
37 game.register_task(Task_MOVE)
38 game.register_task(Task_WRITE)
39 game.register_task(Task_FLATTEN_SURROUNDINGS)
42 game.io.start_server(8000, PlomWebSocketServer)
43 game.io.start_server(5000, PlomTCPServer)