TBG.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:ThatBeanGame 作者: tuchfarber 项目源码 文件源码
def on_login(login_info):
    try:
        game: Game = games[login_info['game']]
        player: Player = [player for player in game.players if player.token == login_info['token']][0]
    except KeyError:
        socketio.emit('error', 'Socket connection must start with sending of token (cookie) and game (id) in JSON format')
        return
    except IndexError:
        socketio.emit('error', 'User does not exist')
        return
    player.socket_sid = request.sid
    socketio.emit('client full', json.dumps(game.retrieve_game(player)), room=player.socket_sid)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号