Shiqan / fortnite-replay-reader

Fortnites favorite assistent is here to help you parse replay files
MIT License
31 stars 12 forks source link

Replay timestamp not working correctly #27

Closed vvettoretti closed 4 years ago

vvettoretti commented 4 years ago

I tried it on several replays, and its giving me a wrong time. I would like to get the REAL timestamp of the kill. Here is the code i tried and the output



with Reader("UnsavedReplay-2020.02.11-18.39.08.replay") as replay:
    for elim in replay.eliminations:
        print(elim.time)
OUTPUT
1970-01-01 01:00:24.852000
1970-01-01 01:01:27.468000
1970-01-01 01:01:29.914000
1970-01-01 01:01:30.855000
1970-01-01 01:01:34.374000
1970-01-01 01:01:34.408000
1970-01-01 01:01:39.516000
1970-01-01 01:01:39.516000
1970-01-01 01:01:41.516000
1970-01-01 01:01:42.058000
1970-01-01 01:01:42.258000
1970-01-01 01:01:43.140000
1970-01-01 01:01:43.907000
Shiqan commented 4 years ago

Hi, the time is not a "real" timestamp, it is the number of seconds since the start of the game. You can either extract the minutes and milliseconds from elim.time or you'd have to offset the timestamp with the start of the game. If I remember correctly, there is a datetime for the start of the game in the header. Hope this helps :)

vvettoretti commented 4 years ago

Unfortunately, there is no datetime in the header file. But thanks for the help!

Shiqan commented 4 years ago

https://github.com/Shiqan/fortnite-replay-reader/blob/3ae09e5b584819d76c89ecfbbc388115052121b1/ray/reader.py#L164

Guess I dont do anything with it 😅 If you want you can make a PR to include the information from that function as well.