Skip to content

Configuration

Ben Anderson edited this page Nov 1, 2021 · 11 revisions

MySQL

As mentioned in the installation instructions, you must configure the MySQL database to be used by InstantReplay in the mysql section of the configuration file. However, this database should not be used for different InstantReplay instances across multiple servers.

An example mysql configuration is shown below:

mysql:
  username: "admin"
  password: "adminpassword"
  host: "127.0.0.1"
  database: "instantreplay"
  port: 3306

If you wish to run InstantReplay on multiple Minecraft servers and use the same MySQL server then consider creating a different database on the MySQL server for each InstantReplay instance. For example one InstantReplay instance could use database instantreplay_1 and another InstantReplay instance could use database instantreplay_2.


Settings

Before changing the settings, please keep in mind that the default values will be perfectly suitable for most use-cases.


use-plugin-prefix (boolean)

Determines whether every time a message is sent to a user (from InstantReplay), it should be prefixed with the value stored as plugin-prefix in the configuration file.

seconds-per-timestamp-output (integer)

Whilst a user is viewing/watching a replay, every x number of seconds they are sent the current timestamp of the replay in the chat so that they can start a replay from that exact timestamp later if they wish. This configuration value determines how often (in seconds) the timestamp is sent to the user whilst viewing/watching a replay.

ignore-y-radius (boolean)

When starting a replay, the events to be replayed will be determined by the radius provided in the /replay start command. If ignore-y-radius is true, then as long as the events are within the radius on the x-axis and z-axis, the events will be counted as part of the replay. However, if ignore-y-radius is false, the events will also have to be within the radius on the y-axis in order to be counted as part of the replay.

For example, let's take the following situation: a player runs the command /replay start 3 10s (where 3 is the radius of the replay and 10s means for events in the last 10 seconds) after placing a block 20 y-values above his location 5 seconds ago.

  • If ignore-y-radius is false, then the block placement event will not be included in the replay as the block was not placed within the required 3 block radius.
  • If ignore-y-radius is true, then the block placement event will be included in the replay as the location of the block on the y-axis is irrelevant.

spectator-gamemode (boolean)

When starting a replay, the player who started the replay will enter spectator gamemode if this configuration value is true. Once the replay has finished, the player will be returned to their original gamemode.

The recommended value for this settings is true as it will stop the replay viewer getting stuck on 'ghost blocks' which aren't visible in the replay.

seconds-per-player-move-log (double)

Determines how often the current locations of all the players on the server are saved. Please note that there are some optimisations built into the saving of player locations, such as the plugin won't continuously save a player's location if they haven't moved since last movement log.

During a replay, you will see a player moving much more than just teleporting around every-so-often. This is because, when starting a replay, the plugin runs player movement predictions with the movement events that meet the replay criteria to try to predict the movements in-between two player movement events.

The recommended value for this setting is 1, however this can be reduced slightly depending on the player count of the server. It's best to experiment and find a value that works best for you, however a value of 1 will be adequate for most use-cases.

seconds-per-player-inventory-log (double)

Determines how often the inventory contents (includes armour) and health of all the players on the server are saved.

The recommended value for this setting is 1, however this can be reduced slightly depending on the player count of the server. It's best to experiment and find a value that works best for you, however a value of 1 will be adequate for most use-cases.

hours-until-logs-deleted (integer)

Determines how often all the event logs stored in the database are deleted. This setting is in hours and once an event becomes more than x hours old (where x is hours-until-logs-deleted), the event will be permanently deleted from the database.

This setting is especially useful for servers with a large player count as they may generate lots of events in a short period of time. These servers may find it slightly more efficient and storage-conscious to regularly clear the logs every few days - that's what this setting will do.

The default value for this setting is 72, however you may wish to decrease this value depending on the player count of the server. Furthermore, your requirements and preferences for how long ago you wish to be able to replay from should also impact this decision. It is recommended to use the lowest value you can that still suits your use-case.

If you wish to stop the automatic deletion of event logs, change this setting to a negative value such as -1.

event-render-buffer (integer)

Determines the number of events that are held in an internal buffer during the rendering of a replay - this works much like how watching a video online will download some video content ahead of your current point in preparation to render it.

Deciding on a buffer size:

  • If you are expecting to have many administrators viewing replays at the same time, then it is recommended either keeping the buffer setting at its default value or decreasing it.
  • If you are expecting to have many events occurring at the same place in the replay at the same time, then a larger buffer may be ideal to ensure you always have events ready to render.
  • If you use a buffer that is too small, you may experience momentary (~0.1 second) pauses whilst viewing a replay with many events, leading to a less smooth replay experience.
  • If you use a buffer that is too large, you may experience increased memory usage by the plugin (more than necessary) as many events will be held in the internal buffer (in memory).

The default value for this setting is 100, however you may wish to change this value depending on your use-case. Regardless of the buffer size you choose, it is strongly recommended that you keep the setting between the values of 50 and 500.

timestamp-converter-format-datetime (string)

Determines the required format of a date-time when parsing it using /replay timestamp [datetime]. It is only recommended changing this value if you have knowledge of date-time parsing, furthermore, the default value for this setting should be adequate for most use-cases.

Acceptable characters for a date-time format can be found here. The format set should be able to resolve to a date and a time - just a date is not enough.

It is worth noting that, due to the parsing of the command, spaces cannot be used in the format setting.

timestamp-converter-format-time (string)

Determines the required format of a time when parsing it using /replay timestamp [time]. It is only recommended changing this value if you have knowledge of time parsing, furthermore, the default value for this setting should be adequate for most use-cases.

Acceptable characters for a time format can be found here. The format set should be able to resolve to a time - the current date will be used for the resolved date.

It is worth noting that, due to the parsing of the command, spaces cannot be used in the format setting.

replay-permission (string)

This setting is the base permission to use the /replay command and all it's sub-commands; other than /replay reload and /replay clearlogs who have their own permissions.

The default value for this setting is instantreplay.replay, changing the value is up to preference or to make it work with your current permission plugin.

replay-reload-permission (string)

This setting is the permission for the /replay reload command.

The default value for this setting is instantreplay.reload, changing the value is up to preference or to make it work with your current permission plugin.

replay-clearlogs-permission (string)

This setting is the permission for the /replay clearlogs command.

The default value for this setting is instantreplay.clearlogs, changing the value is up to preference or to make it work with your current permission plugin.


Messages

Messages may be added to the wiki at a later date - at the current stage of the project they change fairly often and are fairly self-explanatory.