def __init__(self, app, service, key): Controller.__init__(self, 'player', __name__) self.app = app self.service = service app.secret_key = key self.player_count = 0 self.game_started = False self.starter = threading.Timer(40, self.start_game) self.starter.start()
def __init__(self, app, service, ruler): Controller.__init__(self, 'play', __name__) self.app = app self.game = service self.verifier = ruler # this is how we will deal with turn time-outs # every time a valid request is made, we will reset this timer self.timeout_master = threading.Timer(3, self.player_timeout) self.first_pass = False # we need this to pad the first players response. TODO: find something cleaner? self.timeout_master.start()
def __init__(self, app, service): Controller.__init__(self, 'info', __name__) self.app = app self.game = service