Repository navigation
Make /dm reload async and speed up menu lookups - #324
Open
Robin-qwerty wants to merge 1 commit into
Open
Robin-qwerty wants to merge 1 commit into
Robin-qwerty wants to merge 1 commit into
Conversation
/dm reload used to do everything on the main thread: it parsed config.yml four times, rewrote it, and read and parsed every menu file, which caused an MSPT spike on servers with many or large menus. The file reading and YAML parsing now run on an async thread. Only the cheap part stays on the main thread: building the menus from the parsed configs, swapping them in and registering their commands. Old menus keep working until the new ones are ready. A second reload while one is still running gets a "reload already in progress" message. /dm reload <menu> is async too, and now reports when a menu file fails to load. Also: - Fix has_item name_ignorecase / lore_ignorecase calling the wrong setters, which made them do nothing and overwrite name_contains / lore_contains. - Look up menu open commands with a map instead of scanning every menu on each player command. - Look up a player's open menu with a map instead of scanning all open menus on each inventory click, open and close. - Parse action delay/chance tags without compiling a regex per line. - Close the streams used when creating example/default menu files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PRt7tTMyPbFtdxfErt32UP
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.
/dm reloadused to do everything on the main thread: it parsed config.yml four times, rewrote it, and read and parsed every menu file, which caused an MSPT spike on servers with many or large menus.The file reading and YAML parsing now run on an async thread. Only the cheap part stays on the main thread: building the menus from the parsed configs, swapping them in and registering their commands. Old menus keep working until the new ones are ready. A second reload while one is still running gets a "reload already in progress" message.
/dm reload <menu>is async too, and now reports when a menu file fails to load.Also: