home · contact · privacy
Don't set game.changed where no new send_gamestate would be necessitated.
[plomrogue2] / rogue_chat.py
1 #!/usr/bin/env python3
2 from plomrogue.game import Game
3 from plomrogue.commands import (cmd_ALL, cmd_LOGIN, cmd_NICK, cmd_PING, cmd_THING,
4                                 cmd_MAP, cmd_TURN, cmd_MAP_LINE, cmd_GET_ANNOTATION,
5                                 cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE,
6                                 cmd_TASKS, cmd_MAP_CONTROL_LINE, cmd_MAP_CONTROL_PW,
7                                 cmd_GOD_ANNOTATE, cmd_GOD_PORTAL, cmd_THING_TYPES,
8                                 cmd_THING_NAME, cmd_TERRAINS, cmd_ADMIN_PASSWORD,
9                                 cmd_BECOME_ADMIN, cmd_SET_TILE_CONTROL,
10                                 cmd_GOD_THING_NAME, cmd_THING_DOOR_CLOSED,
11                                 cmd_GOD_THING_PROTECTION, cmd_THING_PROTECTION,
12                                 cmd_SET_MAP_CONTROL_PASSWORD, cmd_SPAWN_POINT,
13                                 cmd_THING_MUSICPLAYER_SETTINGS,
14                                 cmd_THING_MUSICPLAYER_PLAYLIST_ITEM,
15                                 cmd_THING_BOTTLE_EMPTY)
16 from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE, Task_PICK_UP,
17                              Task_DROP, Task_FLATTEN_SURROUNDINGS, Task_DOOR,
18                              Task_INTOXICATE, Task_COMMAND)
19 from plomrogue.things import (Thing_Player, Thing_Item, Thing_ItemSpawner,
20                               Thing_SpawnPoint, Thing_SpawnPointSpawner,
21                               Thing_Door, Thing_DoorSpawner, Thing_Bottle,
22                               Thing_BottleSpawner, Thing_BottleDeposit,
23                               Thing_MusicPlayer)
24
25 from plomrogue.config import config
26 game = Game(config['savefile'])
27 game.register_command(cmd_PING)
28 game.register_command(cmd_ALL)
29 game.register_command(cmd_LOGIN)
30 game.register_command(cmd_NICK)
31 game.register_command(cmd_TURN)
32 game.register_command(cmd_MAP)
33 game.register_command(cmd_MAP_LINE)
34 game.register_command(cmd_MAP_CONTROL_LINE)
35 game.register_command(cmd_MAP_CONTROL_PW)
36 game.register_command(cmd_GET_ANNOTATION)
37 game.register_command(cmd_ANNOTATE)
38 game.register_command(cmd_PORTAL)
39 game.register_command(cmd_GOD_ANNOTATE)
40 game.register_command(cmd_GOD_PORTAL)
41 game.register_command(cmd_GET_GAMESTATE)
42 game.register_command(cmd_TASKS)
43 game.register_command(cmd_THING_TYPES)
44 game.register_command(cmd_TERRAINS)
45 game.register_command(cmd_THING)
46 game.register_command(cmd_THING_PROTECTION)
47 game.register_command(cmd_GOD_THING_PROTECTION)
48 game.register_command(cmd_THING_NAME)
49 game.register_command(cmd_THING_DOOR_CLOSED)
50 game.register_command(cmd_GOD_THING_NAME)
51 game.register_command(cmd_ADMIN_PASSWORD)
52 game.register_command(cmd_SET_TILE_CONTROL)
53 game.register_command(cmd_SET_MAP_CONTROL_PASSWORD)
54 game.register_command(cmd_BECOME_ADMIN)
55 game.register_command(cmd_SPAWN_POINT)
56 game.register_command(cmd_THING_MUSICPLAYER_SETTINGS)
57 game.register_command(cmd_THING_MUSICPLAYER_PLAYLIST_ITEM)
58 game.register_command(cmd_THING_BOTTLE_EMPTY)
59 game.register_task(Task_WAIT)
60 game.register_task(Task_MOVE)
61 game.register_task(Task_WRITE)
62 game.register_task(Task_FLATTEN_SURROUNDINGS)
63 game.register_task(Task_PICK_UP)
64 game.register_task(Task_DROP)
65 game.register_task(Task_DOOR)
66 game.register_task(Task_INTOXICATE)
67 game.register_task(Task_COMMAND)
68 game.register_thing_type(Thing_Player)
69 game.register_thing_type(Thing_Item)
70 game.register_thing_type(Thing_ItemSpawner)
71 game.register_thing_type(Thing_SpawnPoint)
72 game.register_thing_type(Thing_SpawnPointSpawner)
73 game.register_thing_type(Thing_Door)
74 game.register_thing_type(Thing_DoorSpawner)
75 game.register_thing_type(Thing_Bottle)
76 game.register_thing_type(Thing_BottleSpawner)
77 game.register_thing_type(Thing_BottleDeposit)
78 game.register_thing_type(Thing_MusicPlayer)
79 game.read_savefile()
80 game.io.start_loop()
81 for port in config['servers']:
82     game.io.start_server(port, config['servers'][port],
83                          config['certfile'], config['keyfile'])