Repository navigation
hmp-core: Match returning players by any announced client ID - #13
Merged
Merged
Conversation
A client announces only the IDs it detected on that launch, so Steam or Discord can be missing from one session to the next. hmp-core keyed the account on the first ID in identityOrder and stored no others, so a session that arrived with only a hardware ID got a new, empty account while the player's characters stayed on the old one. Every announced ID is now linked to the account and later sessions match through any of them. An account first created from a lower-ranked ID is adopted when a higher-ranked one appears, unless that account already holds a different ID of that kind, which means a second player on a shared machine. IDs linked to another account are never moved; a warning names both accounts so staff can reconcile them. Verified providers still match on their own principal only.
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.
Problem
A server owner reported players randomly losing their characters. The client announces only the IDs it detected on that launch, so one session can carry Steam or Discord and the next only a hardware ID (with the nickname
Player). hmp-core keyed the account on the first ID inidentityOrderand stored no others, so the hardware-only session matched nothing and got a new, empty account. The old characters stayed on the original account.Change
identityOrder.Account X shares a <provider> ID with account Y; the accounts were not mergedso staff can find and reconcile accounts split before this fix.identity.registerare unaffected and still match on their own principal only.Removing
hardwareIdfromidentityOrderstops hardware IDs from being matched or linked, for owners who'd rather not tie accounts to a machine. The README and CHANGELOG cover the behaviour.Accounts already split by the old behaviour aren't merged automatically. With the player offline, staff can move the stray account's identities with
UPDATE hmp_account_identities SET account_id = <original> WHERE account_id = <stray>;.Testing
mainand pass here.npm testandnpm run typecheckpass in all 28 resources; hmp-corebuildandsmokepass.