Commit Graph

3 Commits

Author SHA1 Message Date
Houmgaor
6ccbc24a4a fix(gacha): prevent infinite loop in getRandomEntries
Add guards for edge cases:
- Empty entries with rolls > 0
- Zero or negative rolls
- Zero total weight in non-box mode
- Box mode with more rolls than available entries

Previously these cases caused infinite loops or panics.
2026-02-05 08:51:09 +01:00
Houmgaor
a11ee6d9eb test(channelserver): add tests for guild member and gacha functions
Add comprehensive tests for pure logic functions:
- GuildMember.CanRecruit() and IsSubLeader() methods
- getRandomEntries() for gacha weighted/box selection

All targeted functions now have 100% coverage.
2026-02-05 08:48:05 +01:00
Houmgaor
7e9440d8cc test: expand channelserver coverage from 20% to 25%
Add tests for:
- Discord handlers (getPlayerSlice, getCharacterList)
- House handlers (boxToBytes, HouseData, Title structs)
- Mail struct tests
- Mercenary handlers (Partner, HunterNavi structs)
- Shop/Gacha handlers (writeShopItems, ShopItem, Gacha structs)
- Additional handler coverage for guild, tower, and simple handlers
- Stage handler tests for binary operations and enumeration
- Channel server tests for BroadcastMHF and session management
2026-02-02 16:02:01 +01:00