mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 01:53:19 +01:00
feat(guild): persist weekly bonus exceptional user count
The handler was a stub that discarded pkt.NumUsers. Now it looks up the player's guild and atomically accumulates the count via a new weekly_bonus_users column on the guilds table.
This commit is contained in:
@@ -125,7 +125,13 @@ func handleMsgMhfGuildHuntdata(s *Session, p mhfpacket.MHFPacket) {
|
||||
|
||||
func handleMsgMhfAddGuildWeeklyBonusExceptionalUser(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgMhfAddGuildWeeklyBonusExceptionalUser)
|
||||
// TODO: record pkt.NumUsers to DB
|
||||
// must use addition
|
||||
if s.server.guildRepo != nil {
|
||||
guild, err := s.server.guildRepo.GetByCharID(s.charID)
|
||||
if err == nil && guild != nil {
|
||||
if err := s.server.guildRepo.AddWeeklyBonusUsers(guild.ID, pkt.NumUsers); err != nil {
|
||||
s.logger.Error("Failed to add weekly bonus users", zap.Error(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user