Replay Mod (Fabric & Forge)

Replay Mod (Fabric & Forge)

1M Downloads

Recording file format

PabloDons opened this issue ยท 7 comments

commented

Do you have a documentation for the file format you use for your recordings? I'm looking into server-side recording and want to see if I can transcode .mcpr files so I can use your renderer instead of doing client side recording.

commented

.mcpr files are just zip files with at least a metaData.json and recording.tmcpr file inside (see here for what else is in there).

The content of the metaData.json is described here.
The recording.tmcpr is just 32-bit timestamp in ms since start of replay, then 32-bit length, then length bytes of data for a single packet (i.e. starts with mc-varint-encoded packet id) and that repeated for all packets (see here). I don't remember if it's using LE or BE, you'll need to check the code for that.
Also note that the thumbnail file has some fixed bytes prepended for some reason (don't ask me why, I didn't write it, I'm just carrying it on for backwards compatibility).

commented

The fixed bytes in the thumbnail file are injected in an (in hindsight, probably misguided) attempt to make it harder for people to upload replay files with custom thumbnails that were not created with the ReplayMod to the Replay Center.

commented

@PabloDons Did you succeed with writing a server-side recorder?

commented

@devurandom I wasn't planning on writing my own. I was looking to use the X Replay spigot plugin and write a transcoder for the two filetypes, then throw the mcpr file into this replay mod. I decided against buying this plugin though, but in hindsight, there are other plugins that do the same thing, so I could have used those.

commented

there are other plugins that do the same thing, so I could have used those.

Which are? During a rather extensive search I could not find anything for the server-side.

commented

@PabloDons: Thank you! This mod (and X Replay) is for Spigot, while I am running a vanilla server.

commented

This was the first result when I searched
https://www.spigotmc.org/resources/advancedreplay-1-8-1-15.52849/

Appears to do exactly what I originally wanted while being free.