modify 累消活动开关
This commit is contained in:
parent
07d8de615e
commit
ee9878957a
|
@ -25,7 +25,7 @@ const (
|
||||||
OpPhoneLottery = 5
|
OpPhoneLottery = 5
|
||||||
OpCollect = 6
|
OpCollect = 6
|
||||||
OpNian = 7
|
OpNian = 7
|
||||||
OpRedPacket = 8 // 红包活动
|
OpConsume = 8 // 累计消耗活动
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -44,13 +44,14 @@ type BackendPermitJoin struct {
|
||||||
|
|
||||||
// BackendPermitTask 通行证任务完成记录
|
// BackendPermitTask 通行证任务完成记录
|
||||||
type BackendPermitTask struct {
|
type BackendPermitTask struct {
|
||||||
Platform string // 平台
|
Platform string // 平台
|
||||||
StartTs int64 // 活动开始时间
|
StartTs int64 // 活动开始时间
|
||||||
SnId int32 // 玩家id
|
SnId int32 // 玩家id
|
||||||
TaskId int32 // 任务id
|
TaskId int32 // 任务id
|
||||||
TaskName string // 任务名称
|
TaskName string // 任务名称
|
||||||
ActivityType int32 // 活动类型
|
ActivityType int32 // 活动类型
|
||||||
TaskType int32 // 任务类型
|
TaskType int32 // 任务类型
|
||||||
Gain []AwardItem // 任务获得奖励
|
Gain []AwardItem // 任务获得奖励
|
||||||
Ts int64 // 时间戳
|
Ts int64 // 时间戳
|
||||||
|
RemainDiamond int64 // 剩余钻石
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,7 @@ func CSTaskReward(s *netlib.Session, packetId int, data interface{}, sid int64)
|
||||||
taskLog.TaskName = data.GetDes()
|
taskLog.TaskName = data.GetDes()
|
||||||
taskLog.ActivityType = data.GetActivityType()
|
taskLog.ActivityType = data.GetActivityType()
|
||||||
taskLog.TaskType = data.GetTaskType()
|
taskLog.TaskType = data.GetTaskType()
|
||||||
|
taskLog.RemainDiamond = p.Diamond
|
||||||
}
|
}
|
||||||
mq.Write(taskLog)
|
mq.Write(taskLog)
|
||||||
ret.OpCode = taskproto.OpResultCode_OPRC_Success
|
ret.OpCode = taskproto.OpResultCode_OPRC_Success
|
||||||
|
|
|
@ -1017,6 +1017,13 @@ func (this *WelfareMgr) WelfareSwitch(p *Player, platform string, op int) {
|
||||||
} else {
|
} else {
|
||||||
pack.WelfareSwitch = append(pack.WelfareSwitch, model.WelfareClose)
|
pack.WelfareSwitch = append(pack.WelfareSwitch, model.WelfareClose)
|
||||||
}
|
}
|
||||||
|
// 累消活动
|
||||||
|
consumeConfig := info.ConsumeConfig
|
||||||
|
if consumeConfig != nil {
|
||||||
|
pack.WelfareSwitch = append(pack.WelfareSwitch, consumeConfig.On) //累消活动开关
|
||||||
|
} else {
|
||||||
|
pack.WelfareSwitch = append(pack.WelfareSwitch, model.WelfareClose)
|
||||||
|
}
|
||||||
|
|
||||||
if model.GameParamData.TestActSwitch {
|
if model.GameParamData.TestActSwitch {
|
||||||
for k := range pack.WelfareSwitch {
|
for k := range pack.WelfareSwitch {
|
||||||
|
@ -2455,7 +2462,20 @@ func (this *WelfareMgr) GetRedPacket(p *Player, id int64) *welfare.SCRedPacketDr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *WelfareMgr) UpdateConsumeConfig(conf *webapi_proto.ConsumeConfig) {
|
func (this *WelfareMgr) UpdateConsumeConfig(conf *webapi_proto.ConsumeConfig) {
|
||||||
|
if model.GameParamData.TestActSwitch {
|
||||||
|
conf.On = model.WelfareOpen
|
||||||
|
}
|
||||||
|
s := int32(0)
|
||||||
|
info := this.GetConfig(conf.Platform)
|
||||||
|
if info.ConsumeConfig != nil {
|
||||||
|
s = info.ConsumeConfig.On
|
||||||
|
}
|
||||||
this.GetConfig(conf.Platform).ConsumeConfig = conf
|
this.GetConfig(conf.Platform).ConsumeConfig = conf
|
||||||
|
//更新活动时间
|
||||||
|
// 打开关闭要广播给客户端
|
||||||
|
if s != 0 && s != conf.On {
|
||||||
|
this.WelfareSwitch(nil, conf.Platform, model.OpConsume)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *WelfareMgr) Update() {
|
func (this *WelfareMgr) Update() {
|
||||||
|
|
Loading…
Reference in New Issue