客户端升级奖励记录系统赠送
This commit is contained in:
parent
c65bf7958f
commit
d1e380d9bb
|
@ -320,6 +320,7 @@ const (
|
||||||
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
|
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
|
||||||
GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销
|
GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销
|
||||||
GainWayPermitReset = 114 //赛季通行证积分重置
|
GainWayPermitReset = 114 //赛季通行证积分重置
|
||||||
|
GainWayClientUpgrade = 115 //客户端升级奖励
|
||||||
)
|
)
|
||||||
|
|
||||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||||
|
|
|
@ -39,6 +39,7 @@ const (
|
||||||
MSGTYPE_RANK_REWARD //排行榜奖励
|
MSGTYPE_RANK_REWARD //排行榜奖励
|
||||||
MSGTYPE_ITEM_CHANGE //背包使用兑换
|
MSGTYPE_ITEM_CHANGE //背包使用兑换
|
||||||
MSGTYPE_RANK_PermitReward // 通行证排行奖励
|
MSGTYPE_RANK_PermitReward // 通行证排行奖励
|
||||||
|
MSGTYPE_ClientUpgrade // 客户端升级
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -108,10 +108,12 @@ const (
|
||||||
SystemFreeGive_PhoneLotterySwap // 手机积分兑换奖励
|
SystemFreeGive_PhoneLotterySwap // 手机积分兑换奖励
|
||||||
SystemFreeGive_CollectBox // 开启卡片礼盒奖励
|
SystemFreeGive_CollectBox // 开启卡片礼盒奖励
|
||||||
SystemFreeGive_CollectBoxSwap // 卡片礼盒兑换奖励
|
SystemFreeGive_CollectBoxSwap // 卡片礼盒兑换奖励
|
||||||
|
SystemFreeGive_ClientUpgrade // 客户端升级奖励
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
SystemFreeGive_CoinType_Coin int32 = iota //金币
|
SystemFreeGive_CoinType_Coin int32 = iota //金币
|
||||||
SystemFreeGive_CoinType_Diamond //钻石
|
SystemFreeGive_CoinType_Diamond //钻石
|
||||||
|
SystemFreeGive_CoinType_Tiem // 道具
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlayerGameCtrlData struct {
|
type PlayerGameCtrlData struct {
|
||||||
|
|
|
@ -20,6 +20,20 @@ func GenerateLogin(o *PlayerLoginEvent) *mq.RabbitMQData {
|
||||||
return NewRabbitMQData(mq.BackLogin, o)
|
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 系统免费赠送
|
// GenerateSystemFreeGive 系统免费赠送
|
||||||
func GenerateSystemFreeGive(snid int32, name, platform, channel string, givetype, cointype int32, count int64) *mq.RabbitMQData {
|
func GenerateSystemFreeGive(snid int32, name, platform, channel string, givetype, cointype int32, count int64) *mq.RabbitMQData {
|
||||||
params := make(map[string]string)
|
params := make(map[string]string)
|
||||||
|
|
|
@ -118,7 +118,7 @@ func AddMailClientUpgrade(snid int32, items []*webapi.ItemInfo) {
|
||||||
content := i18n.Tr("languages", "Upgrade")
|
content := i18n.Tr("languages", "Upgrade")
|
||||||
|
|
||||||
AddMail(&AddMailParam{
|
AddMail(&AddMailParam{
|
||||||
Tp: model.MSGTYPE_ITEM,
|
Tp: model.MSGTYPE_ClientUpgrade,
|
||||||
SnId: snid,
|
SnId: snid,
|
||||||
Title: title,
|
Title: title,
|
||||||
Content: content,
|
Content: content,
|
||||||
|
|
|
@ -31,6 +31,7 @@ func init() {
|
||||||
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.BackClientLog, Data: &model.ClientLogMysql{}})
|
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.BackSystemJyb, Data: &model.JybLog{}})
|
||||||
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.DBVipGiftLog, Data: &model.DbVip{}})
|
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.DBVipGiftLog, Data: &model.DbVip{}})
|
||||||
|
mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.BackSystemFreeGive, Data: &model.SystemFreeGive{}})
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -1110,17 +1110,27 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
ItemNum: msg.Params[i+1], // 数量
|
ItemNum: msg.Params[i+1], // 数量
|
||||||
ObtainTime: time.Now().Unix(),
|
ObtainTime: time.Now().Unix(),
|
||||||
})
|
})
|
||||||
if gainWay == common.GainWayItemPermitRank {
|
|
||||||
tp := int32(-1)
|
tp := int32(-1)
|
||||||
if msg.Params[i] == common.ItemIDCoin {
|
switch msg.Params[i] {
|
||||||
tp = model.SystemFreeGive_CoinType_Coin
|
case common.ItemIDCoin:
|
||||||
} else if msg.Params[i] == common.ItemIDDiamond {
|
tp = model.SystemFreeGive_CoinType_Coin
|
||||||
tp = model.SystemFreeGive_CoinType_Diamond
|
case common.ItemIDDiamond:
|
||||||
}
|
tp = model.SystemFreeGive_CoinType_Diamond
|
||||||
if tp != -1 {
|
default:
|
||||||
mq.Write(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel,
|
tp = model.SystemFreeGive_CoinType_Tiem
|
||||||
model.SystemFreeGive_GiveType_TaskPermitRank, tp, msg.Params[i+1]))
|
}
|
||||||
|
|
||||||
|
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{
|
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||||
|
@ -1196,6 +1206,10 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
remark = "通行证排行奖励"
|
remark = "通行证排行奖励"
|
||||||
gainWay = common.GainWayItemPermitRank
|
gainWay = common.GainWayItemPermitRank
|
||||||
addItem()
|
addItem()
|
||||||
|
case model.MSGTYPE_ClientUpgrade:
|
||||||
|
remark = "客户端升级奖励"
|
||||||
|
gainWay = common.GainWayClientUpgrade
|
||||||
|
addItem()
|
||||||
}
|
}
|
||||||
if msg.Coin > 0 {
|
if msg.Coin > 0 {
|
||||||
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
|
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
|
||||||
|
|
Loading…
Reference in New Issue