From 2dcf80f69415126710ecb40ed51a065074d2e8b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Wed, 31 Dec 2025 00:29:38 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(game):=20=E6=B7=BB=E5=8A=A0=E8=9B=8B?= =?UTF-8?q?=E7=B1=BB=E6=B8=B8=E6=88=8F=E9=81=93=E5=85=B7=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=92=8C=E9=97=AA=E5=85=89=E9=85=8D=E7=BD=AE=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在蛋类游戏玩法中添加道具数量检查,确保玩家拥有足够的道具 - 防止道具不足时的游戏错误 - 为闪光配置服务添加删除方法的保护,避免意外删除操作 ``` --- logic/controller/action_egg.go | 5 +++++ modules/config/service/shiny.go | 3 +++ 2 files changed, 8 insertions(+) diff --git a/logic/controller/action_egg.go b/logic/controller/action_egg.go index 71b9d550..8104ba80 100644 --- a/logic/controller/action_egg.go +++ b/logic/controller/action_egg.go @@ -20,6 +20,11 @@ func (h Controller) EggGamePlay(data1 *egg.C2S_EGG_GAME_PLAY, c *player.Player) case 3: data1.EggNum = 10 } + r := c.Service.Item.CheakItem(400501) + if r < data1.EggNum { + return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrSystemError) + + } result = &egg.S2C_EGG_GAME_PLAY{ListInfo: []data.ItemInfo{}} if grand.Meet(int(data1.EggNum), 100) { r := service.NewPetRewardService().GetEgg() diff --git a/modules/config/service/shiny.go b/modules/config/service/shiny.go index 85aef956..82c9fe38 100644 --- a/modules/config/service/shiny.go +++ b/modules/config/service/shiny.go @@ -35,6 +35,9 @@ func NewShinyService() *ShinyService { func (s *ShinyService) ModifyBefore(ctx context.Context, method string, param g.MapStrAny) (err error) { var t data.GlowFilter + if method == "Delete" { + return nil + } r := json.Unmarshal([]byte(gconv.String(param["color"])), &t) if r != nil { return r