From 74f3ec0f4c9484cbd685f31cce4457f395df3872 Mon Sep 17 00:00:00 2001 From: Nyo Date: Sat, 8 Oct 2016 20:47:19 +0200 Subject: [PATCH] .HIDE. Hey git pls. See last commit message --- events/createMatchEvent.py | 5 ++--- objects/match.py | 12 +++--------- objects/matchList.py | 1 + 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/events/createMatchEvent.py b/events/createMatchEvent.py index 3431d0c..17af080 100644 --- a/events/createMatchEvent.py +++ b/events/createMatchEvent.py @@ -29,9 +29,8 @@ def handle(userToken, packetData): # Give host to match creator match.setHost(userID) - - # Send match create packet to everyone in lobby - glob.streams.broadcast("lobby", serverPackets.createMatch(matchID)) + match.sendUpdates() + match.changePassword(packetData["matchPassword"]) # Console output log.info("MPROOM{}: Room created!".format(matchID)) diff --git a/objects/match.py b/objects/match.py index c537233..d29abe6 100644 --- a/objects/match.py +++ b/objects/match.py @@ -44,13 +44,6 @@ class match: self.mods = 0 self.matchName = matchName self.matchPassword = matchPassword - log.debug("Password: {}".format(self.matchPassword)) - # NOTE: Password used to be md5-hashed, but the client doesn't like that. - # So we're back to plain text passwords, like in normal osu! - #if matchPassword != "": - # self.matchPassword = generalUtils.stringMd5(matchPassword) - #else: - # self.matchPassword = "" self.beatmapID = beatmapID self.beatmapName = beatmapName self.beatmapMD5 = beatmapMD5 @@ -70,7 +63,6 @@ class match: # Create streams glob.streams.add(self.streamName) glob.streams.add(self.playingStreamName) - self.sendUpdates() # Create #multiplayer channel glob.channels.addTempChannel("#multi_{}".format(self.matchID)) @@ -80,6 +72,7 @@ class match: Return binary match data structure for packetHelper """ # General match info + # TODO: Test without safe copy, the error might have been caused by outdated python bytecode cache safeMatch = copy.deepcopy(self) struct = [ [safeMatch.matchID, dataTypes.UINT16], @@ -121,6 +114,7 @@ class match: struct.append([safeMatch.slots[i].mods, dataTypes.UINT32]) # Seed idk + # TODO: Implement this, it should be used for mania "random" mod struct.append([safeMatch.seed, dataTypes.UINT32]) return struct @@ -462,7 +456,7 @@ class match: # Console output log.info("MPROOM{}: Password changed to {}".format(self.matchID, self.matchPassword)) - def changeMatchMods(self, mods): + def changeMods(self, mods): """ Set match global mods diff --git a/objects/matchList.py b/objects/matchList.py index 953253d..36adad9 100644 --- a/objects/matchList.py +++ b/objects/matchList.py @@ -1,6 +1,7 @@ from objects import match from objects import glob from constants import serverPackets +from common.log import logUtils as log class matchList: def __init__(self):