fix: 修复空提交问题

This commit is contained in:
1
2025-11-23 23:38:03 +00:00
parent aa4574b5eb
commit 240c349b8a
45 changed files with 113 additions and 4438 deletions

View File

@@ -3,12 +3,12 @@ package controller
import (
"blazing/common/data/xmlres"
"blazing/common/socket/errorcode"
"math/rand"
"time"
"blazing/logic/service/item"
"blazing/logic/service/player"
"blazing/modules/blazing/model"
"github.com/gogf/gf/v2/util/grand"
)
func (h Controller) UserItemList(data *item.ItemListInboundInfo, c *player.Player) (result *item.ItemListOutboundInfo, err errorcode.ErrorCode) {
@@ -113,10 +113,7 @@ func (h Controller) TalkCate(data *item.TalkCateInboundInfo, c *player.Player) (
}
}
rand.Seed(time.Now().UnixNano()) // UnixNano 精度更高,避免短时间内种子重复
// 2. 生成 1-10 的随机数rand.Intn(10) → 0-9+1 后范围变为 1-10
randomNum := rand.Intn(10) + 1
randomNum := grand.Intn(10) + 1
c.Service.Talk.Exec(func(t map[uint32]uint32) bool {
if t == nil {
t = make(map[uint32]uint32)