pep.py/events/userPanelRequestEvent.py

19 lines
542 B
Python
Raw Normal View History

2016-10-02 20:48:14 +00:00
from common.log import logUtils as log
2016-06-17 15:43:49 +00:00
from constants import clientPackets
from constants import serverPackets
2016-10-02 20:48:14 +00:00
2016-06-17 15:43:49 +00:00
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))