Semi fixed matchmaking

This commit is contained in:
ZKWolf
2023-09-17 19:05:47 +02:00
parent 3214567ce7
commit 9c27c802d4
2 changed files with 35 additions and 3 deletions

View File

@@ -238,6 +238,18 @@ class MatchmakingQueue:
except Exception as e:
logger.graylog_logger(level="error", handler="matchmaking_createQueueResponseMatched", message=e)
def getSession(self, userid):
try:
for lobby in self.openLobbies:
if lobby.host.userId == userid:
return Session(lobby.host.userId, [player.userId for player in lobby.nonHosts])
for player in lobby.nonHosts:
if player.userId == userid:
return Session(lobby.host.userId, [player.userId for player in lobby.nonHosts])
return None
except Exception as e:
logger.graylog_logger(level="error", handler="getSession", message=e)
def genMatchUUID(self):
return str(uuid.uuid4())