Introduce API events & functions to work w/replays#358
Draft
Conversation
- Add the following new event types: - `bz_eReplayRequestedEvent` - `bz_eReplayLoadedEvent` - `bz_eRecordingStartedEvent` - `bz_eRecordingEndedEvent` - Add the following new API functions: - `bz_isReplayServer()` - `bz_loadReplay(const char* _filename, int playerIndex)` - `bz_replayExists(const char* _filename)` - `bz_unloadReplay(int playerIndex)` - `bz_makeApiTime(time_t time, bz_Time* apiTime)`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Functions
bool bz_isReplayServer(void)Returns true if the current BZFS process runs with the
-replayflag.bool bz_loadReplay(const char* _filename, int playerIndex = BZ_SERVERPLAYER)The BZFS API equivalent of a player running
/replay load.bool bz_replayExists(const char* _filename)Check to see if a given replay filename exists on the server.
bool bz_unloadReplay(int playerIndex = BZ_SERVERPLAYER)Reset the replay server's status and unload the current replay. This is no slash-command equivalent of this (as far as I know).
New Server Events
bz_eReplayRequestedEventReplay::loadFile-> called from/replay loadbz_eReplayLoadedEvent; any errors that happen in loading replays will be reported herebz_eReplayLoadedEventReplay::loadFile-> called from/replay loadbz_eRecordingStartedEventRecord::start/record startbz_startRecBuf()253if the server starts itbz_eRecordingEndedEventRecord:stop/record stopbz_stopRecBuf()Data fields are the same as
bz_eRecordingStartedEvent