pep.py/events/userPanelRequestEvent.py

18 lines
539 B
Python
Raw Normal View History

2016-06-17 15:43:49 +00:00
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))