home · contact · privacy
b69356a15fb184d0d17a40b6c58094194e691f54
[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_THING_INSTALLED,
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, cmd_THING_HAT_DESIGN,
14                                 cmd_THING_MUSICPLAYER_PLAYLIST_ITEM, cmd_TERRAIN,
15                                 cmd_THING_BOTTLE_EMPTY, cmd_PLAYER_FACE,
16                                 cmd_GOD_PLAYER_FACE, cmd_GOD_PLAYER_HAT,
17                                 cmd_GOD_PLAYERS_HAT_CHARS, cmd_PLAYER_HAT)
18 from plomrogue.tasks import (Task_WAIT, Task_MOVE, Task_WRITE, Task_PICK_UP,
19                              Task_DROP, Task_FLATTEN_SURROUNDINGS, Task_DOOR,
20                              Task_INTOXICATE, Task_COMMAND, Task_INSTALL,
21                              Task_WEAR, Task_SPIN)
22 from plomrogue.things import (Thing_Player, Thing_Item, Thing_ItemSpawner,
23                               Thing_SpawnPoint, Thing_SpawnPointSpawner,
24                               Thing_Door, Thing_DoorSpawner, Thing_Bottle,
25                               Thing_BottleSpawner, Thing_BottleDeposit,
26                               Thing_MusicPlayer, Thing_Hat, Thing_HatRemixer,
27                               Thing_Cookie, Thing_CookieSpawner, Thing_Psychedelic,
28                               Thing_PsychedelicSpawner)
29
30 from plomrogue.config import config
31 game = Game(config['savefile'])
32 game.register_command(cmd_PING)
33 game.register_command(cmd_ALL)
34 game.register_command(cmd_LOGIN)
35 game.register_command(cmd_NICK)
36 game.register_command(cmd_TURN)
37 game.register_command(cmd_MAP)
38 game.register_command(cmd_TERRAIN)
39 game.register_command(cmd_MAP_LINE)
40 game.register_command(cmd_MAP_CONTROL_LINE)
41 game.register_command(cmd_MAP_CONTROL_PW)
42 game.register_command(cmd_ANNOTATE)
43 game.register_command(cmd_PORTAL)
44 game.register_command(cmd_GOD_ANNOTATE)
45 game.register_command(cmd_GOD_PORTAL)
46 game.register_command(cmd_GET_GAMESTATE)
47 game.register_command(cmd_TASKS)
48 game.register_command(cmd_THING_TYPES)
49 game.register_command(cmd_TERRAINS)
50 game.register_command(cmd_THING)
51 game.register_command(cmd_THING_PROTECTION)
52 game.register_command(cmd_GOD_THING_PROTECTION)
53 game.register_command(cmd_THING_NAME)
54 game.register_command(cmd_THING_DOOR_CLOSED)
55 game.register_command(cmd_THING_INSTALLED)
56 game.register_command(cmd_GOD_THING_NAME)
57 game.register_command(cmd_ADMIN_PASSWORD)
58 game.register_command(cmd_SET_TILE_CONTROL)
59 game.register_command(cmd_SET_MAP_CONTROL_PASSWORD)
60 game.register_command(cmd_BECOME_ADMIN)
61 game.register_command(cmd_SPAWN_POINT)
62 game.register_command(cmd_THING_MUSICPLAYER_SETTINGS)
63 game.register_command(cmd_THING_MUSICPLAYER_PLAYLIST_ITEM)
64 game.register_command(cmd_THING_BOTTLE_EMPTY)
65 game.register_command(cmd_PLAYER_FACE)
66 game.register_command(cmd_GOD_PLAYER_FACE)
67 game.register_command(cmd_GOD_PLAYER_HAT)
68 game.register_command(cmd_GOD_PLAYERS_HAT_CHARS)
69 game.register_command(cmd_PLAYER_HAT)
70 game.register_command(cmd_THING_HAT_DESIGN)
71 game.register_task(Task_WAIT)
72 game.register_task(Task_MOVE)
73 game.register_task(Task_WRITE)
74 game.register_task(Task_FLATTEN_SURROUNDINGS)
75 game.register_task(Task_PICK_UP)
76 game.register_task(Task_DROP)
77 game.register_task(Task_DOOR)
78 game.register_task(Task_INTOXICATE)
79 game.register_task(Task_COMMAND)
80 game.register_task(Task_INSTALL)
81 game.register_task(Task_WEAR)
82 game.register_task(Task_SPIN)
83 game.register_thing_type(Thing_Player)
84 game.register_thing_type(Thing_Item)
85 game.register_thing_type(Thing_ItemSpawner)
86 game.register_thing_type(Thing_SpawnPoint)
87 game.register_thing_type(Thing_SpawnPointSpawner)
88 game.register_thing_type(Thing_Door)
89 game.register_thing_type(Thing_DoorSpawner)
90 game.register_thing_type(Thing_Bottle)
91 game.register_thing_type(Thing_BottleSpawner)
92 game.register_thing_type(Thing_BottleDeposit)
93 game.register_thing_type(Thing_MusicPlayer)
94 game.register_thing_type(Thing_Hat)
95 game.register_thing_type(Thing_HatRemixer)
96 game.register_thing_type(Thing_Cookie)
97 game.register_thing_type(Thing_CookieSpawner)
98 game.register_thing_type(Thing_Psychedelic)
99 game.register_thing_type(Thing_PsychedelicSpawner)
100 game.read_savefile()
101 game.io.start_loop()
102 for port in config['servers']:
103     game.io.start_server(port, config['servers'][port],
104                          config['certfile'], config['keyfile'])