home · contact · privacy
400f0799b38379af51d63b31e26edd1618a3debf
[plomrogue] / src / server / run.h
1 /* src/server/run.h
2  *
3  * Process commands and act on them. Stuff that furthers the state of the game.
4  */
5
6 #ifndef RUN_H
7 #define RUN_H
8
9 #include <stdint.h> /* uint8_t */
10
11
12
13 /* Try parsing "msg" into a command to apply, and apply it. Record commands to
14  * the file at world.path_record if "do_record" is set, and output them to
15  * stdout if "do_verbose" and world.is_verbose are set.
16  */
17 extern void obey_msg(char * msg, uint8_t do_record, uint8_t do_verbose);
18
19 /* Loop for receiving commands via io_round() and acting on them. Exits with 1
20  * on "QUIT" command. In replay mode, exits with 0 on each non-"QUIT" command.
21  * Writes a "PONG" line to server output file on "PING" command. In play mode,
22  * processes further incomming commands via obey_msg(). Compares the first line
23  * of the server out file with world.server_test to ensure that the current
24  * server process has not been superseded by a new one.
25  */
26 extern uint8_t io_loop();
27
28
29
30 #endif