home · contact · privacy
Server/py: Restructure run_game() imitation.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 22 Feb 2015 05:05:20 +0000 (06:05 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 22 Feb 2015 05:05:20 +0000 (06:05 +0100)
plomrogue-server.py

index ceeb237d944ca378364819f1f6a5afec580d27e2..d9593f854f166196ee4f039c3692e24bff827fc7 100755 (executable)
@@ -100,19 +100,21 @@ try:
               " (if so late a turn is to be found).")
         if not os.access(io_db["path_record"], os.F_OK):
             raise SystemExit("No record file found to replay.")
-    elif os.access(io_db["path_save"], os.F_OK):
-        print(open(io_db["path_save"], "r").read())
     else:
-        if not os.access(io_db["path_worldconf"], os.F_OK):
-            msg = "No world config file from which to start a new world."
-            raise SystemExit(msg)
-        file = open(io_db["path_worldconf"])
-        line_n = 1
-        for line in file.readlines():
-            obey(line.rstrip(), io_db, "worldconfig file line " + str(line_n))
-            line_n = line_n + 1
-        file.close()
-        obey("MAKE_WORLD " + str(int(time.time())), io_db, "in file")
+        if os.access(io_db["path_save"], os.F_OK):
+            print(open(io_db["path_save"], "r").read())
+        else:
+            if not os.access(io_db["path_worldconf"], os.F_OK):
+                msg = "No world config file from which to start a new world."
+                raise SystemExit(msg)
+            file = open(io_db["path_worldconf"])
+            line_n = 1
+            for line in file.readlines():
+                obey(line.rstrip(), io_db, "worldconfig line " + str(line_n))
+                line_n = line_n + 1
+            file.close()
+            obey("MAKE_WORLD " + str(int(time.time())), io_db, "in file")
+        # print("DUMMY: Run io_loop().")
 except SystemExit as exit:
     print("ABORTING: " + exit.args[0])
 except: