def command_points_add(self, counter: is_counter, team: is_team, arg: integer, user): if not user: return NotLogged() team = self.game.get_team(team) points = team.get_counter(counter) points.add_point(arg) return EverythingGood()
def command_feed_set(self, arg: string, user): if not user: return NotLogged() try: with open("/var/www/tablica/feed.txt", 'w') as f: f.write(arg) return EverythingGood() except: print(sys.exc_info())
def command_clock_start_stop(self, clock: is_clock, user): if not user: return NotLogged() clock = self.game.get_clock(clock) if clock.is_enabled: clock.end() else: clock.start() return EverythingGood()
def command_switch_penalty_flag(self, team: is_team, user): if not user: return NotLogged() team = self.game.get_team(team) team.penalty_flag = not team.penalty_flag return EverythingGood()
def command_set_penalty_flag(self, team: is_team, arg: boolean, user): if not user: return NotLogged() team = self.game.get_team(team) team.penalty_flag = arg return EverythingGood()
def command_set_name(self, team: is_team, arg: string, user): if not user: return NotLogged() team = self.game.get_team(team) team.name = arg return EverythingGood()
def command_clock_set_seconds(self, clock: is_clock, arg: integer, user): if not user: return NotLogged() clock = self.game.get_clock(clock) clock.set_max_seconds(arg) return EverythingGood()
def command_clock_reset(self, clock: is_clock, user): if not user: return NotLogged() clock = self.game.get_clock(clock) clock.reset_clock() return EverythingGood()
def command_sign_out(user): if not user: return NotLogged() return SignedOut()
def command_period_set(self, arg: integer, user): if not user: return NotLogged() self.game.period.set_points(arg) return EverythingGood()
def command_description_set(self, arg: string, user): if not user: return NotLogged() self.game.description = arg return EverythingGood()
def command_commentary_set(self, arg: string, user): if not user: return NotLogged() self.game.free_commentary = arg return EverythingGood()