客户端升级奖励记录系统赠送

This commit is contained in:
sk 2024-10-14 11:21:02 +08:00
parent c65bf7958f
commit d1e380d9bb
7 changed files with 44 additions and 11 deletions

View File

@ -320,6 +320,7 @@ const (
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销
GainWayPermitReset = 114 //赛季通行证积分重置
GainWayClientUpgrade = 115 //客户端升级奖励
)
// 后台选择 金币变化类型 的充值 类型id号起始

View File

@ -39,6 +39,7 @@ const (
MSGTYPE_RANK_REWARD //排行榜奖励
MSGTYPE_ITEM_CHANGE //背包使用兑换
MSGTYPE_RANK_PermitReward // 通行证排行奖励
MSGTYPE_ClientUpgrade // 客户端升级
)
const (

View File

@ -108,10 +108,12 @@ const (
SystemFreeGive_PhoneLotterySwap // 手机积分兑换奖励
SystemFreeGive_CollectBox // 开启卡片礼盒奖励
SystemFreeGive_CollectBoxSwap // 卡片礼盒兑换奖励
SystemFreeGive_ClientUpgrade // 客户端升级奖励
)
const (
SystemFreeGive_CoinType_Coin int32 = iota //金币
SystemFreeGive_CoinType_Diamond //钻石
SystemFreeGive_CoinType_Tiem // 道具
)
type PlayerGameCtrlData struct {

View File

@ -20,6 +20,20 @@ func GenerateLogin(o *PlayerLoginEvent) *mq.RabbitMQData {
return NewRabbitMQData(mq.BackLogin, o)
}
type SystemFreeGive struct {
Snid int32 `json:"snid,omitempty"`
Channel string `json:"Channel,omitempty"`
AppChannel string `json:"AppChannel,omitempty"`
ChannelId string `json:"ChannelId,omitempty"`
Platform string `json:"platform,omitempty"`
Name string `json:"name,omitempty"`
GiveWay int32 `json:"givetype,omitempty"`
GiveType int32 `json:"cointype,omitempty"`
Count int64 `json:"count,omitempty"`
Ts int64 `json:"ts,omitempty"`
ItemId int32 `json:"itemid,omitempty"`
}
// GenerateSystemFreeGive 系统免费赠送
func GenerateSystemFreeGive(snid int32, name, platform, channel string, givetype, cointype int32, count int64) *mq.RabbitMQData {
params := make(map[string]string)

View File

@ -118,7 +118,7 @@ func AddMailClientUpgrade(snid int32, items []*webapi.ItemInfo) {
content := i18n.Tr("languages", "Upgrade")
AddMail(&AddMailParam{
Tp: model.MSGTYPE_ITEM,
Tp: model.MSGTYPE_ClientUpgrade,
SnId: snid,
Title: title,
Content: content,

View File

@ -31,6 +31,7 @@ func init() {
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.BackClientLog, Data: &model.ClientLogMysql{}})
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.BackSystemJyb, Data: &model.JybLog{}})
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.DBVipGiftLog, Data: &model.DbVip{}})
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.BackSystemFreeGive, Data: &model.SystemFreeGive{}})
}
func init() {

View File

@ -1110,17 +1110,27 @@ func (this *Player) GetMessageAttach(id string) {
ItemNum: 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 {
mq.Write(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel,
model.SystemFreeGive_GiveType_TaskPermitRank, tp, msg.Params[i+1]))
tp := int32(-1)
switch msg.Params[i] {
case common.ItemIDCoin:
tp = model.SystemFreeGive_CoinType_Coin
case common.ItemIDDiamond:
tp = model.SystemFreeGive_CoinType_Diamond
default:
tp = model.SystemFreeGive_CoinType_Tiem
}
if tp != -1 {
giveType := gainWay
switch gainWay {
case common.GainWayItemPermitRank:
giveType = model.SystemFreeGive_GiveType_TaskPermitRank
case common.GainWayClientUpgrade:
giveType = model.SystemFreeGive_ClientUpgrade
}
mq.Write(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel,
giveType, tp, msg.Params[i+1]))
}
}
BagMgrSingleton.AddItems(&model.AddItemParam{
@ -1196,6 +1206,10 @@ func (this *Player) GetMessageAttach(id string) {
remark = "通行证排行奖励"
gainWay = common.GainWayItemPermitRank
addItem()
case model.MSGTYPE_ClientUpgrade:
remark = "客户端升级奖励"
gainWay = common.GainWayClientUpgrade
addItem()
}
if msg.Coin > 0 {
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)