forked from eternalcodes/EternalJK
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Super duper premium serverside demo pre-recording and demo metadata #2
Merged
Conversation
This file contains 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
…meTime when sv_demoPreRecord is 0.
- Added game commands for setting demo metadata - Updated docs to include serverside demo related cvars and commands including new ones - Bit of improvement to serverside demo pre-recording regarding clearing pre-record buffer - Implemented demo metadata using method from JK2DemoCutter - Added sv_demoWriteMeta to enable/disable metadata writing altogether.
… prevent unexpected behavior when pre-recording is disabled. - Memset entire preRecord struct to 0 when clearing pre-record of a client. - Guard all serverside demo code with #ifdef DEDICATED, don't need it in client - Replace strlenConstExpr with sizeof() - Removed unused variables. - Set minDeltaFrame back to 0 in a few places, just in case.
- Server pre record time is now controlled via sv_demoPreRecordTime. - sv_demoPreRecordTime and sv_demoPreRecordKeyframeDistance are both in seconds instead of milliseconds now.
- Some extra safety checks for demo pre-recording, just in case - Clean up possibly mysteriously leftover packages that for whatever reason weren't cleared yet before adding new messages. - Always clear demo pre-record buffer on client disconnect, even if demo wasn't being recorded.
Seems okay, merging |
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.
Allows pre-recording packets for serverside demos, allowing to record defrag demos without missing start of run.
Also adds ability to add custom metadata to serverside demos, for example for more convenient processing in jamme or more precise cutting at a later point.
The metadata for the demos works by inserting an empty message at the start of the demo that starts with lastClientCommand (mandatory) and then immediately svc_EOF and then metadata following the svc_EOF, meaning it is invisible to all normal clients.
Metadata is in JSON format, meaning various keys can be set. Some default data is written into the metadata: Unix timestamp of start of the demo, writing application (EternalJK_Server) and pre-record start offset (if using pre-recording) denoting the time difference (in milliseconds) from start of demo to the time the recording was started.
Pre-recording can be enabled via sv_demoPreRecord 1 and demo metadata can be disabled via sv_demoWriteMeta 0. sv_demoPreRecordTime and sv_demoPreRecordKeyframeDistance are time values in seconds, see updates to documentation as well as pastes below. (Edited to reflect new commits)
New commands for game to control the new features:
New cvars for server (edited after requested changes):
Edit: Updated after 4371f95
Edit 2: Forgot to change description text regarding sv_demoPreRecord.