.BANCHO. Use streams for public chat

This commit is contained in:
Nyo
2016-12-11 11:07:35 +01:00
parent c4a6c84cec
commit 44545c3bcb
11 changed files with 133 additions and 119 deletions

View File

@@ -89,4 +89,10 @@ class unknownStreamException(Exception):
pass
class userTournamentException(Exception):
pass
class userAlreadyInChannelException(Exception):
pass
class userNotInChannelException(Exception):
pass

View File

@@ -656,7 +656,7 @@ def pp(fro, chan, message):
pp = userUtils.getPP(token.userID, gameMode)
return "You have {:,} pp".format(pp)
def updateBeatmap(fro, chan, to):
def updateBeatmap(fro, chan, message):
try:
# Run the command in PM only
if chan.startswith("#"):

View File

@@ -155,11 +155,13 @@ def channelJoinSuccess(userID, chan):
return packetHelper.buildPacket(packetIDs.server_channelJoinSuccess, [[chan, dataTypes.STRING]])
def channelInfo(chan):
if chan not in glob.channels.channels:
return bytes()
channel = glob.channels.channels[chan]
return packetHelper.buildPacket(packetIDs.server_channelInfo, [
[chan, dataTypes.STRING],
[channel.name, dataTypes.STRING],
[channel.description, dataTypes.STRING],
[len(channel.connectedUsers), dataTypes.UINT16]
[len(glob.streams.streams["chat/{}".format(chan)].clients), dataTypes.UINT16]
])
def channelInfoEnd():