home · contact · privacy
732c8107c231118d0966171d7877cf89524d30de
[plomrogue] / src / server / world.h
1 /* src/server/world.h
2  *
3  * Contains the World struct holding all game data together.
4  */
5
6 #ifndef MAIN_H
7 #define MAIN_H
8
9 #include <stdint.h> /* uint8_t, uint16_t, uint32_t */
10 #include <stdio.h> /* define FILE */
11 #include "../common/map.h" /* struct Map */
12 struct MapObjDef;
13 struct MapObjAct;
14 struct MapObj;
15
16
17
18 struct World
19 {
20     FILE * file_in; /* Input stream on file at .path_in. */
21     FILE * file_out; /* Output stream on file at .path_out. */
22     struct Map map;
23     struct MapObjDef * map_obj_defs; /* Map object definitions. */
24     struct MapObjAct * map_obj_acts; /* Map object action definitions. */
25     struct MapObj * map_objs; /* Map objects. */
26     char * log; /* Logs the game events from the player's view. */
27     char * server_test; /* String uniquely identifying server process. */
28     char * path_in; /* File to write client messages into. */
29     char * path_out; /* File to write server messages into. */
30     char * path_worldstate; /* File to represent world state  to clients.*/
31     char * path_record; /* Record file from which to read the game history. */
32     char * path_config; /* Path for map object (action) definitions file. */
33     char * tmp_suffix; /* Appended to paths of files for their tmp versions. */
34     char * queue; /* Stores un-processed messages read from the input file. */
35     uint32_t queue_size;/* Length of .queue sequence of \0-terminated strings.*/
36     uint32_t seed; /* Randomness seed. */
37     uint16_t replay; /* Turn up to which to replay game. No replay if zero. */
38     uint16_t turn; /* Current game turn. */
39     uint16_t last_update_turn; /* Last turn the .path_out file was updated. */
40     uint8_t player_type; /* Map object type that player will start as. */
41     uint8_t is_verbose; /* Should server send debugging info to stdout? */
42     uint8_t map_obj_count; /* Counts map objects generated so far. */
43     uint8_t enemy_fov; /* != 0 if non-player actors only see field of view. */
44 };
45
46 extern struct World world;
47
48
49
50 #endif