Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2.8.6] Demo Recording/Playback (#337)
* initial commit with horrible code dupcliation haha lol Set up elapsedtimer to generate wait# stuff between packets recorded * implement groundwork for internal demo server * add core playback functionality * make it work kinda by including SC packet in demo * Add a file dialog for loading a demo file instead of a hardcoded path * Change /play to > in OOC to begin playback or skip to next element 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??? * Clear demo data when loading a demo file to prevent stacking demos * Properly disconnect the client when sending the request for file browser fails to obtain a good demo file * Fix append_to_file newlining even if file didn't exist prior to calling this function * Add a very scuffed exception to not log or demo record anything that happens in the Demo playback local server * Reduce invalid file spam by checking for non-logging server better Use file_exists() to be more consistent in append_to_file * Fix the client crashing when receiving loading packets etc. at runtime such as SC, SM, CI etc. (TODO: parity???) Remove useless debug stuff * Preserve newlines for demo packets such as "CT", "MS" etc. * Implement /max_wait, /min_wait for adjusting the maximum and minimum 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. * Empty music list Default the character to Spectator char no matter the selection in CSS * Allow -1 character ID or character ID that does not fit into the local 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 * Properly handle demo files without SC packet to dictate which chars exist 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 * Fix logs bleeding into each other if you disabled logging or you joined a demo server after leaving another * Prevent logging even if log_filename is defined because a user might disable auto logging when running the game * Fix custom shownames not appearing in the IC logs * Set up new logic for max_wait, meaning that dead air being skipped is prioritized with MS (IC chat) packets being used as the anchor. * Better logic for min_wait to only affect important packets (IC Chat) * Fix encoding not being performed on packets that are saved to the .demo file, resulting in characters having something like "#1" in their message breaking that specific message * Fix a weird setup in courtroom.cpp that happened out of the merge and bugged the code Fix aopacket being busted up as well * add missing feature flags to the demoserver * use random port * move writing to the demo file to a function * only listen on localhost Co-authored-by: oldmud0 <[email protected]> * remove copypasta * add a help to the demo server * fix empty demo disconnecting the server * tell the user how to begin Co-authored-by: scatterflower <[email protected]> Co-authored-by: stonedDiscord <[email protected]> Co-authored-by: stonedDiscord <[email protected]> Co-authored-by: oldmud0 <[email protected]>
- Loading branch information