From f0e18b16d08b77d196736596b92e6832f1cd6a73 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 13 Nov 2024 09:22:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_friend.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/worldsrv/action_friend.go b/worldsrv/action_friend.go index c6fa651..e627340 100644 --- a/worldsrv/action_friend.go +++ b/worldsrv/action_friend.go @@ -15,7 +15,6 @@ import ( "mongo.games.com/game/model" "mongo.games.com/game/proto" "mongo.games.com/game/protocol/friend" - "mongo.games.com/game/protocol/welfare" "mongo.games.com/game/srvdata" ) @@ -603,29 +602,6 @@ func (this *CSFuzzyQueryPlayerHandler) Process(s *netlib.Session, packetid int, return nil } - pack2 := &welfare.NotifyLotteryAward{ - Info: &welfare.LotteryInfo{ - Id: 45, - StartTs: time.Now().Unix(), - Index: int32(5), - Award: []*welfare.PropInfo{ - { - ItemId: 100001, - ItemNum: 100, - }, - }, - SnId: p.SnId, - Name: p.Name, - RoleId: p.Roles.ModId, - Price: 1000, - WinCode: "123456", - }, - } - - // 广播中奖结果 - PlayerMgrSington.BroadcastMessageToPlatform(p.Platform, int(welfare.SPacketID_PACKET_NotifyLotteryAward), pack2) - logger.Logger.Tracef("广播中奖信息: %v", pack2) - queryContent := msg.GetQueryContent() if utf8.RuneCountInString(queryContent) < 3 { return nil From 28b6cb6a85ba589a6f96d4d89d37a10c1827927e Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Wed, 13 Nov 2024 11:17:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8A=BD=E5=A5=96=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=8F=91=E5=A5=96=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_player.go | 4 +++- worldsrv/lotterymgr.go | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) 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() // 开始发奖 From 0585fe236d41b027ca8d9162cd5597be89bb776d Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sun, 17 Nov 2024 15:20:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=87=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/player.go | 1 - 1 file changed, 1 deletion(-) diff --git a/worldsrv/player.go b/worldsrv/player.go index eb8db7c..7a46470 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -1124,7 +1124,6 @@ func (this *Player) IsOnLine() bool { func (this *Player) SetOnline() { this.state = PlayerStateOnline - this.UpdateLastLogoutTime() } func (this *Player) IsOffline() bool {