feat(channelserver): implement monthly guild item claim tracking

Players could never claim monthly guild items because the handler
always returned 0x01 (claimed). Now tracks per-character per-type
(standard/HLC/EXC) claim timestamps in the stamps table, comparing
against the current month boundary to determine claim eligibility.

Adds MonthStart() to gametime, extends StampRepo with
GetMonthlyClaimed/SetMonthlyClaimed, and includes schema migration
31-monthly-items.sql.
This commit is contained in:
Houmgaor
2026-02-22 16:46:57 +01:00
parent 302453ce8e
commit 2acbb5d03a
11 changed files with 187 additions and 4 deletions

View File

@@ -31,6 +31,12 @@ func WeekNext() time.Time {
return WeekStart().Add(time.Hour * 24 * 7)
}
// MonthStart returns the first day of the current month at midnight in JST.
func MonthStart() time.Time {
midnight := Midnight()
return time.Date(midnight.Year(), midnight.Month(), 1, 0, 0, 0, 0, midnight.Location())
}
// GameAbsolute returns the current position within the 5760-second (96-minute)
// in-game day/night cycle, offset by 2160 seconds.
func GameAbsolute() uint32 {