From 2c3fad168094924fb909ef7f0629e7d4dd0a8508 Mon Sep 17 00:00:00 2001 From: hahwu <31872165+hahwu@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:18:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8C=AB=E7=8C=AB=E5=9B=9E=E7=A4=BC=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/game/activity_func.go | 12 ++++++++++++ src/server/game/gm_handler.go | 5 +++++ .../mod/cat_return_gift/cat_return_gift.go | 19 +++++++++---------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/server/game/activity_func.go b/src/server/game/activity_func.go index 4337ec07..6161b32a 100644 --- a/src/server/game/activity_func.go +++ b/src/server/game/activity_func.go @@ -99,6 +99,8 @@ func (p *Player) ActivityLogin() { } } + // 猫猫回礼登录 + p.CatReturnGiftLogin() } // 发送活动邮件 @@ -179,6 +181,16 @@ func (p *Player) ActivityZeroUpdate() { } } } +func (p *Player) CatReturnGiftLogin() { + activityInfo := p.GetActivityInfo(activity.ACT_TYPE_CAT_RETURN_GIFT) + var aid int + var id int + if activityInfo != nil { + id = activityInfo.Id + aid = activityInfo.AId + } + p.GetCatReturnGiftMod().Login(id, aid) +} // 猫猫回礼0点更新 func (p *Player) CatReturnGiftZeroUpdate() { diff --git a/src/server/game/gm_handler.go b/src/server/game/gm_handler.go index a9798d7d..56261e53 100644 --- a/src/server/game/gm_handler.go +++ b/src/server/game/gm_handler.go @@ -650,6 +650,11 @@ func ReqGmCommand_(player *Player, Command string) error { Id, _ := strconv.Atoi(arg[1]) player.PlayMod.getInviteMod().AddInvite(Id) player.PushClientRes(player.PlayMod.getInviteMod().NotifySuccess()) + case "resetCatReturnGift": + CatReturnGiftMod := player.GetCatReturnGiftMod() + CatReturnGiftMod.AId = 0 + player.CatReturnGiftLogin() + player.CatReturnGiftBackData() case "championshipResult": uid, _ := strconv.Atoi(arg[1]) FriendMgrSend(&MsgMod.Msg{ diff --git a/src/server/game/mod/cat_return_gift/cat_return_gift.go b/src/server/game/mod/cat_return_gift/cat_return_gift.go index 6decea24..8a7aa6be 100644 --- a/src/server/game/mod/cat_return_gift/cat_return_gift.go +++ b/src/server/game/mod/cat_return_gift/cat_return_gift.go @@ -10,26 +10,25 @@ type CatReturnGiftMod struct { func (c *CatReturnGiftMod) InitData() {} func (c *CatReturnGiftMod) ZeroUpdate(id, aid int) (int, int, int) { - score := c.Score - reward := c.Reward - oldId := c.Login(id, aid) - c.Score = 0 - c.Reward = 0 - return oldId, score, reward + return c.Login(id, aid) } -func (c *CatReturnGiftMod) Login(id, aid int) int { +func (c *CatReturnGiftMod) Login(id, aid int) (int, int, int) { oldId := c.Id if aid == 0 { c.AId = 0 - return oldId + return oldId, 0, 0 } if c.AId == aid { - return 0 + return 0, 0, 0 } + score := c.Score + reward := c.Reward c.AId = aid c.Id = id - return oldId + c.Score = 0 + c.Reward = 0 + return oldId, score, reward } func (c *CatReturnGiftMod) GetReward() int {