Replay Mod Forums

Reading replay files (mcpr)
    • User
    • 4 forum posts
    User12188
    #1

    Jun 21 19, 05:31 PM | Last edited: Jun 21 19, 05:58 PM

    I am attempting to read a .mcpr file. I've unzipped it as described here. And tried reading the recording.tmcpr file with the steps described here But for some reason, while reading the length of an EntityHeadLook packet I determine it's 104625 bytes long. Which is very odd because it should be no bigger than 6 bytes as described here comprised of a VarInt(1-5Bytes) and an Angle (1byte). I'm assuming that the remaining data should be used by the following packet (which is a SpawnObject) which when attempting to read causes an EOF because the packet payload isn't long enough.

    Strangely enough, my code performs the same way as this repo.
    Here is how my code reads the data:
    #0 t:26 l:54 id:2
    #1 t:97 l:21 id:37
    #2 t:97 l:24 id:24
    #3 t:107 l:104625 id:24
    #4 t:118 l:3 id:13
    panic: EOF...

    And then the repo's:
    #0 t:26 l:54 id:2
    #1 t:97 l:21 id:37
    #2 t:97 l:24 id:24
    #3 t:107 l:104625 id:24
    #4 t:118 l:3 id:13
    Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException:...


    I know the file is not corrupted because it runs perfectly fine in the Replay Viewer.
    Here is the .mcpr file. If you could send me the first few packet timestamps, length and id so I can compare them to mine that would really help the process.
    Here is the source code if that's any help.
    Any suggestions, or ideas on why this is happening would be much appreciated!


    • Developer
    • 1883 forum posts
    User10
    #2

    Jun 21 19, 05:53 PM | Last edited: Jun 21 19, 05:54 PM

    Id 24 is hex 0x18 which, if you check the pre-release protocol page (yes, 1.14+ is still on the pre-release page of wiki.vg), is a plugin message.
    Comparing with debugging output from RM, this matches:
    https://paste.replaymod.com/eqewizitaz


    • User
    • 4 forum posts
    User12188
    #3

    Jun 21 19, 05:59 PM

    That's very strange that it's still on the pre-release protocol. Thank you for pointing that out!