X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fserver%2Finit.h;fp=src%2Fserver%2Finit.h;h=595f69733f9cee9a9feffc0ee8fee4eae815bfb4;hb=dd9d65ee727ac7e95801da0f8b5bae7009811802;hp=0000000000000000000000000000000000000000;hpb=c3d87a1dee96775443fdf73c53e1350af7ca5fc2;p=plomrogue diff --git a/src/server/init.h b/src/server/init.h new file mode 100644 index 0000000..595f697 --- /dev/null +++ b/src/server/init.h @@ -0,0 +1,38 @@ +/* src/server/init.h + * + * Server, world and game state initialization. + */ + +#ifndef INIT_H +#define INIT_H + +#include /* uint32_t */ + + + +/* Parses command line arguments -v and -s into server configuration. */ +extern void obey_argv(int argc, char * argv[]); + +/* Dissolves old game world if it exists, and generates a new one from "seed". + * + * Map object (action) definitions read in from server config directory are not + * affected. world.last_update_turn is set to 0 and world.turn to 1, so that + * io_round()'s criteria for updating the output file are triggered even when + * this function is called during a round 1. How many map objects of what type + * id are generated on the map is currently hard-coded. + */ +extern void remake_world(uint32_t seed); + +/* Create a game state from which to play or replay, then enter io_loop(). + * + * If no record file exists at world.path_record, generate new world (by a + * "seed" command calling remake_world()) in play mode, or error-exit in replay + * mode. If a record file exists, in play mode auto-replay it up to the last + * game state before turning over to the player; in replay mode, auto-replay it + * up to the turn named in world.replay and then turn over to manual replay. + */ +extern void run_game(); + + + +#endif