fix: 修复空提交问题
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user