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.
8 #include <stdio.h> /* printf() */
9 #include <stdlib.h> /* exit() */
10 #include "../common/rexit.h" /* exit_err, set_cleanup_func() */
11 #include "cleanup.h" /* set_cleanup_flag(), cleanup() */
12 #include "hardcoded_strings.h" /* s */
13 #include "init.h" /* run_game(), obey_argv(), obey_argv(), setup_server_io() */
14 #include "world.h" /* struct World */
22 int main(int argc, char ** argv)
24 /* So error exits also go through the server's cleanup() function. */
25 set_cleanup_func(cleanup);
27 /* Init settings from command line / hard-coded values. Print start info. */
29 obey_argv(argc, argv);
32 char * printf_err = "Trouble in main() with printf().";
33 int test = printf("Starting plomrogue-server.\n");
34 exit_err(-1 == test, printf_err);
37 test = printf("Replay mode. Auto-replaying up to turn %d.\n",
39 exit_err(-1 == test, printf_err);
42 world.map.length = 64; /* Just a sane default value. */
44 /* Init server i/o, Enter play or replay mode loops, then leave properly. */