X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fserver%2Finit.h;h=6161200c0f019340369648372dc941b5d21dbb3c;hb=d87585beaacf5ad82f661cc577d3dfbeedfde398;hp=1cc6706f4317f19f2ef757975940aca904c72c25;hpb=2a60941d0815c19c11a01943faed931e0b364d4f;p=plomrogue diff --git a/src/server/init.h b/src/server/init.h index 1cc6706..6161200 100644 --- a/src/server/init.h +++ b/src/server/init.h @@ -1,4 +1,8 @@ /* src/server/init.h + * + * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3 + * or any later version. For details on its copyright, license, and warranties, + * see the file NOTICE in the root directory of the PlomRogue source package. * * Server, world and game state initialization. */ @@ -6,7 +10,7 @@ #ifndef INIT_H #define INIT_H -#include /* uint32_t */ +#include /* uint8_t */ @@ -16,24 +20,24 @@ extern void obey_argv(int argc, char * argv[]); /* Start server in file and out file, latter with server process test string. */ extern void setup_server_io(); -/* Dissolves old game world if it exists, and generates a new one from "seed". - * Unlinks a pre-existing file at world.path_record if called on a world.turn>0, - * i.e. if called after iterating through an already established game world. - * - * 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. +/* Dissolves old game world if it exists, generates a new one from world.seed. + * The map is populated according to world.thing_types start numbers. world.turn + * is set to 1, as is .exists and .do_update, so that io_round() is told to + * update the worldstate file. Returns 0 on success, and if the world cannot be + * generated 1 since there is no player type or it has .n_start of 0, 2 if no + * "wait" thing action is defined. */ -extern void remake_world(uint32_t seed); +extern uint8_t remake_world(); -/* Create a game state from which to play or replay, then enter io_loop(). +/* Create a game world state, then enter play or replay mode. * - * 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. + * If replay mode is called for, try for the record file and follow its commands + + up to the turn specified by the user, then enter manual replay. Otherwise, + * start into play mode after having either recreated a game world state from + * the savefile, or, if none exists, having created a new world with first + * following the commands from the world config file, then running the + * MAKE_WORLD command. Manual replay as well as manual play mode take place + * inside io_loop(). */ extern void run_game();