Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added additional gun types and stat fields. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/FortniteReplayReader/GunType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ namespace FortniteReplayReader
{
public enum GunType : byte
{
Storm,
Fall,
Pistol,
Shotgun,
AR,
SMG,
Sniper
//we're probably missing some values in here for things like Kevin the cube.
Storm = 0,
Fall = 1,
Pistol = 2,
Shotgun = 3,
AR = 4,
SMG = 5,
Sniper = 6,
Pickaxe = 7,
Grenade = 8,
RocketLauncher = 11,
Minigun = 12,
Trap = 14,
FinallyEliminated = 15,
GasGrenade = 23
}
}
12 changes: 11 additions & 1 deletion src/FortniteReplayReader/ReplayInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ public ReplayInfo()
private List<PlayerElimination> playerEliminations;
public IEnumerable<PlayerElimination> PlayerEliminations => playerEliminations;

public uint Eliminations { get; internal set; }
public uint Position { get; internal set; }
public uint TotalPlayers { get; internal set; }

public float Accuracy { get; internal set; }
public uint Assists { get; internal set; }
public uint Eliminations { get; internal set; }
public uint DamageToPlayers { get; internal set; }
public uint Revives { get; internal set; }
public uint DamageTaken { get; internal set; }
public uint DamageToStructures { get; internal set; }
public uint MaterialsGathered { get; internal set; }
public uint MaterialsUsed { get; internal set; }
public uint CentimetersTraveled { get; internal set; }

internal void AddPlayerElimination(string eliminated, string eliminator, GunType gunType)
{
playerEliminations.Add(new PlayerElimination
Expand Down
13 changes: 12 additions & 1 deletion src/FortniteReplayReader/ReplayReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,19 @@ public ReplayInfo ReadReplayInfo()

if (metadata == AthenaMatchStatsMetadata)
{
reader.SkipBytes(12);
//shots hit, shots fired, and headshots might be in here somewhere
reader.SkipBytes(4);
replayInfo.Accuracy = reader.ReadUInt32();
replayInfo.Assists = reader.ReadUInt32();
replayInfo.Eliminations = reader.ReadUInt32();
replayInfo.DamageToPlayers = reader.ReadUInt32();
reader.SkipBytes(4);
replayInfo.Revives = reader.ReadUInt32();
replayInfo.DamageTaken = reader.ReadUInt32();
replayInfo.DamageToStructures = reader.ReadUInt32();
replayInfo.MaterialsGathered = reader.ReadUInt32();
replayInfo.MaterialsUsed = reader.ReadUInt32();
replayInfo.CentimetersTraveled = reader.ReadUInt32();
}

if (metadata == AthenaMatchTeamStatsMetadata)
Expand Down