.BANCHO. Cache match data for tourney client

This commit is contained in:
Nyo 2016-10-08 20:18:33 +02:00
parent b1399aaf6e
commit 2eb7fb609c
2 changed files with 5 additions and 3 deletions

View File

@ -7,4 +7,4 @@ def handle(userToken, packetData):
matchID = packetData["matchID"]
if matchID not in glob.matches.matches:
return
userToken.enqueue(serverPackets.updateMatch(matchID))
userToken.enqueue(glob.matches.matches[matchID].matchDataCache)

View File

@ -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):
"""