Skip to content

[2.8.6] Demo Recording/Playback#337

Merged
stonedDiscord merged 35 commits intomasterfrom
feature/demo-playback
Jan 13, 2021
Merged

[2.8.6] Demo Recording/Playback#337
stonedDiscord merged 35 commits intomasterfrom
feature/demo-playback

Conversation

@Crystalwarrior
Copy link
Contributor

@Crystalwarrior Crystalwarrior commented Nov 11, 2020

This implements support for a demo system by recording networking packets for anything that is relevant to this system.
Evidence might be recorded in the future, but it can potentially overload the filesize of .demo files due to how fucking cursed evidence packets are.

TODO:

  • an option to enable/disable demo recordings in the settings

Demo playback system with:

  • Playing the demo file as it would play out in-client
  • Playing the demo file skipping dead air that goes over a certain ms threshold (like 10000 for wait time more than 10s to be skipped)
  • Skipping forward
  • Playback from lobby as an option instead of doing it when present on a server

Features that would be nice but are kind of extra:

  • Reading the demo file frame-by-frame
  • Rewinding
  • Timeline you can navigate with notches etc.

implements #317
Remake of #329 to allow contributions from the whole team

Set up elapsedtimer to generate wait# stuff between packets recorded
TODO: playback
@mposs00
Copy link
Contributor

mposs00 commented Nov 13, 2020

last commit makes it do the thing it needs to work. there are just some details that need implementation:

  1. you start playback with a command which is fine for now i guess
  2. need a way to actually specify a filename
  3. IC messages don't show up because char list is hell. This may take some work to get figured out.

scatterflower and others added 16 commits November 13, 2020 02:51
Pop up file dialog box *before* establishing the connection, not after.
TODO:
* Fix having to load the same file *twice* to be able to connect to the demo server for some reason
* Fix the segfault caused by calling the playback() function when there's no remaining data, it's almost like demo_data.isEmpty() is ignored for whatever reason???
Use file_exists() to be more consistent in append_to_file
…e such as SC, SM, CI etc. (TODO: parity???)

Remove useless debug stuff
…wait in milliseconds between wait packets

Add /pause or | shorthand to pause playback
Re-add /play and keep > as a shorthand
Remove clientside restrictions from sending empty OOC messages and sending OOC messages without a name - these should be serverside.
Default the character to Spectator char no matter the selection in CSS
…l Character Select Screen list to still be parsed corectly, using the character folder in the MS packet as reference.

Allow servers with no selectable characters to still be properly loaded
Bypass the Character Select Screen when joining a server with no character select screen and automatically become a spectator
…xist

Add a /load command letting you load a demo file without rejoining the demo server (the CS packet will not be properly handled but I cannot think of a single tangible problem this causes lol)
Make sure all DEMO CT messages are colored properly
chatlogpiece log_entry(p_name, p_showname, p_message, p_action, p_color);
ic_chatlog_history.append(log_entry);
if (ao_app->get_auto_logging_enabled())
if (ao_app->get_auto_logging_enabled() && !ao_app->log_filename.contains("/Demo playback/"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize this copypasting BS existed with get_auto_logging_enabled. Let's try not to make it worse.

@oldmud0 oldmud0 added this to the 2.9 milestone Dec 28, 2020
# Conflicts:
#	src/courtroom.cpp
#	src/packet_distribution.cpp
mposs00
mposs00 previously requested changes Jan 8, 2021
…mo file, resulting in characters having something like "#1" in their message breaking that specific message
@Crystalwarrior
Copy link
Contributor Author

@oldmud0 @scatterflower
image

# Conflicts:
#	src/courtroom.cpp
#	src/packet_distribution.cpp
… bugged the code

Fix aopacket being busted up as well
@Crystalwarrior
Copy link
Contributor Author

I don't have the energy to continue polishing this branch, everything I need to work works and there have not been any crashes or bad stuff happening with it even if the charlist packet is missing. If you want to polish it you can do so on this branch, though I'd prefer we merged this in as-is and created separate polish branches after the fact once we get 2.9 released and we have minor versions for inevitable bugfixing down the line

@stonedDiscord stonedDiscord dismissed mposs00’s stale review January 13, 2021 16:18

i took care of the issues

stonedDiscord
stonedDiscord previously approved these changes Jan 13, 2021
Copy link
Member

@stonedDiscord stonedDiscord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Copy link
Member

@stonedDiscord stonedDiscord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i wrote this code

@stonedDiscord stonedDiscord merged commit 2f84055 into master Jan 13, 2021
@oldmud0 oldmud0 deleted the feature/demo-playback branch February 14, 2021 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants