diff --git a/events/tournamentMatchInfoRequestEvent.py b/events/tournamentMatchInfoRequestEvent.py index 7be12fc..aec1ef8 100644 --- a/events/tournamentMatchInfoRequestEvent.py +++ b/events/tournamentMatchInfoRequestEvent.py @@ -7,4 +7,4 @@ def handle(userToken, packetData): matchID = packetData["matchID"] if matchID not in glob.matches.matches: return - userToken.enqueue(serverPackets.updateMatch(matchID)) \ No newline at end of file + userToken.enqueue(glob.matches.matches[matchID].matchDataCache) \ No newline at end of file diff --git a/objects/match.py b/objects/match.py index 4b78e92..99939b9 100644 --- a/objects/match.py +++ b/objects/match.py @@ -60,6 +60,7 @@ class match: self.matchTeamType = matchTeamTypes.headToHead # default value self.matchModMode = matchModModes.normal # default value self.seed = 0 + self.matchDataCache = bytes() # Create all slots and reset them self.slots = [] @@ -572,8 +573,9 @@ class match: self.sendUpdates() def sendUpdates(self): - glob.streams.broadcast(self.streamName, serverPackets.updateMatch(self.matchID)) - glob.streams.broadcast("lobby", serverPackets.updateMatch(self.matchID)) + self.matchDataCache = serverPackets.updateMatch(self.matchID) + glob.streams.broadcast(self.streamName, self.matchDataCache) + glob.streams.broadcast("lobby", self.matchDataCache) def checkTeams(self): """