diff --git a/worldsrv/action_player.go b/worldsrv/action_player.go index 4c76e04..0bf4180 100644 --- a/worldsrv/action_player.go +++ b/worldsrv/action_player.go @@ -3181,7 +3181,9 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in } } else { pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess - p.GuideData[msg.GuideId] = int32(msg.Param[0]) + if len(msg.Param) > 0 { + p.GuideData[msg.GuideId] = int32(msg.Param[0]) + } send() return nil } diff --git a/worldsrv/lotterymgr.go b/worldsrv/lotterymgr.go index 3833728..4cad494 100644 --- a/worldsrv/lotterymgr.go +++ b/worldsrv/lotterymgr.go @@ -47,6 +47,22 @@ func init() { } } }, + OnMiniTimerFunc: func() { + for i := range LotteryMgrInst.Data { + for k := range LotteryMgrInst.Data[i] { + d := LotteryMgrInst.Data[i][k] + if d == nil { + continue + } + lc := PlatformMgrSingleton.GetLotteryConfig(d.Platform, d.CId) + if lc == nil || lc.GetOn() != common.On { + continue + } + // 随机给机器人发放抽奖码 + d.sendRobotCode(1, 5) + } + } + }, }) } @@ -477,8 +493,6 @@ func (l *LotteryMgr) Update() { if lc == nil || lc.GetOn() != common.On { continue } - // 随机给机器人发放抽奖码 - d.sendRobotCode(1, 5) // 活动结束,开始抽奖 d.Done() // 开始发奖