3 * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
4 * or any later version. For details on its copyright, license, and warranties,
5 * see the file NOTICE in the root directory of the PlomRogue source package.
7 * Process commands and act on them. Stuff that furthers the state of the game.
13 #include <stdint.h> /* uint8_t */
17 /* Record save and record file data. Both are only written if "force" is set, or
18 * on the first run with unset "force", or if 15 seconds have passed since the
19 * last file writing. "msg" is appended to the record file if it is set.
21 extern void record(char * msg, uint8_t force);
23 /* Try parsing "msg" into a command to apply, and apply it. Output commands to
24 * stdout if "do_verbose" and world.is_verbose are set. If "do_record" is set,
25 * record commands to record file, and run save_world() if the last call to it
26 * via this function has not happened yet or is at least one minute in the past.
28 extern void obey_msg(char * msg, uint8_t do_record, uint8_t do_verbose);
30 /* Loop for receiving commands via io_round(), and acting on them. Exits with 1
31 * on "QUIT" command. In replay mode, exits with 0 on each non-"QUIT" command.
32 * In play mode, processes incomming god and player commands via obey_msg().
33 * Compares the first line of the server out file with world.server_test to
34 * ensure that the current server process has not been superseded by a new one.
36 extern uint8_t io_loop();