On Sunday, Weekday() returns 0, causing (0-1)*-24 = +24 hours which
jumped forward to next Monday instead of back to last Monday. This
affected any weekly reset logic running on Sundays.
The personal poogie (goocoo) system was completely broken because the
code referenced the old "gook" table/column names while the database
schema had been renamed to "goocoo". All read/write queries failed
silently, resulting in no poogie data being saved for any player.
Backports from main: renamed Gook struct to Goocoo with correct
structured fields (22 int16 + 2 uint32), updated all SQL queries to
use goocoo table/columns, and added comprehensive packet parsing tests.
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.
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.
Cherry-picked from main (8c219be) with conflict resolution.
Pre-G10 clients don't have the GR field in the applicant list,
so only write it when RealClientMode >= G10.
Also optimizes two consecutive uint16(0) writes to single uint32(0).
Cherry-picked from main (5028355) with conflict resolution.
Changes condition from && to || to properly handle the case where
a player has a guild but also has a prevGuildID set.
Cherry-picked from main (c539905).
Prevents infinite loop when stage binary data never arrives by
limiting to 10 iterations (10 seconds) before returning empty response.
Cherry-picked from main (7459ded) with conflict resolution.
The original fix changed the poogie outfit unlock from incorrect
math.Pow calculation to direct value assignment.
Also removes unused math import (531b3d2).
Add comprehensive tests documenting current behavior before applying
fixes from main branch. Tests cover:
- Cafe item PointCost parsing (uint32 vs uint16 for different client modes)
- Guild poogie outfit unlock calculation bug (math.Pow issue)
- Guild manage right nil pointer condition (&& vs || logic)
- InfoGuild applicant GR field size for <G10 clients
- Stage binary wait infinite loop risk (no timeout)
- Entrance server hardcoded clan member limit
- Renamed config key from GuildMealDuration to ClanMealDuration
- Changed unit from minutes to seconds (matching upstream convention)
- Updated handler to use seconds-based calculation
- Updated documentation and examples
This fixes the bug where clan meals were not being shared between
guild members when using a config.json with the upstream naming.
Distributions now read items from the distribution_items table instead of
requiring a pre-built binary data blob. This enables creating distributions
via simple SQL inserts rather than generating binary data manually.
Changes:
- Add getDistributionItems() to fetch items from distribution_items table
- Update handleMsgMhfApplyDistItem to build response from table data
- Move server-side rewards (points, RP) to handleMsgMhfAcquireDistItem
- Support G8+ item format (13 bytes per item)