赛季通行证兑换开关

This commit is contained in:
sk 2024-07-06 01:14:37 +08:00
parent 49bd65a05c
commit aabf20da2c
6 changed files with 24 additions and 4 deletions

View File

@ -287,7 +287,7 @@ const (
GainWaySign7Add = 91 // 累计签到进阶奖励获得
GainWayItemChange = 92 //背包内使用道具兑换话费
GainWayPetSkillLevelUp = 93 //宠物技能升级
GainWayPermitAward = 94 // 赛季通行证奖励
GainWayPermitAward = 94 // 赛季通行证等级奖励
GainWayItemPermitRank = 95 // 赛季通行证排行奖励
GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗
GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得

View File

@ -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 //金币

View File

@ -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{

View File

@ -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")

View File

@ -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")

View File

@ -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)