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,
9 from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE,
10 Task_FLATTEN_SURROUNDINGS)
13 if len(sys.argv) != 2:
14 print('wrong number of arguments, expected one (save file)')
16 savefile = sys.argv[1]
18 game.register_command(cmd_PING)
19 game.register_command(cmd_LOGIN)
20 game.register_command(cmd_NICK)
21 game.register_command(cmd_QUERY)
22 game.register_command(cmd_TURN)
23 game.register_command(cmd_MAP)
24 game.register_command(cmd_MAP_LINE)
25 game.register_command(cmd_GET_ANNOTATION)
26 game.register_command(cmd_ANNOTATE)
27 game.register_command(cmd_PORTAL)
28 game.register_command(cmd_GET_GAMESTATE)
29 game.register_command(cmd_TASKS)
30 game.register_task(Task_WAIT)
31 game.register_task(Task_MOVE)
32 game.register_task(Task_WRITE)
33 game.register_task(Task_FLATTEN_SURROUNDINGS)
36 game.io.start_server(8000, PlomWebSocketServer)
37 game.io.start_server(5000, PlomTCPServer)