2016-04-19 17:40:59 +00:00
|
|
|
import serverPackets
|
|
|
|
import glob
|
2016-05-17 21:40:34 +00:00
|
|
|
from helpers import consoleHelper
|
|
|
|
from constants import bcolors
|
2016-04-19 17:40:59 +00:00
|
|
|
|
|
|
|
def handle(userToken, _):
|
|
|
|
# Get userToken data
|
|
|
|
username = userToken.username
|
|
|
|
userID = userToken.userID
|
|
|
|
|
|
|
|
# Add user to users in lobby
|
|
|
|
glob.matches.lobbyUserJoin(userID)
|
|
|
|
|
|
|
|
# Send matches data
|
|
|
|
for key, _ in glob.matches.matches.items():
|
|
|
|
userToken.enqueue(serverPackets.createMatch(key))
|
|
|
|
|
|
|
|
# Console output
|
|
|
|
consoleHelper.printColored("> {} has joined multiplayer lobby".format(username), bcolors.BLUE)
|