fix(validation): reject invalid character names in handlers - #579
Conversation
WalkthroughCharacter name validation logic was inverted in two packet handlers. In the game server handler, the flow now treats invalid names as the path to proceed with error emission. In the login server handler, creation now continues on invalid names and errors on valid names, reversing prior behavior. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant GS as GameServer
participant V as NameValidator
rect rgba(230,240,255,0.5)
note over C,GS: Previous flow (expected)
C->>GS: Check/Create with name
GS->>V: Validate(name)
V-->>GS: isValid = true/false
alt isValid == true
GS-->>C: Proceed (OK)
else isValid == false
GS-->>C: Error (name invalid)
end
end
rect rgba(255,235,230,0.5)
note over C,GS: Current flow (after inversion)
C->>GS: Check/Create with name
GS->>V: Validate(name)
V-->>GS: isValid = true/false
alt isValid == true
GS-->>C: Error (treated as invalid)
else isValid == false
GS-->>C: Proceed (treated as valid)
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)Maple2.Server.Game/PacketHandlers/CheckCharacterNameHandler.cs (1)
Maple2.Server.Login/PacketHandlers/CharacterManagementHandler.cs (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit