引导奖励统计系统赠送
This commit is contained in:
parent
fd2e1b3cad
commit
0cc4009858
|
@ -322,6 +322,7 @@ const (
|
||||||
GainWayPermitReset = 114 //赛季通行证积分重置
|
GainWayPermitReset = 114 //赛季通行证积分重置
|
||||||
GainWayClientUpgrade = 115 //客户端升级奖励
|
GainWayClientUpgrade = 115 //客户端升级奖励
|
||||||
GainWayLottery = 116 //开奖码抽奖
|
GainWayLottery = 116 //开奖码抽奖
|
||||||
|
GainWayGuide2 = 117 // 竞技馆引导奖励
|
||||||
)
|
)
|
||||||
|
|
||||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||||
|
@ -881,3 +882,14 @@ const (
|
||||||
const (
|
const (
|
||||||
NoticeTypeCustomAward = 1 + iota // 房卡场获奖通知
|
NoticeTypeCustomAward = 1 + iota // 房卡场获奖通知
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
GuideIdNewPlayer = 1 // 新手引导
|
||||||
|
GuideIdCustom = 2 // 竞技馆引导
|
||||||
|
)
|
||||||
|
|
||||||
|
// 引导奖励账变类型
|
||||||
|
var GuideIdToGainWay = map[int]int{
|
||||||
|
GuideIdNewPlayer: GainWayGuide,
|
||||||
|
GuideIdCustom: GainWayGuide2,
|
||||||
|
}
|
||||||
|
|
|
@ -111,6 +111,7 @@ const (
|
||||||
SystemFreeGive_CollectBox // 开启卡片礼盒奖励
|
SystemFreeGive_CollectBox // 开启卡片礼盒奖励
|
||||||
SystemFreeGive_CollectBoxSwap // 卡片礼盒兑换奖励
|
SystemFreeGive_CollectBoxSwap // 卡片礼盒兑换奖励
|
||||||
SystemFreeGive_ClientUpgrade // 客户端升级奖励
|
SystemFreeGive_ClientUpgrade // 客户端升级奖励
|
||||||
|
SystemFreeGive_Guide // 新手引导奖励
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
SystemFreeGive_CoinType_Coin int32 = iota //金币
|
SystemFreeGive_CoinType_Coin int32 = iota //金币
|
||||||
|
|
|
@ -3112,22 +3112,24 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
|
||||||
}
|
}
|
||||||
// 日志
|
// 日志
|
||||||
if pack.OpRetCode == player_proto.OpResultCode_OPRC_Sucess {
|
if pack.OpRetCode == player_proto.OpResultCode_OPRC_Sucess {
|
||||||
switch msg.GetTp() {
|
if msg.GetGuideId() == 0 || msg.GetGuideId() == common.GuideIdNewPlayer {
|
||||||
case common.AttributeGuideStep, common.AttributeGuideSkip:
|
switch msg.GetTp() {
|
||||||
d := model.CustomData{
|
case common.AttributeGuideStep, common.AttributeGuideSkip:
|
||||||
Event: "guide",
|
d := model.CustomData{
|
||||||
Platform: p.Platform,
|
Event: "guide",
|
||||||
GuideTp: msg.GetTp(),
|
Platform: p.Platform,
|
||||||
N: int64(stepId),
|
GuideTp: msg.GetTp(),
|
||||||
|
N: int64(stepId),
|
||||||
|
}
|
||||||
|
b, _ := json.Marshal(d)
|
||||||
|
mq.Write(&model.ClientLogMysql{
|
||||||
|
Data: string(b),
|
||||||
|
Platform: p.Platform,
|
||||||
|
Snid: p.SnId,
|
||||||
|
Ts: time.Now().Unix(),
|
||||||
|
CreateTs: p.CreateTime.Unix(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
b, _ := json.Marshal(d)
|
|
||||||
mq.Write(&model.ClientLogMysql{
|
|
||||||
Data: string(b),
|
|
||||||
Platform: p.Platform,
|
|
||||||
Snid: p.SnId,
|
|
||||||
Ts: time.Now().Unix(),
|
|
||||||
CreateTs: p.CreateTime.Unix(),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3150,7 +3152,7 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
|
||||||
send()
|
send()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if msg.GuideId == 1 {
|
if msg.GuideId == common.GuideIdNewPlayer {
|
||||||
if p.GuideStep < 0 {
|
if p.GuideStep < 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -3209,12 +3211,26 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
|
||||||
ItemId: award.ItemId,
|
ItemId: award.ItemId,
|
||||||
ItemNum: award.ItemNum,
|
ItemNum: award.ItemNum,
|
||||||
})
|
})
|
||||||
|
// 系统赠送
|
||||||
|
if award.GetItemId() == common.ItemIDCoin {
|
||||||
|
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_Guide, 0, award.GetItemNum()))
|
||||||
|
}
|
||||||
|
if award.GetItemId() == common.ItemIDDiamond {
|
||||||
|
mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_Guide, 1, award.GetItemNum()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gainWay := common.GainWayGuide
|
||||||
|
gain := common.GuideIdToGainWay[int(msg.GetGuideId())]
|
||||||
|
if gain > 0 {
|
||||||
|
gainWay = gain
|
||||||
|
}
|
||||||
|
|
||||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||||
Platform: p.Platform,
|
Platform: p.Platform,
|
||||||
SnId: p.SnId,
|
SnId: p.SnId,
|
||||||
Change: items,
|
Change: items,
|
||||||
GainWay: common.GainWayGuide,
|
GainWay: int32(gainWay),
|
||||||
Operator: "system",
|
Operator: "system",
|
||||||
Remark: "完成引导奖励",
|
Remark: "完成引导奖励",
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue