pep.py/events/joinLobbyEvent.py

19 lines
443 B
Python
Raw Normal View History

2016-10-02 20:48:14 +00:00
from common.log import logUtils as log
2016-05-18 17:12:46 +00:00
from constants import serverPackets
from objects import glob
2016-10-02 20:48:14 +00:00
2016-04-19 17:40:59 +00:00
def handle(userToken, _):
# Get userToken data
username = userToken.username
# Add user to users in lobby
userToken.joinStream("lobby")
2016-04-19 17:40:59 +00:00
# Send matches data
for key, _ in glob.matches.matches.items():
userToken.enqueue(serverPackets.createMatch(key))
# Console output
log.info("{} has joined multiplayer lobby".format(username))