Skip to content

Commit

Permalink
fixed problem presence not updating after relaunching
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhartigan committed Apr 3, 2022
1 parent d5ce7d4 commit 5143069
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions server/src/client_management/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ async def check_connection(self):
"data": {}
}
await broadcast(payload)
return False
else:
if not self.ready:
self.connect()
Expand All @@ -72,6 +73,7 @@ async def check_connection(self):
"data": True
}
await broadcast(payload)
return True

def autodetect_account(self):
try:
Expand Down
5 changes: 4 additions & 1 deletion server/src/session_management/client_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
class Client_State:

def __init__(self):
self.reset()

def reset(self):
self.client = shared.client
self.valclient = shared.client.client

Expand Down Expand Up @@ -60,14 +63,14 @@ async def check_presence(self):
self.inrange = True

except:
self.reset()
shared.ingame = False

return changed

async def check_game_running(self):
await shared.client.check_connection()


async def loop(self):
while True:
if self.client.ready:
Expand Down
Empty file.

0 comments on commit 5143069

Please sign in to comment.