home · contact · privacy
Server/py: Realize slightly more of C variant's run_game() structure.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 17 Feb 2015 02:29:48 +0000 (03:29 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 17 Feb 2015 02:29:48 +0000 (03:29 +0100)
plomrogue-server.py

index 324888fb2d41ce5a6565c17184284d858eff1e32..33a5593e0632f997d6b70397f0b51eccbe11f937 100755 (executable)
@@ -61,16 +61,17 @@ try:
     parser.add_argument('-s', nargs='?', type=int, dest='replay', const=1,
                         action='store')
     args, unknown = parser.parse_known_args()
-    print("Replay: " + str(args.replay))
+    replay = args.replay
     # print("DUMMY: Obey command-line arguments.")
-    # print("DUMMY: Open files.")
     setup_server_io(io_db)
     # print("DUMMY: Run game.")
     path_recordfile = "recordfile"
     path_savefile = "savefile"
     detect_atomic_leftover(path_savefile)
     detect_atomic_leftover(path_recordfile)
-    if os.access(path_savefile, os.F_OK):
+    if replay:
+        print("Replaying")
+    elif os.access(path_savefile, os.F_OK):
         print(open(path_savefile, "r").read())
     else:
         msg = "MAKE_WORLD " + str(int(time.time()))