This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Replay Server"

From BZFlagWiki
Jump to: navigation, search
(add Replay File Contents section)
(Recording Setup: tell where to find replay files in the absence of -recdir)
Line 2: Line 2:
  
 
== Recording Setup ==
 
== Recording Setup ==
To prepare your server to allow recording to a file, make sure to specify ''-recdir /path/to/record/dir'',  make sure /path/to/record/dir is writable by the same user that bzfs is running as.  It may also be a good idea to limit the size of the record buffer (this is taken from RAM), and will also automatically start the record buffer with the specified size (in Megabytes).  For instance ''-recbuf 16''.
+
To prepare your server to allow recording to a file, make sure to specify ''-recdir /path/to/record/dir'',  make sure /path/to/record/dir is writable by the same user that bzfs is running as.  Without the -recdir option, replay files will be saved in a directory named "recordings" in the parent directory above your [[Config File]] (~/.bzf/recordings on Linux systems, for example).
 +
 
 +
It may also be a good idea to limit the size of the record buffer (this is taken from RAM), and will also automatically start the record buffer with the specified size (in Megabytes).  For instance ''-recbuf 16''.
  
 
== Replay Setup ==
 
== Replay Setup ==

Revision as of 00:11, 12 November 2009

"Replay" is a feature that allows admins to record a match to a circular buffer and optionally store a portion of the recording to a file.

Recording Setup

To prepare your server to allow recording to a file, make sure to specify -recdir /path/to/record/dir, make sure /path/to/record/dir is writable by the same user that bzfs is running as. Without the -recdir option, replay files will be saved in a directory named "recordings" in the parent directory above your Config File (~/.bzf/recordings on Linux systems, for example).

It may also be a good idea to limit the size of the record buffer (this is taken from RAM), and will also automatically start the record buffer with the specified size (in Megabytes). For instance -recbuf 16.

Replay Setup

Although you could restart your server in replay mode each time you'd like to playback a match, its recommended that you run a separate server on a separate port as a replay server. Again, you must specify -recdir /path/to/record/dir, but for replay mode also specify the -replay command line option. If you want this to be a public server, consider using the -advertise option to advertise only to your admin group(s).

How to Record

If during the game, you see something you'd like to record, first you must be in a group with the RECORD privilege. Use the /record save <filename> [seconds] command. [seconds] is how many seconds you'd like to go back into the buffer to save to disk. If this recording is for administrative purposes, it may be a good idea to use a descriptive name for the filename. Try using playername.offense.ipaddress. This will help others who view the file know who they should be watching during playback. If it is for a league match, try using team1name.vs.team2name.

How to Playback

Once you've made your recording, log into your playback server, and use the /replay list command, which will give you a directory listing of the directory you specified with -recdir. Once you see the file you'd like to lay back, take note of the filename, or the #index, then use the /replay load filename or /replay load #index to load the file. If you load a file that isn't compatible with the map currently loaded on the server, you'll get a message like this:

SERVER: An incompatible recording has been loaded
SERVER: Please rejoin or face the consequences (client crashes)

If you see this message, simply rejoin. If you don't your client will close/crash. If that happens, don't fret, just start it back up and it'll work fine. When you're ready to start do /replay play.

Command Reference

The instructions above will get you started, but there are many more commands that may prove useful. Below is an explanation of each.

Command Description
/record list List all files in the recordings directory
/record start Start recording into the memory buffer
/record stop Stop recording into the memory buffer
/record size <megabytes> Set the size of the recording memory buffer
/record rate <seconds> Set the time between game state updates stored in the recording. This will affect the granularity of the 'skips' you can do while replaying a file. It will also make the recording files bigger if it is set to a faster update rate.
/record stats Display the statistics for the current recording (file or buffered)
/record file <filename> Start recording directly to a file
/record save <filename> [seconds] Save the recording buffer into a file. If seconds is specified, then only save that many previous seconds into the file.
/replay list List all files in the recordings directory
/replay load <filename|#index> Load the specified recording file by name, or by index (same indices as produced by the 'replay list' command)
/replay loop Same as /replay play except recording will wrap at the end and play in a loop
/replay pause Pause the replay. When you use this, the recording appears to all go [nr] (not responding), to unpause, use the /replay play command. (undocumented in game)
/replay play Start playing the recording. This will oftentimes require that all players connected to the server rejoin (to reload the map, etc...)
/replay skip [+/- seconds] If seconds is specified, then skip that amount of time in the recording. Otherwise, skip forwards until there is activity.

Replay File Contents

In addition to all of the movement information necessary to recreate a game, saved replay files include all of the commands sent by clients. This means that team chat, private messages, and any /password commands are all there to be seen by anyone with access to a replay file. Please be careful when sharing replay files to avoid unwanted exposure of private conversations or the server password.