X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=inline;f=src%2Fserver%2Fmain.c;h=1ae00f1397d3f69b672d6ed6d2e628528ad3844a;hb=81630285494cf6d9e5ddd845e4e55702d87029b0;hp=3c8829b7067ec010267382f27d80b04d9da47bcf;hpb=cc4ed0c49279f08a053a3e3a9a4acba22283a01f;p=plomrogue
diff --git a/src/server/main.c b/src/server/main.c
index 3c8829b..1ae00f1 100644
--- a/src/server/main.c
+++ b/src/server/main.c
@@ -1,13 +1,16 @@
-/* src/server/main.c */
+/* src/server/main.c
+ *
+ * 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.
+ */
#include /* printf() */
#include /* 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 "hardcoded_strings.h" /* s */
+#include "init.h" /* run_game(), obey_argv(), obey_argv(), setup_server_io() */
#include "world.h" /* struct World */
@@ -22,6 +25,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)
{
@@ -31,23 +35,14 @@ int main(int argc, char ** argv)
if (world.replay)
{
test = printf("Replay mode. Auto-replaying up to turn %d.\n",
- world.replay);
+ world.replay);
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();
- setup_server_io();
+ world.map.length = 64; /* Just a sane default value. */
- /* Enter play or replay mode loops, then leave properly. */
+ /* Init server i/o, Enter play or replay mode loops, then leave properly. */
+ setup_server_io();
run_game();
cleanup();
exit(EXIT_SUCCESS);