Commit fa0f9ccf authored by talljosh's avatar talljosh

Fixed server bug where location of replay was not recorded.

parent 3078712e0d93
......@@ -20,7 +20,8 @@ class GameRecorder:
self.alias = f'{game_prefix} game'
self.world = world
self.save_replay = save_replay
self.replay_path = pathlib.Path(replay_path)
self.replay_base = pathlib.Path(replay_path)
self.replay_path = None
self.currently_saving = False
self.replay_recorder = None
......@@ -29,10 +30,10 @@ class GameRecorder:
self.replay_recorder.consumeMsg(msg)
def select_available_filename(self):
makeDirs(self.replay_path)
makeDirs(self.replay_base)
copy_count = 0
while True:
filepath = self.replay_path / f'{self.alias} ({copy_count}).trosrepl'
filepath = self.replay_base / f'{self.alias} ({copy_count}).trosrepl'
if not filepath.exists():
return filepath
copy_count += 1
......@@ -43,7 +44,8 @@ class GameRecorder:
return
self.currently_saving = True
self.replay_recorder = ReplayRecorder(self.world, self.select_available_filename())
self.replay_path = self.select_available_filename()
self.replay_recorder = ReplayRecorder(self.world, self.replay_path)
def start(self):
self.world.onStartMatch.addListener(self.match_started)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment