客户端升级统计

This commit is contained in:
sk 2024-10-11 10:57:29 +08:00
parent e5378e46f9
commit 9a376b06c0
3 changed files with 13 additions and 25 deletions

View File

@ -133,10 +133,12 @@ type PlayerLoginEvent struct {
IsNew int32 //是否是新用户1是 0否 IsNew int32 //是否是新用户1是 0否
DeviceId string //设备id DeviceId string //设备id
ChannelId string //渠道id ChannelId string //渠道id
AppChannel string //包渠道
ClientVer int32 // 客户端版本
} }
func CreatePlayerLoginEvent(snid int32, channel, promoter, platform, city, os, ip string, createTime, func CreatePlayerLoginEvent(snid int32, channel, promoter, platform, city, os, ip string, createTime,
upgradeTime time.Time, isBindPhone int32, telephonePromoter int32, deviceId, channelId string) *PlayerLoginEvent { upgradeTime time.Time, isBindPhone int32, telephonePromoter int32, deviceId, channelId, appChannel string, clientVer int32) *PlayerLoginEvent {
isNew := int32(0) isNew := int32(0)
if createTime.Local().YearDay() == time.Now().Local().YearDay() && createTime.Local().Year() == time.Now().Local().Year() { if createTime.Local().YearDay() == time.Now().Local().YearDay() && createTime.Local().Year() == time.Now().Local().Year() {
isNew = 1 isNew = 1
@ -158,25 +160,11 @@ func CreatePlayerLoginEvent(snid int32, channel, promoter, platform, city, os, i
IsNew: isNew, IsNew: isNew,
DeviceId: deviceId, DeviceId: deviceId,
ChannelId: channelId, ChannelId: channelId,
AppChannel: appChannel,
ClientVer: clientVer,
} }
} }
func MarshalPlayerLoginEvent(source, snid int32, channel, promoter, platform, city, os, ip string,
createTime, upgradeTime time.Time, isBindPhone int32, telephonePromoter int32, deviceId, channelId string) (data string, err error) {
raw := &RabbitMQDataRaw{
Source: source,
Data: CreatePlayerLoginEvent(snid, channel, promoter, platform, city, os, ip, createTime,
upgradeTime, isBindPhone, telephonePromoter, deviceId, channelId),
}
d, e := json.Marshal(raw)
if e == nil {
data = string(d[:])
}
err = e
return
}
// 用户升级账号 // 用户升级账号
type PlayerBindPhoneEvent struct { type PlayerBindPhoneEvent struct {
SnId int32 //用户ID SnId int32 //用户ID

View File

@ -1983,18 +1983,18 @@ func CSPlayerData(s *netlib.Session, packetid int, data interface{}, sid int64)
} }
} }
// 老版本升级 // 客户端升级奖励
clientUpgradeConfig := PlatformMgrSingleton.GetConfig(p.Platform).ClientUpgrade clientUpgradeConfig := PlatformMgrSingleton.GetConfig(p.Platform).ClientUpgrade
if clientUpgradeConfig != nil && clientUpgradeConfig.GetOn() == common.On && if clientUpgradeConfig != nil && clientUpgradeConfig.GetOn() == common.On &&
(len(model.GameParamData.ClientVersionChannel) == 0 || slices.Contains(model.GameParamData.ClientVersionChannel, p.LastChannel)) { (len(model.GameParamData.ClientVersionChannel) == 0 || slices.Contains(model.GameParamData.ClientVersionChannel, p.LastChannel)) {
if p.ClientVer < model.GameParamData.ClientVersion { if p.ClientVer < model.GameParamData.ClientVersion && cspl.GetClientVer() == model.GameParamData.ClientVersion {
if cspl.GetClientVer() == model.GameParamData.ClientVersion { AddMailClientUpgrade(p.SnId, clientUpgradeConfig.GetReward())
// 升级了
p.ClientVer = model.GameParamData.ClientVersion
AddMailClientUpgrade(p.SnId, clientUpgradeConfig.GetReward())
}
} }
} }
// 客户端升级
if p.ClientVer < cspl.GetClientVer() && cspl.GetClientVer() <= model.GameParamData.ClientVersion {
p.ClientVer = cspl.GetClientVer()
}
} }
// 有缓存数据 // 有缓存数据

View File

@ -2940,7 +2940,7 @@ func (this *Player) ReportLoginEvent() {
} }
mq.Write(model.GenerateLogin(model.CreatePlayerLoginEvent(this.SnId, mq.Write(model.GenerateLogin(model.CreatePlayerLoginEvent(this.SnId,
this.Channel, this.BeUnderAgentCode, this.Platform, this.City, this.DeviceOS, this.Ip, this.Channel, this.BeUnderAgentCode, this.Platform, this.City, this.DeviceOS, this.Ip,
this.CreateTime, this.UpgradeTime, isBindPhone, this.TelephonePromoter, this.DeviceId, this.ChannelId))) this.CreateTime, this.UpgradeTime, isBindPhone, this.TelephonePromoter, this.DeviceId, this.ChannelId, this.AppChannel, this.ClientVer)))
//登录通知 //登录通知
//ActMonitorMgrSington.SendActMonitorEvent(ActState_Login, this.SnId, this.Name, this.Platform, //ActMonitorMgrSington.SendActMonitorEvent(ActState_Login, this.SnId, this.Name, this.Platform,
// 0, 0, "", 0) // 0, 0, "", 0)