From aabf20da2cc38fc2d208a400310fd80326511a09 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sat, 6 Jul 2024 01:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E9=80=9A=E8=A1=8C=E8=AF=81?= =?UTF-8?q?=E5=85=91=E6=8D=A2=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/constant.go | 2 +- model/player.go | 3 ++- worldsrv/action_welfare.go | 6 ++++++ worldsrv/etcd.go | 2 +- worldsrv/permitmgr.go | 2 +- worldsrv/player.go | 13 +++++++++++++ 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/common/constant.go b/common/constant.go index 6a5e340..3a517f0 100644 --- a/common/constant.go +++ b/common/constant.go @@ -287,7 +287,7 @@ const ( GainWaySign7Add = 91 // 累计签到进阶奖励获得 GainWayItemChange = 92 //背包内使用道具兑换话费 GainWayPetSkillLevelUp = 93 //宠物技能升级 - GainWayPermitAward = 94 // 赛季通行证奖励 + GainWayPermitAward = 94 // 赛季通行证等级奖励 GainWayItemPermitRank = 95 // 赛季通行证排行奖励 GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗 GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得 diff --git a/model/player.go b/model/player.go index 00339ae..50a84d8 100644 --- a/model/player.go +++ b/model/player.go @@ -111,7 +111,8 @@ const ( SystemFreeGive_GiveType_TaskEveryDay // 每日任务 SystemFreeGive_GiveType_TaskWeekActive // 周活跃奖励 SystemFreeGive_GiveType_PermitAward // 赛季通行证奖励 - SystemFreeGive_GiveType_TaskPermit // 赛季通行证任务 + SystemFreeGive_GiveType_TaskPermit // 赛季通行证任务奖励 + SystemFreeGive_GiveType_TaskPermitRank // 赛季通行证排名奖励 ) const ( SystemFreeGive_CoinType_Coin int32 = iota //金币 diff --git a/worldsrv/action_welfare.go b/worldsrv/action_welfare.go index 20e532d..a4a4645 100644 --- a/worldsrv/action_welfare.go +++ b/worldsrv/action_welfare.go @@ -875,6 +875,9 @@ func GetPermitCanExchange(p *Player, id int32) (bool, int) { for _, v := range channelConfig.GetExchangeConfig() { if v.GetId() == id { + if !v.GetIsShow() { + return false, 3 + } // 等级 if level < v.GetLevel() { return false, 1 @@ -924,6 +927,9 @@ func CSPermitExchangeList(s *netlib.Session, packetid int, data interface{}, sid pack := &welfare.SCPermitExchangeList{} for _, v := range channelConfig.GetExchangeConfig() { + if !v.GetIsShow() { + continue + } var gain, cost []*welfare.PropInfo for _, vv := range v.GetGain() { gain = append(gain, &welfare.PropInfo{ diff --git a/worldsrv/etcd.go b/worldsrv/etcd.go index d1c267a..ffe3208 100644 --- a/worldsrv/etcd.go +++ b/worldsrv/etcd.go @@ -252,7 +252,7 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e LogChannelSingleton.WriteLog(&model.BackendPermitCycle{ Platform: config.Platform, StartTs: st.StartTs, - EndTs: st.EndTs, + EndTs: st.EndTs - 1, }) } })).StartByExecutor("permit_start_ts") diff --git a/worldsrv/permitmgr.go b/worldsrv/permitmgr.go index e72db39..9f0efed 100644 --- a/worldsrv/permitmgr.go +++ b/worldsrv/permitmgr.go @@ -171,7 +171,7 @@ func (r *PermitMgr) OnDayTimer() { LogChannelSingleton.WriteLog(&model.BackendPermitCycle{ Platform: platform, StartTs: se.StartTs, - EndTs: se.EndTs, + EndTs: se.EndTs - 1, }) } })).StartByExecutor("permit_start_ts") diff --git a/worldsrv/player.go b/worldsrv/player.go index b7ab0e8..6c71e9d 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -1133,6 +1133,19 @@ func (this *Player) GetMessageAttach(id string) { ItemNum: int64(msg.Params[i+1]), // 数量 ObtainTime: time.Now().Unix(), }) + if gainWay == common.GainWayItemPermitRank { + tp := int32(-1) + if msg.Params[i] == common.ItemIDCoin { + tp = model.SystemFreeGive_CoinType_Coin + } else if msg.Params[i] == common.ItemIDDiamond { + tp = model.SystemFreeGive_CoinType_Diamond + } + if tp != -1 { + LogChannelSingleton.WriteMQData( + model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, + model.SystemFreeGive_GiveType_TaskPermitRank, tp, int64(msg.Params[i+1]))) + } + } } if _, code, _ := BagMgrSingleton.AddItems(this, items, 0, gainWay, "mail", remark, 0, 0, false); code != bag.OpResultCode_OPRC_Sucess { // 领取失败 logger.Logger.Errorf("CSPlayerSettingHandler AddItems err", code)