예제 #1
0
 def reset_all(cls):
     Team.reset()
     Player.reset()
     Ball.reset()
     Goal.reset()
     # frame doesnt need reset for now
     cls.allGames = []
예제 #2
0
    def look_for_players_and_teams(self):
        teams = []
        players = []
        # check first 10 frames for teams
        for frameNo in range(10):
            frame_data = self.replayData[frameNo]

            for _id, _props in frame_data['Spawned'].items():
                if _props["Class"] == 'TAGame.Team_Soccar_TA':
                    team = Team(int(_id), _props)
                    teams.append(team)

        # check first 10 frames for players (has to check after teams as players are immediately assiged to their team
        for frameNo in range(
                self.maxFrameNo
        ):  # for $#@%!ers who join midgame (looking at you nielskoek)
            frame_data = self.replayData[frameNo]

            for _id, _props in frame_data['Updated'].items():
                if 'Engine.PlayerReplicationInfo:PlayerID' in _props:
                    # print('hi')
                    player = Player.find_players(int(_id), _props)
                    if player:
                        players.append(player)
        return {'teams': teams, 'players': players}
예제 #3
0
    def look_for_players_and_teams(self):
        replayData = self.replayData
        teams = []
        players = []
        #check first 10 frames for teams
        for frameNo in range(100):
            try:
                for actor in replayData[frameNo].actors:
                    if 'n_Team' in actor: #prelim check
                        actorData = (actor,replayData[frameNo].actors[actor])
                        team = Team.find_and_add_teams(actorData)
                        if team: teams.append(team)
            except KeyError:
                pass #frame just probably doesn't exist
                
        #check first 10 frames for players (has to check after teams as players are immediately assiged to their team
        for frameNo in range(100):
            try:
                for actor in replayData[frameNo].actors:
                    if 'e_Default_' in actor: #prelim check
                        actorData = (actor,replayData[frameNo].actors[actor])
                        player = Player.find_players(actorData)
                        if player and (player not in players):
                            # print(player.name)
                                players.append(player)
            except KeyError:
                pass #frame just probably doesn't exist    

        return {'teams':teams,'players':players}
예제 #4
0
 def parse_two(self):
     goals = self.find_goals()
     Player.add_all_ids(self)
     Player.add_all_positions(self)
     return {'goals': goals}
예제 #5
0
 def parse_two(self):
     goals = self.find_goals()
     Player.add_all_ids(self)
     Player.add_all_positions(self)
     return {'goals':goals}