feat: scheduled reload of account definitions from storage#1024
Open
HarleyGilpin wants to merge 1 commit into
Open
feat: scheduled reload of account definitions from storage#1024HarleyGilpin wants to merge 1 commit into
HarleyGilpin wants to merge 1 commit into
Conversation
Website password resets and imported accounts previously required a server restart because AccountDefinitions caches all account metadata (including password hashes) at startup and never refreshes. - Add AccountDefinitions.merge(): add/update only, mutates existing definitions and clans in place (preserves live Clan.members), skips online players and accounts with pending saves whose in-memory state may be newer than storage. - Add AccountDefinitionsReloader: loads names/clans on Dispatchers.IO, applies merge on the game thread; SupervisorJob so a failed reload does not cancel future ones. - Add AccountReload script: world timer driven by new setting storage.accounts.reloadMinutes (-1 default, disabled), reacts to ::reload settings. - Add ::reload accounts admin command for on-demand refresh. - FileStorage.names()/clans(): warn and skip corrupt save files instead of crashing, so a partially-written save cannot abort a reload. - Swap AccountDefinitions maps to ConcurrentHashMap as login threads read while the game thread merges. Known limitation: a password reset for a currently online player is overwritten at logout; it converges on the next reload after they log out.
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.
Summary
Website password resets and imported accounts previously required a server restart because AccountDefinitions caches all account metadata (including password hashes) at startup and never refreshes.
Known limitation: a password reset for a currently online player is overwritten at logout; it converges on the next reload after they log out.
Tests successful
Manual test