Skip to content
Open
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
5 changes: 4 additions & 1 deletion pyrdp/player/Replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Replay:
"""

def __init__(self, file: BinaryIO):
currentMsgIndex = 0
self.events: Dict[int, List[int]] = {}
self.file = file

Expand All @@ -36,7 +37,9 @@ def __init__(self, file: BinaryIO):
# Register PDUs as they are parsed by the layer
def registerEvent(pdu: PlayerPDU):
nonlocal currentMessagePosition
events[pdu.timestamp].append(currentMessagePosition)
nonlocal currentMsgIndex
events[currentMsgIndex].append(currentMessagePosition)
currentMsgIndex = currentMsgIndex + 1

# Register the offset of every event in the file.
player = PlayerLayer()
Expand Down