From 84ffbd61c97b2c8a5bf982aa1e4cd9aac75dec01 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Wed, 17 Jul 2024 14:56:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=92=BB=E7=9F=B3=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E6=9D=83=E9=87=8D=E8=AE=A1=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_phonelottery.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/worldsrv/action_phonelottery.go b/worldsrv/action_phonelottery.go index fd63987..6a3db88 100644 --- a/worldsrv/action_phonelottery.go +++ b/worldsrv/action_phonelottery.go @@ -313,13 +313,14 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da pack := &player_proto.SCDiamondLottery{} weight := 0 - for _, lotteryInfo := range config.Info { - if lotteryInfo.Type == 1 { - weight += int(lotteryInfo.Oddrate) - } - } + p.SnId = 102060301 var items []*Item for i := 1; i <= int(count); i++ { + for _, lotteryInfo := range config.Info { + if lotteryInfo.Type == 1 { + weight += int(lotteryInfo.Oddrate) + } + } random := rand.Intn(weight) + 1 value := 0 p.DiamondLotteryScore += 1 From 116d5217897b99c7c5ec6aba167d6151d87d99eb Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Wed, 17 Jul 2024 14:56:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=92=BB=E7=9F=B3=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E6=9D=83=E9=87=8D=E8=AE=A1=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_phonelottery.go | 1 - 1 file changed, 1 deletion(-) diff --git a/worldsrv/action_phonelottery.go b/worldsrv/action_phonelottery.go index 6a3db88..dab62fc 100644 --- a/worldsrv/action_phonelottery.go +++ b/worldsrv/action_phonelottery.go @@ -313,7 +313,6 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da pack := &player_proto.SCDiamondLottery{} weight := 0 - p.SnId = 102060301 var items []*Item for i := 1; i <= int(count); i++ { for _, lotteryInfo := range config.Info { From da8a0f1a4582aed8defd12f7ae4918c14fb33b2b Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Wed, 17 Jul 2024 15:17:15 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=92=BB=E7=9F=B3=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E6=9D=83=E9=87=8D=E8=AE=A1=E7=AE=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_phonelottery.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/worldsrv/action_phonelottery.go b/worldsrv/action_phonelottery.go index dab62fc..616967f 100644 --- a/worldsrv/action_phonelottery.go +++ b/worldsrv/action_phonelottery.go @@ -311,10 +311,9 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da } p.AddDiamond(-diamondNum, 0, common.GainWayDiamondLottery, "sys", "钻石抽奖") pack := &player_proto.SCDiamondLottery{} - - weight := 0 var items []*Item for i := 1; i <= int(count); i++ { + weight := 0 for _, lotteryInfo := range config.Info { if lotteryInfo.Type == 1 { weight += int(lotteryInfo.Oddrate)