mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 01:53:19 +01:00
refactor(channelserver): migrate remaining character queries to CharacterRepository
Add 18 new typed methods to CharacterRepository (ReadTime, SaveTime, SaveInt, SaveBool, SaveString, ReadBool, ReadString, LoadColumnWithDefault, SetDeleted, UpdateDailyCafe, ResetDailyQuests, ReadEtcPoints, ResetCafeTime, UpdateGuildPostChecked, ReadGuildPostChecked, SaveMercenary, UpdateGCPAndPact, FindByRastaID) and migrate ~56 inline SQL queries across 13 handler files. Pure refactor — zero behavior change. Each handler produces identical SQL with identical parameters. Cross-table JOINs and bulk CharacterSaveData operations are intentionally left out of scope.
This commit is contained in:
@@ -333,7 +333,9 @@ func handleMsgMhfStampcardStamp(s *Session, p mhfpacket.MHFPacket) {
|
||||
}
|
||||
var stamps, rewardTier, rewardUnk uint16
|
||||
reward := mhfitem.MHFItemStack{Item: mhfitem.MHFItem{}}
|
||||
if err := s.server.db.QueryRow(`UPDATE characters SET stampcard = stampcard + $1 WHERE id = $2 RETURNING stampcard`, pkt.Stamps, s.charID).Scan(&stamps); err != nil {
|
||||
stamps32, err := s.server.charRepo.AdjustInt(s.charID, "stampcard", int(pkt.Stamps))
|
||||
stamps = uint16(stamps32)
|
||||
if err != nil {
|
||||
s.logger.Error("Failed to update stampcard", zap.Error(err))
|
||||
doAckBufFail(s, pkt.AckHandle, nil)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user