Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
legitatx committed Feb 5, 2023
1 parent 1cf7a81 commit 53c3b64
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions fortnite_replay_parser/events/match.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from models.events import MatchStatsEventExport, TeamStatsEventExport
from models.events import MatchStatsEvent, TeamStatsEvent


def read_match_stats_buffer(event: MatchStatsEventExport, buffer):
def read_match_stats_buffer(event: MatchStatsEvent, buffer):
buffer.skip_bytes(4)
event.accuracy = int(buffer.read_float32())
event.assists = buffer.read_uint32()
Expand All @@ -17,7 +17,7 @@ def read_match_stats_buffer(event: MatchStatsEventExport, buffer):
event.damage_to_players = event.other_damage + event.weapon_damage


def read_team_stats_buffer(event: TeamStatsEventExport, buffer):
def read_team_stats_buffer(event: TeamStatsEvent, buffer):
buffer.skip_bytes(4)
event.placement = buffer.read_uint32()
event.totalPlayers = buffer.read_uint32()
2 changes: 1 addition & 1 deletion fortnite_replay_parser/events/parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from events.match import read_match_stats_buffer, read_team_stats_buffer
from events.player import read_elimination_buffer
from models.enums.fortnite import EventTypes
from models.fortnite import EventTypes
from models.events import *
from logger import logger

Expand Down
6 changes: 3 additions & 3 deletions fortnite_replay_parser/events/player.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from exceptions import PlayerEliminationException
from models.events import PlayerEliminationEvent
from models.reader import Header
from models.enums.fortnite import EFortWeaponType
from models.fortnite import EFortWeaponType


def get_player_name(buffer):
player_type = buffer.read_byte()
if player_type == 0x03:
return "Bot"
elif player_type == 0x16:
elif player_type == 0x10:
return buffer.read_string()
elif player_type == 0x17:
elif player_type == 0x11:
buffer.skip_bytes(1)
return buffer.read_guid()
else:
Expand Down
2 changes: 1 addition & 1 deletion fortnite_replay_parser/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.INFO)
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class EFortBuildingState(Enum):
EFortBuildingState_MAX = 4


class EFortGameplayState(enum.Enum):
class EFortGameplayState(Enum):
NORMAL_GAMEPLAY = 0
WAITING_TO_START = 1
END_OF_ZONE = 2
Expand All @@ -135,7 +135,7 @@ class EFortGameplayState(enum.Enum):
EFortGameplayState_MAX = 7


class EFortMovementStyle(enum.Enum):
class EFortMovementStyle(Enum):
RUNNING = 0
WALKING = 1
CHARGING = 2
Expand All @@ -148,15 +148,15 @@ class EFortMovementStyle(enum.Enum):
EFortMovementStyle_MAX = 9


class EFortPickupTossState(enum.Enum):
class EFortPickupTossState(Enum):
NOT_TOSSED = 0
IN_PROGRESS = 1
AT_REST = 2
COUNT = 3
EFortPickupTossState_MAX = 4


class EFortWeaponType(enum.Enum):
class EFortWeaponType(Enum):
NONE = 0
RANGED_ANY = 1
PISTOL = 2
Expand All @@ -176,7 +176,7 @@ class EFortWeaponType(enum.Enum):
MAX = 16


class ENetRole(enum.Enum):
class ENetRole(Enum):
ROLE_NONE = 0
ROLE_SIMULATED_PROXY = 1
ROLE_AUTONOMOUS_PROXY = 2
Expand All @@ -185,7 +185,7 @@ class ENetRole(enum.Enum):
ROLE_MAX = 5


class EServerStability(enum.Enum):
class EServerStability(Enum):
STABLE = 0
LOW_INSTABILITY = 1
HIGH_INSTABILITY = 2
Expand Down

0 comments on commit 53c3b64

Please sign in to comment.