aboutsummaryrefslogtreecommitdiff
path: root/src/packet_distribution.cpp
AgeCommit message (Collapse)Author
2021-01-19Merge branch 'master' into feature/timerclockCrystalwarrior
# Conflicts: # include/courtroom.h
2021-01-13[2.8.6] Demo Recording/Playback (#337)Crystalwarrior
* 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 <oldmud0@users.noreply.github.com> * 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 <marisaposs@gameboyprinter.moe> Co-authored-by: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> Co-authored-by: stonedDiscord <stoned@derpymail.org> Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2021-01-12Better place to check invalid ID'sCrystalwarrior
2021-01-12Merge branch 'master' into feature/timerclockCrystalwarrior
# Conflicts: # include/courtroom.h
2021-01-12Desynchronize viewport from the IC chat log so that users have a smooth ↵Crystalwarrior
viewing experience as an option (#385) * Begin trying to understand handle_chatmessage monstrosity Rearrange some functionality to be more consistent with what the particular handle_chatmessage is *supposed* to be responsible for Single responsibility principle doesn't apply not just to script files but even functions in this goddamned program apparently. * Fix some oversights relating to "has presented evidence" logs * Fix an edge case crash with negative evidence, idk why this didn't happen before. * Completely refactor handle_chatmessage hell and split it up into single-responsibility-principle functions like a sane and organized coder would. This will break any PRs that touch handle_chatmessage and will have to conform to the new standard, but it's very good in the long run. Functions have also been meticulously commentated to make sure that everyone can understand at a glance what everything does. This refactor is done to pave way for smooth viewport, making characters no longer randomly interrupt each other when speaking. * Rename confusingly named "handle_chatbox" to "handle_ic_speaking" Add a new function "handle_callwords" * Parse blankposts in the packet unpacking phase log_chatmessage is now an argument-based funciton instead of using m_chatmessage monstrosity Commentate the heck out of log_chatmessage Fix showname displaying logic being bonkers for log entries Fix -1 char_id most likely crashing client, even tho they're supposed to be system messages Fix [CHARID] being referenced instead of [OTHER_CHARID] in the pair display func Fix chat message color being used for "has played a song" even though it shouldn't * Move setting emote_mod from the objection thing to the packet unpacking thing handle_emote_mod has become argumented * Make display_pair_character take in only vars it needs * Add functionality for message stacks (does not handle logging separately yet) Currently segfaults at line 1823 if stacking behavior actually occurs. Plz help I'm poopie brain at this * Make sense of pointers and dereference some pointers to prevent wacky errors Replace _stack with _queue, and turn it into a QQueue * Implement a minimum text delay queue timer so that each msg must stay on screen for a specified amount of time Chat_arrow only shows up when the minimum text delay has expired Check if target is muted in the enqueueing, as well as the validity of the character id, so we don't even bother adding it to the queue Add a settings option to set text stay time (minimum amount of time to pass before displaying the next message). TODO: Handle queued interjections in a cooler way * Adjust default option for stay_time to be 200ms Make the stay_time setting of 0 disable the queue system entirely * Make interjections force-clear the message queue Use interjections to instantly process those messages - objections are usually extremely important and must have everyone's immediate attention. TODO: Add a settings option for interjection behavior * Clear message queue when bg display packet is received * Add an instant objection setting which, when enabled, will interrupt and skip the message queue on objections (effectively bypassing text_delay system) * Stop using AOPacket for the queue and use QStringList instead (packet contents, we don't care for the header) Implement objection threshold which works in a queue if instant objections are disabled (not exposed to the settings yet) Modify packet contents directly instead of waiting for m_chatmessage shenanigans (we should deprecate this soon) Rename isinstant_objection_enabled options check to be more consistent * Make it so objections display as soon as the message is over if instant_objection is disabled * Remove emote_mod = "1" thing that had no real purpose Implement desynchronized logs settings option, which is false by default, meaning users' messages and display IC logs are going to be in sync. Split up display and logging behavior, meaning IC logs will be saved with accurate timings on the .logs file, while display can be slower. Remove dumb "System" showname thing cuz it was dumb * Bring back minimum packet size safety check * Make sure shouts are properly logged. I am very sorry for this horrible amount of code duplication though. * fix compile errors * fix html parsing error * Rearrange the order of logging so IC messages go like this: * shouts go first * evidence goes second * chat message goes last * Fix No Interrupt coming back, go away you foolish beast * fix borked options dialog * Crank down "press enter delay" from 600ms to 200ms so it's not as harsh Co-authored-by: in1tiate <radwoodward@vikings.grayson.edu> Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
2021-01-11Add "id" variable to the clock functions and properly parse the IDCrystalwarrior
Implement scalable maximum clock count, right now it's at 5 clocks a theme can have max Theme "clock_" starts from 1 instead of 0 since users don't know when stuff starts at index 0 TODO: testing lol
2021-01-11Set log filename to a more sortable formatSkye Deving
2021-01-10Add arup_clear() and clear arup when fetching new areasSkye Deving
Theoretically fixes #313 The "FA" packet from the server invalidates the client's previous area list so it makes sense for the arup information tied to that list to be invalidated as well (especially seeing that the area and arup share the same index). As we repopulate the client's area list, we do the same for the arup list.
2021-01-10Merge branch 'master' into feature/timerclockCrystalwarrior
# Conflicts: # include/courtroom.h # src/courtroom.cpp
2021-01-09Add desk_mods 2 -5 for more flexibility in emotes (#353)in1tiate
2021-01-09Rework timer and ping logicoldmud0
The timer's time as received by the server is clarified to be the actual numerical time, in milliseconds, to be shown on the clock.
2021-01-06Merge pull request #316 from AttorneyOnline/messageboxoldmud0
add BB packet for a MessageBox popup
2021-01-03FL toggle for Y offset (#360)scatterflower
Use "y_offset" to enable the Y offset protocol extension.
2020-11-16move enter courtroom to the PV packet instead of just doing it when you ↵stonedDiscord
click a character
2020-11-07Merge pull request #312 from AttorneyOnline/fix-doubleclickoldmud0
fix doubleclick server being buggy
2020-11-01reset doubleclick flag on connectscatterflower
2020-10-06add BB packet for a MessageBox popupstonedDiscord
2020-10-04fix doubleclick server being buggyscatterflower
2020-08-25move "check" to the very end instead of very start in packet_distributionCrystalwarrior
2020-08-25Implement clock pausingCrystalwarrior
Implement clock setting w/o starting or stopping Both of these should make it possible for the server to start/stop/pause/resume the clock with perfect synchronization to the true time.
2020-08-25Introduce the timer packet - "TI".Crystalwarrior
This timer will start the clock accounting for latency! Cool, right? Remove useless qDebug() for music looping
2020-08-25Actually make use of the completely useless CHECK and CH keepalive timer and ↵Crystalwarrior
use them to determine the client's ping. Display ping in the application window title. keepalive timer now fires every second instead of every minute Remove meme clock starting on set_widgets() implement get_ping() on w_courtroom
2020-08-21remove slow loadingscatterflower
2020-08-21remove remaining traces of fantacryptscatterflower
2020-08-21remove fantacryptscatterflower
2020-08-16clang formatscatterflower
2020-08-15Only regenerate the area list once per ARUP packetscatterflower
2020-07-31Add option for automatic logging (#203)windrammer
Just so we're on the same page, this is enabled by default. Co-authored-by: Cents02 <Cents02@Cents0.me>
2020-07-23Make 'FL' packet reset settings to default and take the new settings in (#186)Crystalwarrior
* Fix colors in ic logs not parsing HTML properly when log_goes_downwards=false and colorlog=true * Restore KFO branding * Reset the settings values when receiving the 'FL' packet. This allows enabling/disabling features at runtime, such as ARUP system. * Revert "Restore KFO branding" This reverts commit 7f19b6257a0d75ec1d392b9b8c02a384c8dba43d.
2020-06-12Fix connect button not enablingoldmud0
Apparently this had never been staged, and while everyone was having problems with the connect button, everything was working just fine for me. This enables the connect button a bit earlier in the handshake process than in 2.6, since there are some older servers out there that don't send FL (and so the connect button would never get enabled). This might lead to race conditions, and sometimes the progress bar does hang, but you can just cancel and reconnect - I haven't encountered a crash so far.
2020-05-23translate stuff that got run oversD
2020-05-22Merge KFO source unconditionally into AO2oldmud0
2020-05-22Perform clang-formatoldmud0
If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
2020-05-22Full revert to tag 2.6.2oldmud0
Due to a countless number of changes made to the core that were not fully understood, tested, or documented, it was decided to roll everything back to the last known stable version (2.6.2). Changes dropped include: - Witness needed - Shake - Frame SFX - Multiple custom objections - Multithreaded thumbnail generation - Looping - Various translation additions - "Mirror IC" - Color in IC log - An invocation of clang-format Next time, work together and split your big fork into independently testable feature branches.
2020-05-22clang 2 electric boogalooCrystalwarrior
{ BasedOnStyle: LLVM, BreakBeforeBraces: Stroustrup}
2020-05-22Clang-ify the code with this styling using Visual Studio Code:Crystalwarrior
{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup)
2020-04-17Run clang-format on entire projectoldmud0
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style. Lines reflow at 80 characters. One-line method bodies are on the same line as the signature. Space always after `//`. No indentation on preprocessor macros. Includes are sorted lexicographically. If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
2020-04-17Mega-merge of CR forkoldmud0
CR likely stands for "CentsRaidensnake." Like the Case Cafe mega-merge before it, this was not a clean merge, and it had to be split up into two parts: the actual changes, and the attempt it made to reformat the entire code via clang-format. This branch had a complicated set of changes that would be difficult to describe in this commit message. It would be better described in a proper changelog.
2020-03-15it's basically the same packet minus requesting the next listsD
2020-03-15Merge branch 'master' into pr/104sD
2020-03-13move area list detection algorithm into a seperate functionsD
2020-03-13musictime is a bad name for thissD
2020-03-06indentationsD
2020-03-06Merge branch 'master' into music_list_updatestonedDiscord
2020-02-24Make pos dropdown more abstract and actually useful by letting servers send ↵Crystalwarrior
only pos you can actually access. Pos dropdown system also reads the actual bg folder of the current BG to see all the created pos.
2020-02-23loading lost in translationsD
2020-02-23replace music loadingsD
2020-02-23detect == as music startsD
2020-02-21put the old char loading backsD
2020-02-21area count got renamedsD