From e500cc3f1372807ff606a39dfe17a9b987e623a4 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 16 Apr 2024 18:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=BC=80=E5=90=AF=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gameparam.go | 1 + public | 2 +- worldsrv/welfmgr.go | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/model/gameparam.go b/model/gameparam.go index b39436d..57737c2 100644 --- a/model/gameparam.go +++ b/model/gameparam.go @@ -85,6 +85,7 @@ type GameParam struct { WinCoinUpdateTime int // 收入榜每日几点更新 RankWinCoinMaxNum int // 收入榜最大人数 RankInviteMaxNum int32 // 邀请排行榜最大人数 + TestActSwitch bool // 开启所有活动开关 } var GameParamPath = "../data/gameparam.json" diff --git a/public b/public index bf19adf..6390826 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit bf19adf1d5cf74a3ec3d180730404492658dd6d7 +Subproject commit 6390826abfd45829c1122c39b9f0455b1b82a940 diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index 9cc7477..b385b2a 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -157,9 +157,15 @@ func (this *WelfareMgr) GetReliefFund(p *Player, isVideo bool) { } func (this *WelfareMgr) UpdateSign7(cfg *webapi_proto.Welfare7SignDateList) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } this.getConfig(cfg.Platform).Welfare7SignDateList = cfg } func (this *WelfareMgr) UpdateTurnplate(cfg *webapi_proto.WelfareTurnplateDateList) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } s := int32(0) info := this.getConfig(cfg.Platform) if info.WelfareTurnplateDateList != nil { @@ -174,6 +180,9 @@ func (this *WelfareMgr) UpdateTurnplate(cfg *webapi_proto.WelfareTurnplateDateLi } func (this *WelfareMgr) UpdateBlindBox(cfg *webapi_proto.WelfareBlindBoxDataList) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } s := int32(0) info := this.getConfig(cfg.Platform) if info.WelfareBlindBoxDataList != nil { @@ -190,6 +199,9 @@ func (this *WelfareMgr) UpdateBlindBox(cfg *webapi_proto.WelfareBlindBoxDataList } func (this *WelfareMgr) UpdateFirstPay(cfg *webapi_proto.WelfareFirstPayDataList) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } s := int32(0) info := this.getConfig(cfg.Platform) if info.WelfareFirstPayDataList != nil { @@ -206,6 +218,9 @@ func (this *WelfareMgr) UpdateFirstPay(cfg *webapi_proto.WelfareFirstPayDataList } func (this *WelfareMgr) UpdateContinuousPay(cfg *webapi_proto.WelfareContinuousPayDataList) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } s := int32(0) info := this.getConfig(cfg.Platform) if info.WelfareContinuousPayDataList != nil { @@ -222,6 +237,9 @@ func (this *WelfareMgr) UpdateContinuousPay(cfg *webapi_proto.WelfareContinuousP } func (this *WelfareMgr) UpdatePhoneLotteryStatus(cfg *webapi_proto.WelfarePhoneLotteryStatus) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } s := int32(0) info := this.getConfig(cfg.Platform) if info.WelfarePhoneLotteryStatus != nil { @@ -243,6 +261,9 @@ func (this *WelfareMgr) GetPhoneLotteryStatus(platform string) int32 { } func (this *WelfareMgr) UpdateCollectConfig(cfg *webapi_proto.WelfareCollectConfig) { + if model.GameParamData.TestActSwitch { + cfg.Switch = WelfareOpen + } s := int32(0) info := this.getConfig(cfg.Platform) if info.WelfareCollectConfig != nil { @@ -813,6 +834,12 @@ func (this *WelfareMgr) WelfareSwitch(p *Player, platform string, op int) { pack.WelfareSwitch = append(pack.WelfareSwitch, WelfareClose) } + if model.GameParamData.TestActSwitch { + for k := range pack.WelfareSwitch { + pack.WelfareSwitch[k] = WelfareOpen + } + } + if p != nil { logger.Logger.Tracef("WelfareSwitch snid: %v pack: %v", p.SnId, pack) p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_SWELFAREINFO), pack)