home · contact · privacy
Server: Limit size of backlog to 3000 chars plus newest message.
[plomrogue] / src / server / main.c
index 3c8829b7067ec010267382f27d80b04d9da47bcf..33e539102beded5802016eadea339ea40f2cc77e 100644 (file)
@@ -2,12 +2,11 @@
 
 #include <stdio.h> /* printf() */
 #include <stdlib.h> /* exit() */
-#include "../common/err_try_fgets.h" /* set_err_try_fgets_delim() */
 #include "../common/rexit.h" /* exit_err, set_cleanup_func() */
 #include "cleanup.h" /* set_cleanup_flag(), cleanup() */
-#include "init.h" /* run_game(), obey_argv(), obey_argv(), setup_server_io(),
-                   * init_map_and_map_object_configs()
-                   */
+#include "configfile.h" /* read_config_file() */
+#include "hardcoded_strings.h" /* s */
+#include "init.h" /* run_game(), obey_argv(), obey_argv(), setup_server_io() */
 #include "world.h" /* struct World */
 
 
@@ -22,6 +21,7 @@ int main(int argc, char ** argv)
     set_cleanup_func(cleanup);
 
     /* Init settings from command line / hard-coded values. Print start info. */
+    init_strings();
     obey_argv(argc, argv);
     if (world.is_verbose)
     {
@@ -35,16 +35,9 @@ int main(int argc, char ** argv)
             exit_err(-1 == test, printf_err);
         }
     }
-    world.path_config       = "confserver/world";
-    world.path_worldstate   = "server/worldstate";
-    world.path_out          = "server/out";
-    world.path_in           = "server/in";
-    world.path_record       = "record";
-    world.tmp_suffix        = "_tmp";
-    set_err_try_fgets_delim("%%\n");
-
-    /* Init map, map object configurations and server i/o files. */
-    init_map_and_map_objects_configs();
+
+    /* Init config file and server i/o files. */
+    read_config_file();
     setup_server_io();
 
     /* Enter play or replay mode loops, then leave properly. */