home · contact · privacy
a906273e613960aa5225c376a566d1c91cf462f4
[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> /* uint32_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 /* Set map geometry and, from config files, map object (action) definitions. */
17 extern void init_map_and_map_objects_configs();
18
19 /* Start server in file and out file, latter with server process test string. */
20 extern void setup_server_io();
21
22 /* Dissolves old game world if it exists, and generates a new one from "seed".
23  * Unlinks a pre-existing file at world.path_record if called on a world.turn>0,
24  * i.e. if called after iterating through an already established game world.
25  *
26  * Map object (action) definitions read in from server config directory are not
27  * affected. world.last_update_turn is set to 0 and world.turn to 1, so that
28  * io_round()'s criteria for updating the output file are triggered even when
29  * this function is called during a round 1. How many map objects of what type
30  * id are generated on the map is currently hard-coded.
31  */
32 extern void remake_world(uint32_t seed);
33
34 /* Create a game state from which to play or replay, then enter io_loop().
35  *
36  * If no record file exists at world.path_record, generate new world (by a
37  * "seed" command calling remake_world()) in play mode, or error-exit in replay
38  * mode. If a record file exists, in play mode auto-replay it up to the last
39  * game state before turning over to the player; in replay mode, auto-replay it
40  * up to the turn named in world.replay and then turn over to manual replay.
41  */
42 extern void run_game();
43
44
45
46 #endif