Skip to content

fix(guild): check the password on kick when no security code is set - #1237

Merged
sven-n merged 2 commits into
masterfrom
claude/pr995-guild-security-code
Oct 18, 2026
Merged

sven-n merged 2 commits into
masterfrom
claude/pr995-guild-security-code

Conversation

@sven-n

@sven-n sven-n commented Oct 17, 2026

Copy link
Copy Markdown
Member

Split out of #995 (original commit by @OviedoMarcelo, authorship kept).

Problem

Account.SecurityCode defaults to "", not null, so the check in GuildKickPlayerAction

if (player.Account!.SecurityCode != null && player.Account.SecurityCode != securityCode)

always compared the input against an empty string. No input can match that, and there's no in-game or web flow to set a security code. As a result, a guild master could never kick a member, and also couldn't disband the guild, because disbanding is a self-kick.

Change

  • The check now works like DeleteCharacterAction: if no security code is set, the input is checked against the account password (BCrypt). Otherwise it's checked against the security code.
  • The debug log no longer contains the entered or the stored security code.
  • New tests in GuildActionTest:
    • a kick with the password succeeds when no security code is set
    • a kick with a wrong password is rejected
    • when a security code is set, the password isn't accepted, but the code is

Testing

  • dotnet test tests/MUnique.OpenMU.Tests --filter GuildActionTest: 32/32 passed.
  • With the old GuildKickPlayerAction, GuildKickWithPasswordWhenNoSecurityCodeIsSetAsync fails, as expected.

Generated by Claude Code

OviedoMarcelo and others added 2 commits October 17, 2026 22:25
Account.SecurityCode defaults to "" (not null), so 'SecurityCode != null' was always true and
the check always ran against an empty string that no player input could match - there's no
in-game or web flow to set a security code either. Now mirrors DeleteCharacterAction's
fallback: with no security code configured, the account password is checked instead.

The entered and the stored code are no longer written to the debug log.

Split out of #995.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sven-n
sven-n merged commit 33ccdb7 into master Oct 18, 2026
2 checks passed
@sven-n
sven-n deleted the claude/pr995-guild-security-code branch October 18, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants