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
|
2016-10-04 20:10:07 +00:00
|
|
|
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
|
2016-06-04 10:44:54 +00:00
|
|
|
log.info("{} has joined multiplayer lobby".format(username))
|