home · contact · privacy
e18b3bd46edf01ef4beaf63052728dca577eea86
[plomrogue] / src / server / init.h
1 /* src/server/init.h
2  *
3  * Server, world and game state initialization.
4  */
5
6 #ifndef INIT_H
7 #define INIT_H
8
9 #include <stdint.h> /* uint8_t */
10
11
12
13 /* Parses command line arguments -v and -s into server configuration. */
14 extern void obey_argv(int argc, char * argv[]);
15
16 /* Start server in file and out file, latter with server process test string. */
17 extern void setup_server_io();
18
19 /* Dissolves old game world if it exists, generates a new one from world.seed.
20  * The map is populated according to world.thing_types start numbers. world.turn
21  * is set to 1, as is .exists and .do_update, so that io_round() is told to
22  * update the worldstate file. Returns 0 on success, and if the world cannot be
23  * generated 1 since there is no player type or it has .n_start of 0, 2 if no
24  * "wait" thing action is defined.
25  */
26 extern uint8_t remake_world();
27
28 /* Create a game world state, then enter play or replay mode.
29  *
30  * If replay mode is called for, try for the record file and follow its commands
31  + up to the turn specified by the user, then enter manual replay. Otherwise,
32  * start into play mode after having either recreated a game world state from
33  * the savefile, or, if none exists, having created a new world with first
34  * following the commands from the world config file, then running the
35  * MAKE_WORLD command. Manual replay as well as manual play mode take place
36  * inside io_loop().
37  */
38 extern void run_game();
39
40
41
42 #endif