.BANCHO. Add userpanel packets
This commit is contained in:
@@ -152,9 +152,9 @@ def handle(tornadoRequest):
|
||||
if userHelper.getCountry(userID) == "XX":
|
||||
userHelper.setCountry(userID, countryLetters)
|
||||
|
||||
# Send to everyone our userpanel and userStats (so they now we have logged in)
|
||||
# Send to everyone our userpanel
|
||||
glob.tokens.enqueueAll(serverPackets.userPanel(userID))
|
||||
glob.tokens.enqueueAll(serverPackets.userStats(userID))
|
||||
#glob.tokens.enqueueAll(serverPackets.userStats(userID))
|
||||
|
||||
# Set reponse data to right value and reset our queue
|
||||
responseData = responseToken.queue
|
||||
|
17
events/userPanelRequestEvent.py
Normal file
17
events/userPanelRequestEvent.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from constants import clientPackets
|
||||
from constants import serverPackets
|
||||
from helpers import logHelper as log
|
||||
|
||||
def handle(userToken, packetData):
|
||||
# Read userIDs list
|
||||
packetData = clientPackets.userPanelRequest(packetData)
|
||||
|
||||
# Process lists with length <= 32
|
||||
if len(packetData) > 256:
|
||||
log.warning("Received userPanelRequest with length > 256")
|
||||
return
|
||||
|
||||
for i in packetData["users"]:
|
||||
# Enqueue userpanel packets relative to this user
|
||||
log.debug("Sending panel for user {}".format(i))
|
||||
userToken.enqueue(serverPackets.userPanel(i))
|
Reference in New Issue
Block a user