Skip to content

Instantly share code, notes, and snippets.

@Johni0702
Last active October 11, 2019 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Johni0702/2547c463e51f65f312cb to your computer and use it in GitHub Desktop.
Save Johni0702/2547c463e51f65f312cb to your computer and use it in GitHub Desktop.
Replay restrictions

Overview

Currently the ReplayMod is banned on quite a few servers. This is due to the fact that the user can move freely through the world. By allowing a server to place restrictions on a replay it might be allowed on more servers. It might also be useful to allow players to add (not remove) these restrictions to any of their replays in the Replay Viewer.

Backwards compatibility

To prevent new restricted replays from being opened in an older version or a replay viewer which doesn't support restricted replays, a Disconnect packet is inserted in the replay. Any replay viewer may only remove this disconnect packet when it fully supports restricted replays or wants to display a custom failure screen. The disconnect message should be Please update to view this replay. (otherwise the packet is ignored). The packet may be sent at any point in time and (obviously) has to be inserted manually by the recorder, not the server. There is nothing else a replay recorder has to do except inserting this packet whenever it encounters a Plugin Message with the specific channel (see next paragraph).

Protocol

Replay restrictions are sent by the server via Plugin Message packets on channel Replay|Restrict. Once set a restriction is active until the replay ends or it is manually unset via a second Plugin Message. First the name of the restriction is sent as a String (maximum length of 64 characters), it is followed by a Boolean indicating whether it is activated (true) or deactivated (false), finally options specific to the restriction are sent. This is repeated as long as bytes are left. For all data types see here. If a restriction name is unknown or not supported by the replay viewer it must refuse to play the replay (it may notify the user that they should look for an update). Once defined, neither the format of the options nor the purpose of a restriction may change. It can however be extended by changing the restriction name (e.g. by appending _v2 to the name).

Restrictions

Restriction Name Arguments Description
no_xray None Show suffocation screen when in solid block
no_noclip None Disable the ability to fly through blocks
only_first_person None The camera may not leave the first person view (this should be used with no_xray in case the player clips into blocks)
only_recording_player None Same as only_first_person except that changing the view to another player is also forbidden
hide_coordinates None Hides the coordinates from the F3 screen
So, what are the arguments for?

Imagine you wanted to add a restriction that'd restrict the distance the camera can move away from the recording player or allow the player to spectate only themselves and some other players. That's what arguments are for.

@j-carin
Copy link

j-carin commented Aug 24, 2015

Very good idea. I don't understand why people are concerned about the mod when you could just download the world (http://lmgtfy.com/?q=Multiplayer+World+Downloader+Mod). Anyways hopefully that allows it on more servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment