X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;ds=sidebyside;f=src%2Fserver%2Frun.h;h=85c1339d8703b196922e1d94f4245c2bcb6d4ffc;hb=ff1ad8d5cfa86b38cc1436c6c9cc4135fb0a0f66;hp=07ca9029f24655a0b66a87466dc1ac512da0f4c3;hpb=1452d43c6d7c89219cda91362da53ac8e4acb887;p=plomrogue diff --git a/src/server/run.h b/src/server/run.h index 07ca902..85c1339 100644 --- a/src/server/run.h +++ b/src/server/run.h @@ -1,4 +1,8 @@ /* src/server/run.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. * * Process commands and act on them. Stuff that furthers the state of the game. */ @@ -10,17 +14,24 @@ -/* Try parsing "msg" into a command to apply, and apply it. Record commands to - * the file at world.path_record if "do_record" is set. +/* Record save and record file data. Both are only written if "force" is set, or + * on the first run with unset "force", or if 15 seconds have passed since the + * last file writing. "msg" is appended to the record file if it is set. + */ +extern void record(char * msg, uint8_t force); + +/* Try parsing "msg" into a command to apply, and apply it. Output commands to + * stdout if "do_verbose" and world.is_verbose are set. If "do_record" is set, + * record commands to record file, and run save_world() if the last call to it + * via this function has not happened yet or is at least one minute in the past. */ -extern void obey_msg(char * msg, uint8_t do_record); +extern void obey_msg(char * msg, uint8_t do_record, uint8_t do_verbose); -/* Loop for receiving commands via io_round() and acting on them. Exits with 1 +/* Loop for receiving commands via io_round(), and acting on them. Exits with 1 * on "QUIT" command. In replay mode, exits with 0 on each non-"QUIT" command. - * Writes a "PONG" line to server output file on "PING" command. In play mode, - * processes further incomming commands via obey_msg(). Compares the first line - * of the server out file with world.server_test to ensure that the current - * server process has not been superseded by a new one. + * In play mode, processes incomming god and player commands via obey_msg(). + * Compares the first line of the server out file with world.server_test to + * ensure that the current server process has not been superseded by a new one. */ extern uint8_t io_loop();