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 /* Append "answer" to server output file, with instant fflush(). */
18 extern void send_to_outfile(char * answer);
20 /* Record save and record file data. Both are only written if "force" is set, or
21 * on the first run with unset "force", or if 15 seconds have passed since the
22 * last file writing. "msg" is appended to the record file if it is set.
24 extern void record(char * msg, uint8_t force);
26 /* Try parsing "msg" into a command to apply, and apply it. Output commands to
27 * stdout if "do_verbose" and world.is_verbose are set. If "do_record" is set,
28 * record commands to record file, and run save_world() if the last call to it
29 * via this function has not happened yet or is at least one minute in the past.
31 extern void obey_msg(char * msg, uint8_t do_record, uint8_t do_verbose);
33 /* Loop for receiving commands via io_round(), and acting on them. Exits with 1
34 * on "QUIT" command. In replay mode, exits with 0 on each non-"QUIT" command.
35 * In play mode, processes incomming god and player commands via obey_msg().
36 * Compares the first line of the server out file with world.server_test to
37 * ensure that the current server process has not been superseded by a new one.
39 extern uint8_t io_loop();