Exemple #1
0
def solve(fptr):
    # Start the game
    g = Game(fptr)
    # Print a representation of the board
    print(g)
    # Solve the board, and time how long it took.
    t0 = time.time()
    g.run()
    t1 = time.time()

    print("\n\n\tTime = %.2f" % (t1 - t0))
Exemple #2
0
  def post(self):
    if self.request.get('code')!='RESET':
      return self.response.out.write("Reset failed. No harm done")
    check_admin(self)
    players=Player.all().run()
    for p in players:
      p.batting_price=p.initial_batting_price
      p.bowling_price=p.initial_bowling_price
      p.fielding_price=p.initial_fielding_price
      p.put()
		
    usermetas=UserMeta.all().run()
    for u in usermetas:
      u.total_trades=10
      u.round_trades=2
      u.total_points=0
      u.put()
    
    teams=Team.all().run()
    for t in teams:
      if t.game.round > 1:
        t.delete()
      else:
        t.batting_score=0
        t.bowling_score=0
        t.fielding_score=0
        t.total_score=0
        t.put()
        
    playergames=PlayerGame.all().run()
    for p in playergames:
      p.delete()
      
    games=Game.all().run()
    for g in games:
      g.played=False
      g.result='tie'
      g.score="0/0"
      g.opposition_score="0/0"
      g.batExtras=0
      g.bowlExtras=0
      g.put()
      
    u=Utilities.all().get()
    u.current_round=1
    u.next_game=Game.all().filter('round =',1).get()
    u.lockout=False
    u.put()
    
    memcache.flush_all()
    self.response.out.write('System reset. I hope you meant to do that!');
Exemple #3
0
def parseGameList(xmlString):
    """Parses a string representing a list of games.

    Args:
        xmlString: The string to parse.

    Returns:
        .game.GameList: an object containing all the information on the list.

    Raises:
        .exceptions.InvalidXmlStructure: If there is an error while parsing.
        .exceptions.NoResultFound: If the list is empty.
    """
    root = _getRoot(xmlString)
    gameList = GameList()
    for elem in root.iter("item"):
        if "boardgame" == elem.get("type"):
            try:
                game = Game(id_=elem.get("id"))
                nameElem = elem.find("name")
                if nameElem is None:
                    raise exceptions.InvalidXmlStructure()
                game.setName(nameElem.get("value"))
                yearElem = elem.find("yearpublished")
                if yearElem is not None:
                    game.setYear(yearElem.get("value"))
                game.setLink(constants.BOARDGAMEGEEK_BASE_ADDRESS + game.id_)
                gameList.addGame(game)
            except ET.ParseError as err:
                logger.exception("Parse exception")
                raise exceptions.InvalidXmlStructure()
    if gameList.isEmpty():
        raise exceptions.NoResultFound()
    return gameList
Exemple #4
0
 def get(self):
   check_admin(self)
   template_values={'user_meta':get_meta(),'lockout':lockout()}
   games=Game.all().order('round').run()
   template_values['games']=games
   template=jinja_environment.get_template('templates/admin_menu.html')
   self.response.out.write(template.render(template_values))   
Exemple #5
0
 def get(self):
   user_meta=get_meta()
   
   if not user_meta:
     if users.get_current_user():
       return self.redirect("/signup")
     template_values={'FACEBOOK_APP_ID':FACEBOOK_APP_ID,'login':users.create_login_url("/"),'dev_server':dev_server}
     template=jinja_environment.get_template('templates/index.html')
     self.response.out.write(template.render(template_values))
     return
   
   round=current_round()
   last_round=round-1
   if last_round < 0:
     last_round=5
   last_game=Game.all().filter('round =',last_round).get()
   last_team=get_team(game=last_game)
   round_score=0
   if last_team:
     round_score=last_team.total_score
   template_values={'user_meta':user_meta,'round_score':round_score}
   if check_mobile():
     template=jinja_environment.get_template('templates/mobile/home.html')
   else:
     template=jinja_environment.get_template('templates/home.html')
   self.response.out.write(template.render(template_values))
def get_team(user_meta=None,game=None):
  if not user_meta:
    user_meta=get_meta()
  if not game:
    game=next_game()
  if not game:
    game=Game.all().filter('round =',current_round()-1)
  return Team.all().filter('user ='******'game =',game).get()
Exemple #7
0
 def get(self):
   check_admin(self)
   games=Game.all().run()
   for g in games:
     g.delete()
   days=[26,27,28,28,29,30]
   for i in range(1,6):
     g=Game(round=i,date=date(2012,12,days[i]))
     g.put()
   us=Utilities.all().run()
   for u in us:
     u.delete()
   u=Utilities()
   u.current_round=1
   u.next_game=Game.all().filter('round =',1).get()
   u.put()
   teams=Team.all().run()
   for t in teams:
     t.delete()
   games=PlayerGame.all().run()
   for g in games:
     g.delete()
   self.response.out.write('done')
   player=Player(first_name="any",surname="player",active=False)
   player.put()
Exemple #8
0
 def get(self):
     user_meta = get_meta()
     if not user_meta:
         self.redirect("/")
     next = next_game()
     if next:
         next_round = next.round
     else:
         next_round = 1000
     template_values = {"user_meta": user_meta, "next_game": next, "lockout": lockout()}
     template_values["future_games"] = Game.all().filter("round >", next_round).order("round").run()
     template_values["future_games"] = []
     template_values["past_games"] = Game.all().filter("round <", next_round).order("round").run()
     if check_mobile():
         template = jinja_environment.get_template("templates/mobile/games.html")
     else:
         template = jinja_environment.get_template("templates/games.html")
     self.response.out.write(template.render(template_values))
Exemple #9
0
 def get(self,game_id):
   check_admin(self)
   game=Game.get_by_id(int(game_id))
   players=Player.all().filter('active =',True).order('surname').fetch(1000)
   fielders=PlayerGame.all().filter('game =',game)
   batting_order=sorted(fielders,key=lambda p: p.batting_position)
   bowling_order=sorted(fielders,key=lambda p: p.bowling_position)
   template_values={'user_meta':get_meta(),'game':game,'players':players,'dismissal_types':dismissal_types,'batting_order':batting_order,'bowling_order':bowling_order,
     'fielders':fielders}
   template=jinja_environment.get_template('templates/edit_game.html')
   self.response.out.write(template.render(template_values))
Exemple #10
0
    def getCompletedGame(self, matchID):
        game = None
        try:
            db = self.sqlHelper.getConnection()

            with closing(db.cursor()) as cur:
                cur.execute(
                    """SELECT * FROM `complete_matches` WHERE `match_id` = %s""",
                    (matchID, ))

                result = cur.fetchone()
                if not result is None:
                    game = Game(result[2], result[0], "Recent", result[1],
                                result[3], result[4], result[5], result[6])
                    game.setScore(result[7])

        except Exception as e:
            print(traceback.format_exc())
        finally:
            db.close()
            return game
Exemple #11
0
def createGame(data):
    """Socket for creating (Private) game"""

    # username = data['player']['username']
    # email = data['player']['email']
    # userid = data['player']['userid']
    # player = Player(userid, username, email)

    cards = data['cards']
    maxplayers = data['players']

    game = Game(False, cards, maxplayers)
    gameLst[game.gameid] = game
    data['gameid'] = game.gameid
    joinGame(data)
    send(game.gameid, room=game.gameid)
    return game.gameid
Exemple #12
0
    def create_game(self, pid):
        """
        Creates a game for the PID given
        @param pid: PID of player wanting to join a game
        @type pid: int
        @return: if successful
        @rtype: bool
        """
        gid = RandomNumGen(int(round(time.time() * 1000))).randint(0, 65535)

        self.notify.debug(f"[create_game] Create game {gid} for player {pid}")

        # create game
        game = Game(gid, self)
        self.games[gid] = game

        self.add_player_to_game(pid, game.gid)

        return True
Exemple #13
0
 def get(self, game_id=None):
     user_meta = get_meta()
     if not user_meta:
         self.redirect("/")
     game = Game.get_by_id(int(game_id))
     if not game_id:
         game = next_game()
     players = game.playergame_set
     template_values = {
         "game": game,
         "user_meta": user_meta,
         "batsmen": sorted([b for b in players if b.batted], key=lambda player: player.batting_position),
         "bowlers": sorted([b for b in players if b.bowled], key=lambda player: player.bowling_position),
         "fielders": players,
     }
     if check_mobile():
         template = jinja_environment.get_template("templates/mobile/game.html")
     else:
         template = jinja_environment.get_template("templates/game.html")
     self.response.out.write(template.render(template_values))
def game_completed(game):
  utilities=Utilities.all().get()
  next_game=Game.all().filter('round =',utilities.next_game.round+1).get()
  team.finish_round(game,next_game)
  game.played=True
  if game.key() == utilities.next_game.key():
    utilities.next_game=next_game
    memcache.set("next_game",next_game)
    if utilities.next_game:
      utilities.current_round=utilities.next_game.round
      memcache.set("current_round",utilities.current_round)
    else:
      utilities.current_round=-1
      memcache.set("current_round",-1)
    utilities.lockout=False
    memcache.set("lockout",False)
    utilities.put()
    for u in UserMeta.all().run():
      u.round_trades=2
      if utilities.current_round == -1:
        u.round_trades=0
      save_user(u)
Exemple #15
0
def checkGames(data):
    """Socket for checking games"""

    # username = data['player']['username']
    # email = data['player']['email']
    # userid = data['player']['userid']
    # player = Player(userid, username, email)

    # game is running
    for gameid, game in gameLst.items():
        if (game.gameStatus()):
            data['gameid'] = gameid
            joinGame(data)
            send(gameid, room=gameid)
            return game.gameid

    # no games running, make new game
    game = Game(True, 5, 0)
    gameLst[game.gameid] = game
    data['gameid'] = game.gameid
    joinGame(data)
    send(game.gameid, room=game.gameid)
    return game.gameid
Exemple #16
0
def parseGame(xmlString):
    """Parses a string representing a game.

    Args:
        xmlString: The string to parse.

    Returns:
        .game.Game: an object containing all the information on the game.

    Raises:
        .exceptions.InvalidXmlStructure: If there is an error while parsing.
        .exceptions.NoResultFound: If the result is not a board game or an expansion.
    """
    root = _getRoot(xmlString)
    item = root.find("item")
    if item is None:
        raise exceptions.NoResultFound()
    game = None
    type_ = item.get("type")
    if "boardgame" == type_ or "boardgameexpansion" == type_:
        try:
            game = Game(id_=item.get("id"))
            for nameElem in item.findall("name"):
                if "primary" == nameElem.get("type"):
                    game.setName(nameElem.get("value"))
                    break;
            yearElem = item.find("yearpublished")
            if yearElem is not None:
                game.setYear(yearElem.get("value"))
            playingTimeElem = item.find("playingtime")
            if playingTimeElem is not None:
                game.setPlayingTime(playingTimeElem.get("value"))
            minPlayersElem = item.find("minplayers")
            if minPlayersElem is not None:
                game.setMinPlayers(minPlayersElem.get("value"))
            maxPlayersElem = item.find("maxplayers")
            if maxPlayersElem is not None:
                game.setMaxPlayers(maxPlayersElem.get("value"))
            for elem in item.findall("link"):
                if "boardgamecategory" == elem.get("type"):
                    game.addCategory(elem.get("value"))
                elif "boardgamemechanic" == elem.get("type"):
                    game.addMechanic(elem.get("value"))
                elif "boardgamedesigner" == elem.get("type"):
                    game.addDesigner(elem.get("value"))
                elif "boardgameartist" == elem.get("type"):
                    game.addArtist(elem.get("value"))
            descrElem = item.find("description")
            if descrElem is None or not descrElem.text:
                descr = "No description available."
            else:
                descr = descrElem.text
            game.setDescription(descr)
            thumbElem = item.find("thumbnail")
            if thumbElem is not None:
                game.setThumbnail(_parseThumbnail(thumbElem.text))
            game.setLink(constants.BOARDGAMEGEEK_BASE_ADDRESS + game.id_)
            # STATS
            statistics = item.find("statistics")
            if statistics is not None:
                ratings = statistics.find("ratings")
                if ratings is not None:
                    avg = ratings.find("average")
                    if avg is not None:
                        game.setAverage(avg.get("value"))
                    ranks = ratings.find("ranks")
                    if ranks is not None:
                        for rank in ranks.findall("rank"):
                            if "1" == rank.get("id"):
                                game.setRank(rank.get("value"))
        except ET.ParseError as err:
            logger.exception("Parse exception")
            raise exceptions.InvalidXmlStructure()
    if game is None:
        raise exceptions.NoResultFound()
    return game
Exemple #17
0
import eventlet
from eventlet import wsgi
import socketio

from objects.responses import Response
from objects.game import Game

server = socketio.Server()
app = socketio.WSGIApp(server)

game = Game()


# SERVER EVENTS
@server.event
def connect(sid, environ):
    print(f'[CLIENT] {sid} connected')


@server.event
def disconnect(sid):
    leave_room(sid)
    print(f'[CLIENT] {sid} disconnected')


@server.event
def register(sid, name):
    game.register_user(sid, name)
    print(f'[NEW PLAYER] {name} registered')

    return Response.SUCCESS.value
Exemple #18
0
from objects.game import Game
from objects.food import Food
from objects.snake import Snake

import pygame
import os
os.environ['SDL_AUDIODRIVER'] = 'dsp'

# initialize pygame components and game
pygame.init()
game = Game()

# condition to run the game
done = False

# main game loop
while not done:

    # run the snake game
    done = game.run()

    # handler for exit button on gui
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True

    # refresh the animation
    pygame.display.flip()
Exemple #19
0
def main():
    connect = Game()

    if len(sys.argv) == 4:
        try:
            connect = Game(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]))
        except ValueError:
            print("ValueError - please enter integers as a parameters. Exiting.")
            quit()

    player = lambda p: (p + 1) % 2  # lambda function to change the player's turn
    print("Creating a board of size " + str(connect.num_rows) + "x" + str(connect.num_cols) + " with " + str(
        connect.num_win) + " in a row to win.")
    print(
        "To save the game, simply type save. Only one save is permitted and there is no option to determine its name.")
    print("To load the game, simply type load.\n\n")

    connect.print_board()
    saved = False
    loaded = False
    while True:
        user_input = None
        result = 0
        while user_input is None:  # Want to make sure that we have some input to go off of
            try:
                user_input = raw_input("Please enter a column to place a token: ")
                if user_input.lower() == "save":
                    connect.save_game()
                    saved = True  # if they save the game we don't want to try and place a token
                    loaded = False
                    break
                elif user_input.lower() == "load":
                    connect = connect.load_game()
                    saved = False
                    loaded = True  # if they loaded the game we don't want to try and place a token, but need to print
                    break
                result = connect.put_token(int(user_input), connect.player)  # try to put the token on the board
            except ValueError:
                print("Error! Please enter an integer to place a token")
            except KeyboardInterrupt:  # occurs if something like ^C happens
                print("\nExiting the game")
                quit()

        if result == 1:  # if the token was successfully placed on the board
            print("Token successfully placed in column " + user_input)
            connect.player = player(connect.player)  # update the player change in the game
            connect.print_board()
            saved = False
            loaded = False
        elif result != 1 and not saved:
            if not loaded:
                print("Sorry, can't place a token in column " + user_input)
            connect.print_board()
        is_winner = connect.check_winner()  # want to see if one of the players have won
        if is_winner != -1:
            print("Congratulations! Player " + str(is_winner) + " has won!")
            connect.print_board()
            break
        is_full = connect.is_board_full()
        if is_full != 0:
            print("Tie game, the board is full.")
            connect.print_board()
            break
Exemple #20
0
 def post(self):
   players={}
   check_admin(self)
   game=Game.get_by_id(int(self.request.get('game')))
   batsmen=[]
   bowlers=[]
   fielders=[]
   
   # TODO: convert to a background task
       
   # Check Duplicates
   for i in range(1,13):
     if self.request.get('batsman-'+str(i)+'-batted'):
       batsmen.append(self.request.get('batsman-'+str(i)))
     if self.request.get('bowler-'+str(i)+'-bowled'):
       bowlers.append(self.request.get('bowler-'+str(i)))
     if self.request.get('fielder-'+str(i)) != '0':
       fielders.append(self.request.get('fielder-'+str(i)))
   
   if len(set(batsmen)) != len(batsmen):
     self.response.out.write("Error. Duplicate batsmen")
     return
   if len(set(bowlers)) != len(bowlers):
     self.response.out.write("Error. Duplicate bowlers")
     return
   if len(set(fielders)) != len(fielders):
     self.response.out.write("Error. Duplicate fielders")
     return
   
   memcache.delete('horse')
   pg=None
   # batting
   for i in range(1,12):
     si='batsman-'+str(i)
     if not self.request.get(si+'-batted') or self.request.get(si) == '0':
       continue
     p_id=self.request.get(si)
     try:
       pg=players[p_id]
     except:
       player=Player.get_by_id(int(p_id))
       pg=PlayerGame(player=player,game=game)
       players[p_id]=pg
     pg.batted=True
     if self.request.get(si+'-not_out'):
       pg.not_out=True
     else:
       pg.not_out=False
     pg.runs=int(self.request.get(si+'-runs',default_value="0"))
     pg.balls_faced=int(self.request.get(si+'-balls',default_value="0"))
     pg.fours_hit=int(self.request.get(si+'-fours',default_value="0"))
     pg.sixes_hit=int(self.request.get(si+'-sixes',default_value="0"))
     if not pg.not_out:
       pg.how_out=db.Category(self.request.get(si+'-how_out').replace('-',' '))
     else:
       pg.how_out=None
     pg.batting_position=i
   
   # bowling
   total_conceded=0
   for i in range(1,12):
     si='bowler-'+str(i)
     if not self.request.get(si+'-bowled') or self.request.get(si) == '0':
       continue
     p_id=self.request.get(si)
     try:
       pg=players[p_id]
     except:
       player=Player.get_by_id(int(p_id))
       pg=PlayerGame(player=player,game=game)
       players[p_id]=pg
     pg.bowled=True
     overs_tokens=self.request.get(si+'-overs',default_value="0.0").split('.')
     pg.overs=int(overs_tokens[0])
     if len(overs_tokens) > 1:
       pg.balls=int(overs_tokens[1])
     else:
       pg.balls=0
     pg.maidens=int(self.request.get(si+'-maidens',default_value="0"))
     pg.runs_conceded=int(self.request.get(si+'-runs',default_value="0"))
     total_conceded+=pg.runs_conceded
     pg.wickets=int(self.request.get(si+'-wickets',default_value="0"))
     pg.wides=int(self.request.get(si+'-wides',default_value="0"))
     pg.no_balls=int(self.request.get(si+'-no_balls',default_value="0"))
     pg.fours=int(self.request.get(si+'-fours',default_value="0"))
     pg.sixes=int(self.request.get(si+'-sixes',default_value="0"))
     pg.bowling_position=i
   
   # fielding
   for i in range(1,13):
     si='fielder-'+str(i)
     if self.request.get(si)=='0':
       continue
     p_id=self.request.get(si)
     try:
       pg=players[p_id]
     except:
       player=Player.get_by_id(int(p_id))
       pg=PlayerGame(player=player,game=game)
       players[p_id]=pg
     pg.catches=int(self.request.get(si+'-catches',default_value="0"))
     pg.drops=int(self.request.get(si+'-drops',default_value="0"))
     pg.diving_drops=int(self.request.get(si+'-diving',default_value="0"))
     pg.non_attempts=int(self.request.get(si+'-non_attempts',default_value="0"))
     pg.run_outs=int(self.request.get(si+'-run_outs',default_value="0"))
     pg.misfields=int(self.request.get(si+'-misfields',default_value="0"))
     pg.other=int(self.request.get(si+'-other',default_value="0"))
     
   # TODO: Validation
   for pg in game.playergame_set:
     pg.delete()
   
   bat_total=0
   bowl_total=0
   bat_scores={}
   bowl_scores={}
   for key,pg in players.iteritems():
     bat_scores[key]=batting_score(pg)
     bat_total+=bat_scores[key]
     bowl_scores[key]=bowling_score(pg,total_conceded)
     bowl_total+=bowl_scores[key]
     pg.fielding_points=fielding_score(pg)
 
   bat_factor = 1
   bowl_factor = 1
   if bat_total > 0:    
     bat_factor = 100.0/bat_total
   if bowl_total > 0:
     if game.overs == 20:
       bowl_factor = 80.0/bowl_total
     else:
       bowl_factor = 100.0/bowl_total
   for key,pg in players.iteritems():
     pg.batting_points=int(round(bat_scores[key]*bat_factor))
     pg.bowling_points=int(round(bowl_scores[key]*bowl_factor))
     pg.put()
     
   completed=self.request.get('completed')
   if completed:
     game_completed(game)
     for key,pg in players.iteritems():
       p=pg.player
       update_prices(p)
       p.put()
   else:
     game.played=False
   game.opposition=self.request.get('opposition')
   game.score=self.request.get('dedication-score')
   game.opposition_score=self.request.get('opposition-score')
   game.result=self.request.get('result')
   game.put()
   
   self.redirect('/admin')
Exemple #21
0
    def updateMatches(self):
        threading.Timer(60 * 60, self.updateMatches).start()
        gamesToUpdate = ["csgo", "lol", "dota2", "hearth", "hots"]
        csgoMatchLink = "http://www.gosugamers.net/counterstrike/gosubet"
        dotaMatchLink = "http://www.gosugamers.net/dota2/gosubet"
        lolMatchLink = "http://www.gosugamers.net/lol/gosubet"
        hearthMatchLink = "http://www.gosugamers.net/hearthstone/gosubet"
        hotsMatchLink = "http://www.gosugamers.net/heroesofthestorm/gosubet"

        self.clearLists()

        for gameType in gamesToUpdate:
            try:
                link = ""
                if gameType == "csgo":
                    link = csgoMatchLink
                elif gameType == "lol":
                    link = lolMatchLink
                elif gameType == "dota2":
                    link = dotaMatchLink
                elif gameType == "hearth":
                    link = hearthMatchLink
                elif gameType == "hots":
                    link = hotsMatchLink

                req = urllib2.Request(
                    link,
                    headers={
                        'User-Agent':
                        "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
                    })
                web_page = urllib2.urlopen(req).read()
                bs = BeautifulSoup(web_page)

                match_columns = bs.findAll("div", attrs={"id": "col1"})
                boxes = match_columns[0].findAll("div", attrs={"class": "box"})
                for box in boxes:
                    header = ""

                    h1 = box.find("h1")
                    if h1 is None:
                        h2 = box.find("h2")
                        header = h2.text.strip()
                    else:
                        header = h1.text.strip()

                    if header.find("Live") != -1:
                        header = "Live"
                    elif header.find("Recent") != -1:
                        header = "Recent"
                    elif header.find("Upcoming") != -1:
                        header = "Upcoming"

                    table = box.find("table", attrs={"class": "simple"})

                    if not table is None:
                        matches = table.find("tbody")

                        rows = matches.findAll("tr")
                        for row in rows:
                            cols = row.findAll("td")
                            match_info = cols[0].find("a",
                                                      attrs={"class": "match"})
                            link = match_info['href']
                            id = match_info['href'].split("/")[-1].split(
                                "-")[0]
                            opponent1 = match_info.find("span",
                                                        attrs={
                                                            "class": "opp1"
                                                        }).text.strip()
                            bet1 = match_info.find("span",
                                                   attrs={
                                                       "class": "bet1"
                                                   }).text.strip()
                            opponent2 = match_info.find("span",
                                                        attrs={
                                                            "class": "opp2"
                                                        }).text.strip()
                            bet2 = match_info.find("span",
                                                   attrs={
                                                       "class": "bet2"
                                                   }).text.strip()

                            # Add game to list
                            game = Game(gameType, id, header, link, opponent1,
                                        opponent2, bet1, bet2)

                            if header == "Upcoming":
                                timeCol = cols[1].find(
                                    "span", attrs={"class": "live-in"})
                                timeUntil = timeCol.text.strip()
                                game.setTime(timeUntil)
                            elif header == "Recent":
                                winnerScore = cols[1].find("span",
                                                           attrs={
                                                               "class":
                                                               "hidden"
                                                           }).text.strip()
                                game.setScore(winnerScore)
                                self.queryHelper.insertComplete(game)

                            if gameType == "csgo":
                                if header == "Live":
                                    self.csgoLiveList.append(game)
                                elif header == "Upcoming":
                                    self.csgoUpcomingList.append(game)
                                elif header == "Recent":
                                    self.csgoRecentList.append(game)
                                else:
                                    raise Exception("Parsed invalid header")
                            elif gameType == "lol":
                                if header == "Live":
                                    self.lolLiveList.append(game)
                                elif header == "Upcoming":
                                    self.lolUpcomingList.append(game)
                                elif header == "Recent":
                                    self.lolRecentList.append(game)
                                else:
                                    raise Exception("Parsed invalid header")
                            elif gameType == "dota2":
                                if header == "Live":
                                    self.dotaLiveList.append(game)
                                elif header == "Upcoming":
                                    self.dotaUpcomingList.append(game)
                                elif header == "Recent":
                                    self.dotaRecentList.append(game)
                                else:
                                    raise Exception("Parsed invalid header")
                            elif gameType == "hearth":
                                if header == "Live":
                                    self.hearthLiveList.append(game)
                                elif header == "Upcoming":
                                    self.hearthUpcomingList.append(game)
                                elif header == "Recent":
                                    self.hearthRecentList.append(game)
                                else:
                                    raise Exception("Parsed invalid header")
                            elif gameType == "hots":
                                if header == "Live":
                                    self.hotsLiveList.append(game)
                                elif header == "Upcoming":
                                    self.hotsUpcomingList.append(game)
                                elif header == "Recent":
                                    self.hotsRecentList.append(game)
                                else:
                                    raise Exception("Parsed invalid header")

            except Exception as e:
                print("Error retrieving game data")
                print(traceback.format_exc())