kinda works now
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
from uuid import uuid4
|
||||
import logging
|
||||
|
||||
from game import Game
|
||||
from player import Player
|
||||
|
||||
@ -13,16 +15,20 @@ class GameManager(object):
|
||||
self.chatid_gameid = dict()
|
||||
self.userid_user = dict()
|
||||
self.userid_player = dict()
|
||||
self.logger = logging.getLogger(__name__)
|
||||
|
||||
def generate_invite_link(self, bot_name, chat_id):
|
||||
game_id = uuid4()
|
||||
game_id = str(uuid4())
|
||||
game = Game()
|
||||
|
||||
self.logger.info("Creating new game with id " + game_id)
|
||||
self.gameid_game[game_id] = game
|
||||
self.chatid_gameid[chat_id] = game_id
|
||||
|
||||
return LINK_PATTERN % (bot_name, game_id)
|
||||
|
||||
def join_game(self, game_id, user):
|
||||
self.logger.info("Joining game with id " + game_id)
|
||||
game = self.gameid_game[game_id]
|
||||
player = Player(game, user)
|
||||
self.userid_player[user.id] = player
|
||||
|
Reference in New Issue
Block a user