pep.py/events/userPanelRequestEvent.py
2016-07-31 11:13:30 +02:00

18 lines
539 B
Python

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))