From d17cd28c94c97a80cc2aa5de467017cc4caf4194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Tue, 10 Feb 2026 11:30:41 +0800 Subject: [PATCH] 1 --- logic/controller/action_扭蛋.go | 2 +- logic/service/egg/egg.go | 2 +- modules/config/service/item.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/logic/controller/action_扭蛋.go b/logic/controller/action_扭蛋.go index 5561f45b..191f5987 100644 --- a/logic/controller/action_扭蛋.go +++ b/logic/controller/action_扭蛋.go @@ -27,7 +27,7 @@ func (h Controller) EggGamePlay(data1 *egg.C2S_EGG_GAME_PLAY, c *player.Player) if r < 0 { return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrGachaTicketsInsufficient) } - if data1.EggNum > uint32(r) { + if data1.EggNum > r { return nil, errorcode.ErrorCode(errorcode.ErrorCodes.ErrGachaTicketsInsufficient) } diff --git a/logic/service/egg/egg.go b/logic/service/egg/egg.go index 2e802e64..0fcf2f63 100644 --- a/logic/service/egg/egg.go +++ b/logic/service/egg/egg.go @@ -9,7 +9,7 @@ import ( // 对应原 C# 的 C2S_EGG_GAME_PLAY type C2S_EGG_GAME_PLAY struct { Head common.TomeeHeader `cmd:"3201" struc:"skip"` - EggNum uint32 `struc:"uint32"` // 抽蛋次数标识:1 = 1次 2 = 5次 3 = 10次 + EggNum int32 `struc:"uint32"` // 抽蛋次数标识:1 = 1次 2 = 5次 3 = 10次 // 注:Go 中 uint 是平台相关类型(32/64位),游戏开发中推荐用 uint32 明确匹配 C# 的 uint } diff --git a/modules/config/service/item.go b/modules/config/service/item.go index 940e53a3..4d4fdfab 100644 --- a/modules/config/service/item.go +++ b/modules/config/service/item.go @@ -34,7 +34,7 @@ func (s *ItemService) GetItemCount(id uint32) data.ItemInfo { } return res } -func (s *ItemService) GetEgg(count uint32) []data.ItemInfo { +func (s *ItemService) GetEgg(count int32) []data.ItemInfo { var item []model.ItemGift cool.DBM(s.Model).Where("is_egg", 1).Where("is_enabled", 1).Cache(gdb.CacheOption{ // Duration: time.Hour,