.BANCHO. Add streams and streamList object, add 'main' stream

This commit is contained in:
Nyo
2016-10-01 21:19:03 +02:00
parent 2213a99147
commit 40264ceffe
14 changed files with 163 additions and 23 deletions

View File

@@ -320,7 +320,7 @@ def IRCConnect(username):
return
glob.tokens.deleteOldTokens(userID)
glob.tokens.addToken(userID, irc=True)
glob.tokens.enqueueAll(serverPackets.userPanel(userID))
glob.streams.broadcast("main", serverPackets.userPanel(userID))
log.info("{} logged in from IRC".format(username))
def IRCDisconnect(username):

View File

@@ -42,10 +42,10 @@ def scheduleShutdown(sendRestartTime, restart, message = "", delay=20):
# Send notification if set
if message != "":
glob.tokens.enqueueAll(serverPackets.notification(message))
glob.streams.broadcast("main", serverPackets.notification(message))
# Schedule server restart packet
threading.Timer(sendRestartTime, glob.tokens.enqueueAll, [serverPackets.banchoRestart(delay*2*1000)]).start()
threading.Timer(sendRestartTime, glob.streams.broadcast, ["main", serverPackets.banchoRestart(delay*2*1000)]).start()
glob.restarting = True
# Restart/shutdown