Fix the multiplayer password bug while not breaking anything else, especially not multiplayer as a whole. (tested code)

This commit is contained in:
goeo_
2017-07-23 14:37:12 -04:00
parent d439490029
commit 401dd5ecdb
2 changed files with 19 additions and 12 deletions

View File

@@ -202,19 +202,18 @@ def createMatch(matchID):
# Get match binary data and build packet
match = glob.matches.matches[matchID]
matchData = match.getMatchData()
matchData.matchPassword = ""
matchData = match.getMatchData(censored=True)
return packetHelper.buildPacket(packetIDs.server_newMatch, matchData)
# TODO: Add match object argument to save some CPU
def updateMatch(matchID):
def updateMatch(matchID, censored = False):
# Make sure the match exists
if matchID not in glob.matches.matches:
return bytes()
# Get match binary data and build packet
match = glob.matches.matches[matchID]
return packetHelper.buildPacket(packetIDs.server_updateMatch, match.getMatchData())
return packetHelper.buildPacket(packetIDs.server_updateMatch, match.getMatchData(censored=censored))
def matchStart(matchID):
# Make sure the match exists
@@ -271,4 +270,4 @@ def notification(message):
return packetHelper.buildPacket(packetIDs.server_notification, [[message, dataTypes.STRING]])
def banchoRestart(msUntilReconnection):
return packetHelper.buildPacket(packetIDs.server_restart, [[msUntilReconnection, dataTypes.UINT32]])
return packetHelper.buildPacket(packetIDs.server_restart, [[msUntilReconnection, dataTypes.UINT32]])