Skip to content

Commit

Permalink
Fixed an issue where the clients would parse leftover files
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed Dec 7, 2023
1 parent b362609 commit 0432b94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions worlds/khcom/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ def __init__(self, server_address, password):
self.game_communication_path = os.path.expandvars(r"%localappdata%/KHCOM")
else:
self.game_communication_path = os.path.expandvars(r"$HOME/KHCOM")
if not os.path.exists(self.game_communication_path):
os.makedirs(self.game_communication_path)
for root, dirs, files in os.walk(self.game_communication_path):
for file in files:
if file.find("obtain") <= -1:
os.remove(root+"/"+file)

async def server_auth(self, password_requested: bool = False):
if password_requested and not self.password:
Expand Down
6 changes: 6 additions & 0 deletions worlds/khrecom/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ def __init__(self, server_address, password):
self.game_communication_path = os.path.expandvars(r"%localappdata%/KHRECOM")
else:
self.game_communication_path = os.path.expandvars(r"$HOME/KHRECOM")
if not os.path.exists(self.game_communication_path):
os.makedirs(self.game_communication_path)
for root, dirs, files in os.walk(self.game_communication_path):
for file in files:
if file.find("obtain") <= -1:
os.remove(root+"/"+file)

async def server_auth(self, password_requested: bool = False):
if password_requested and not self.password:
Expand Down

0 comments on commit 0432b94

Please sign in to comment.