fix(repo): detect silent save failures + partial daily mission stubs

SaveColumn and SaveMercenary now check RowsAffected() and return a
wrapped ErrCharacterNotFound when 0 rows are updated, preventing
silent data loss when a character ID is missing or mismatched.
AdjustInt already detects this via its RETURNING scan — no change.

Daily mission packet structs (Get/SetDailyMission*) now parse the
AckHandle instead of returning NOT IMPLEMENTED, letting handlers
send empty-list success ACKs and avoiding client softlocks.

Also adds tests for dashboard stats endpoint and for five guild
repo methods (SetAllianceRecruiting, RolloverDailyRP,
AddWeeklyBonusUsers, InsertKillLog, ClearTreasureHunt) that
had no coverage.
This commit is contained in:
Houmgaor
2026-03-21 01:49:28 +01:00
parent c43be33680
commit 106cf85eb7
8 changed files with 471 additions and 23 deletions

View File

@@ -147,11 +147,39 @@ func handleMsgMhfGetSenyuDailyCount(s *Session, p mhfpacket.MHFPacket) {
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}
func handleMsgMhfGetDailyMissionMaster(s *Session, p mhfpacket.MHFPacket) {} // stub: unimplemented
// handleMsgMhfGetDailyMissionMaster returns an empty daily mission master list.
// The full response format is not yet reverse-engineered; count=0 is safe.
func handleMsgMhfGetDailyMissionMaster(s *Session, p mhfpacket.MHFPacket) {
if p == nil {
return
}
pkt := p.(*mhfpacket.MsgMhfGetDailyMissionMaster)
bf := byteframe.NewByteFrame()
bf.WriteUint32(0) // entry count = 0
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}
func handleMsgMhfGetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {} // stub: unimplemented
// handleMsgMhfGetDailyMissionPersonal returns an empty personal daily mission progress list.
// The full response format is not yet reverse-engineered; count=0 is safe.
func handleMsgMhfGetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {
if p == nil {
return
}
pkt := p.(*mhfpacket.MsgMhfGetDailyMissionPersonal)
bf := byteframe.NewByteFrame()
bf.WriteUint32(0) // entry count = 0
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}
func handleMsgMhfSetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {} // stub: unimplemented
// handleMsgMhfSetDailyMissionPersonal acknowledges a personal daily mission progress write.
// The full request/response format is not yet reverse-engineered.
func handleMsgMhfSetDailyMissionPersonal(s *Session, p mhfpacket.MHFPacket) {
if p == nil {
return
}
pkt := p.(*mhfpacket.MsgMhfSetDailyMissionPersonal)
doAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
}
// Equip skin history buffer sizes per game version
const (