From: Christian Heller Date: Tue, 17 Feb 2015 02:29:48 +0000 (+0100) Subject: Server/py: Realize slightly more of C variant's run_game() structure. X-Git-Tag: tce~525 X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/decks?a=commitdiff_plain;h=cee9a06bfd5a869797930f115d5653bc161359eb;p=plomrogue Server/py: Realize slightly more of C variant's run_game() structure. --- diff --git a/plomrogue-server.py b/plomrogue-server.py index 324888f..33a5593 100755 --- a/plomrogue-server.py +++ b/plomrogue-server.py @@ -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()))