fix(rpc): 修复日志输出格式并修正logic服务器注册逻辑
修复了rpc模块中日志输出时参数拼接错误的问题,同时修正了RegisterLogic函数中端口映射的逻辑错误。 feat(socket): 替换错误处理方式为panic 在ServerEvent.go中将网络启动失败的返回错误改为panic处理,提高错误可见性。 feat(fight): 增加战斗加载进度控制 在LoadPercent函数中增加对FightC非
This commit is contained in:
@@ -126,9 +126,17 @@ func (h Controller) TalkCate(data *item.TalkCateInboundInfo, c *player.Player) (
|
||||
// 2. 生成 1-10 的随机数:rand.Intn(10) → 0-9,+1 后范围变为 1-10
|
||||
randomNum := rand.Intn(10) + 1
|
||||
c.Service.Talk(func(t map[uint32]uint32) bool {
|
||||
if t == nil {
|
||||
t = make(map[uint32]uint32)
|
||||
|
||||
}
|
||||
_, ok := t[data.ID]
|
||||
if ok {
|
||||
t[data.ID] += 1
|
||||
if !ok {
|
||||
t[data.ID] = 0
|
||||
}
|
||||
|
||||
t[data.ID] += 1
|
||||
if t[data.ID] < uint32(te.CollectCnt) {
|
||||
result.OutList = append(result.OutList, item.CateInfo{ID: uint32(talkcacche[te.Name]), Count: uint32(randomNum)})
|
||||
c.ItemAdd(model.SingleItemInfo{ItemId: uint32(talkcacche[te.Name]), ItemCnt: uint32(randomNum)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user