Compare commits
4 Commits
731b9857c1
...
f8d62e3be4
Author | SHA1 | Date |
---|---|---|
|
f8d62e3be4 | |
|
bf227fc024 | |
|
aee3fbb10c | |
|
a79737342e |
|
@ -118,7 +118,7 @@ func (svc *PlayerDataSvc) InsertPlayerData(args *model.InsertPlayerDataParam, re
|
||||||
}
|
}
|
||||||
var dataParams model.PlayerParams
|
var dataParams model.PlayerParams
|
||||||
json.Unmarshal([]byte(a.Params), &dataParams)
|
json.Unmarshal([]byte(a.Params), &dataParams)
|
||||||
pd = model.NewPlayerData(acc, name, args.HeadUrl, id, a.Channel, a.Platform, a.Params,
|
pd = model.NewPlayerData(acc, a.UserName, name, args.HeadUrl, id, a.Channel, a.Platform, a.Params,
|
||||||
a.Tel, a.PackegeTag, dataParams.Ip, a.TagKey, a.AccountType, a.DeviceOs, a.ChannelId, a.ClientVer)
|
a.Tel, a.PackegeTag, dataParams.Ip, a.TagKey, a.AccountType, a.DeviceOs, a.ChannelId, a.ClientVer)
|
||||||
if pd != nil {
|
if pd != nil {
|
||||||
if pd.ICode == "" {
|
if pd.ICode == "" {
|
||||||
|
@ -203,7 +203,7 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = "Guest"
|
name = "Guest"
|
||||||
}
|
}
|
||||||
pd := model.NewPlayerData(a.AccountId.Hex(), name, "", a.SnId, a.Channel, a.Platform, a.Params,
|
pd := model.NewPlayerData(a.AccountId.Hex(), a.UserName, name, "", a.SnId, a.Channel, a.Platform, a.Params,
|
||||||
a.Tel, a.PackegeTag, dataParams.Ip, a.TagKey, a.AccountType, a.DeviceOs, a.ChannelId, a.ClientVer)
|
a.Tel, a.PackegeTag, dataParams.Ip, a.TagKey, a.AccountType, a.DeviceOs, a.ChannelId, a.ClientVer)
|
||||||
if pd != nil {
|
if pd != nil {
|
||||||
if pd.ICode == "" {
|
if pd.ICode == "" {
|
||||||
|
|
|
@ -182,6 +182,7 @@ func (this *Scene) SaveGamePlayerListLog(param *SaveGamePlayerListLogParam) *Sav
|
||||||
WinSmallGame: param.WinSmallGame,
|
WinSmallGame: param.WinSmallGame,
|
||||||
WinTotal: param.WinTotal,
|
WinTotal: param.WinTotal,
|
||||||
CycleId: this.CycleID,
|
CycleId: this.CycleID,
|
||||||
|
Username: p.Username,
|
||||||
}
|
}
|
||||||
if param.OnlyLog {
|
if param.OnlyLog {
|
||||||
ret.Log = append(ret.Log, log)
|
ret.Log = append(ret.Log, log)
|
||||||
|
|
|
@ -641,15 +641,15 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
var gameTimes, gameFreeTimes int64
|
var gameTimes, gameFreeTimes int64
|
||||||
data, ok := this.GDatas[this.scene.KeyGamefreeId]
|
data, ok := this.GDatas[this.scene.KeyGamefreeId]
|
||||||
if ok {
|
if ok {
|
||||||
gameFirstTime = data.FirstTime
|
gameFreeFirstTime = data.FirstTime
|
||||||
gameTimes = data.Statics.GameTimes
|
gameFreeTimes = data.Statics.GameTimes
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录玩家 首次参与该游戏时间 游戏次数(不区分场次)
|
// 记录玩家 首次参与该游戏时间 游戏次数(不区分场次)
|
||||||
dataGame, ok := this.GDatas[this.scene.KeyGameId]
|
dataGame, ok := this.GDatas[this.scene.KeyGameId]
|
||||||
if ok {
|
if ok {
|
||||||
gameFreeFirstTime = dataGame.FirstTime
|
gameFirstTime = dataGame.FirstTime
|
||||||
gameFreeTimes = dataGame.Statics.GameTimes
|
gameTimes = dataGame.Statics.GameTimes
|
||||||
}
|
}
|
||||||
|
|
||||||
isNew := int32(0)
|
isNew := int32(0)
|
||||||
|
@ -668,12 +668,12 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
var ret ReportGameEventOnly
|
var ret ReportGameEventOnly
|
||||||
ret.Param = param
|
ret.Param = param
|
||||||
log := &model.PlayerGameRecEvent{
|
log := &model.PlayerGameRecEvent{
|
||||||
Platform: this.Platform,
|
Platform: this.Platform,
|
||||||
RecordId: this.scene.GetRecordId(),
|
RecordId: this.scene.GetRecordId(),
|
||||||
SnId: this.GetSnId(),
|
SnId: this.GetSnId(),
|
||||||
Channel: this.Channel,
|
Channel: this.Channel,
|
||||||
ChannelId: this.ChannelId,
|
ChannelId: this.ChannelId,
|
||||||
City: this.City,
|
//City: this.City,
|
||||||
OS: this.DeviceOS,
|
OS: this.DeviceOS,
|
||||||
GameId: this.scene.GameId,
|
GameId: this.scene.GameId,
|
||||||
ModeId: this.scene.GameMode,
|
ModeId: this.scene.GameMode,
|
||||||
|
@ -686,12 +686,12 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
IsNew: isNew,
|
IsNew: isNew,
|
||||||
GameFreeID: this.scene.GetGameFreeId(),
|
GameFreeID: this.scene.GetGameFreeId(),
|
||||||
GamingTime: int32(param.GameTime),
|
GamingTime: int32(param.GameTime),
|
||||||
FirstTime: gameFirstTime.Unix(),
|
FirstTime: gameFreeFirstTime.Unix(),
|
||||||
PlayTimes: gameTimes,
|
PlayTimes: gameFreeTimes,
|
||||||
FirstGameTime: gameFreeFirstTime.Unix(),
|
FirstGameTime: gameFirstTime.Unix(),
|
||||||
PlayGameTimes: gameFreeTimes,
|
PlayGameTimes: gameTimes,
|
||||||
LastLoginTime: this.LastLoginTime.Unix(),
|
LastLoginTime: this.LastLoginTime.Unix(),
|
||||||
DeviceId: this.DeviceId,
|
//DeviceId: this.DeviceId,
|
||||||
}
|
}
|
||||||
if param.OnlyLog {
|
if param.OnlyLog {
|
||||||
ret.Log = append(ret.Log, log)
|
ret.Log = append(ret.Log, log)
|
||||||
|
|
|
@ -691,9 +691,9 @@ func (this *SceneBaseStateTienLen) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
||||||
|
|
||||||
if sceneEx.IsCustom() && sceneEx.GetSceneState().GetState() == rule.TienLenSceneStateWaitPlayer {
|
if sceneEx.IsCustom() && sceneEx.GetSceneState().GetState() == rule.TienLenSceneStateWaitPlayer {
|
||||||
// 玩家继续
|
// 玩家继续
|
||||||
if !playerEx.IsMarkFlag(base.PlayerState_Ready) {
|
//if !playerEx.IsMarkFlag(base.PlayerState_Ready) {
|
||||||
playerEx.MarkFlag(base.PlayerState_Ready)
|
// playerEx.MarkFlag(base.PlayerState_Ready)
|
||||||
}
|
//}
|
||||||
// 扣房费
|
// 扣房费
|
||||||
// 房主扣费
|
// 房主扣费
|
||||||
if (sceneEx.GetCustom().GetCostType() == 2 && playerEx.SnId == sceneEx.GetCreator()) ||
|
if (sceneEx.GetCustom().GetCostType() == 2 && playerEx.SnId == sceneEx.GetCreator()) ||
|
||||||
|
@ -1782,6 +1782,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
playerEx.CurIsWin = int64(0)
|
playerEx.CurIsWin = int64(0)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: playerEx.SnId,
|
UserId: playerEx.SnId,
|
||||||
|
Username: playerEx.Username,
|
||||||
UserIcon: playerEx.Head,
|
UserIcon: playerEx.Head,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Channel: playerEx.Channel,
|
Channel: playerEx.Channel,
|
||||||
|
@ -1934,6 +1935,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
losePlayer.CurIsWin = int64(isWin)
|
losePlayer.CurIsWin = int64(isWin)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: losePlayer.SnId,
|
UserId: losePlayer.SnId,
|
||||||
|
Username: losePlayer.Username,
|
||||||
UserIcon: losePlayer.Head,
|
UserIcon: losePlayer.Head,
|
||||||
Platform: losePlayer.Platform,
|
Platform: losePlayer.Platform,
|
||||||
Channel: losePlayer.Channel,
|
Channel: losePlayer.Channel,
|
||||||
|
@ -2077,6 +2079,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
lastWinPlayer.CurIsWin = int64(isWin)
|
lastWinPlayer.CurIsWin = int64(isWin)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: lastWinPlayer.SnId,
|
UserId: lastWinPlayer.SnId,
|
||||||
|
Username: lastWinPlayer.Username,
|
||||||
UserIcon: lastWinPlayer.Head,
|
UserIcon: lastWinPlayer.Head,
|
||||||
Platform: lastWinPlayer.Platform,
|
Platform: lastWinPlayer.Platform,
|
||||||
Channel: lastWinPlayer.Channel,
|
Channel: lastWinPlayer.Channel,
|
||||||
|
@ -2189,6 +2192,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
playerEx.CurIsWin = int64(isWin)
|
playerEx.CurIsWin = int64(isWin)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: playerEx.SnId,
|
UserId: playerEx.SnId,
|
||||||
|
Username: playerEx.Username,
|
||||||
UserIcon: playerEx.Head,
|
UserIcon: playerEx.Head,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Channel: playerEx.Channel,
|
Channel: playerEx.Channel,
|
||||||
|
@ -2295,6 +2299,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
playerEx.CurIsWin = int64(isWin)
|
playerEx.CurIsWin = int64(isWin)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: playerEx.SnId,
|
UserId: playerEx.SnId,
|
||||||
|
Username: playerEx.Username,
|
||||||
UserIcon: playerEx.Head,
|
UserIcon: playerEx.Head,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Channel: playerEx.Channel,
|
Channel: playerEx.Channel,
|
||||||
|
@ -2447,6 +2452,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
playerEx.CurIsWin = int64(isWin)
|
playerEx.CurIsWin = int64(isWin)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: playerEx.SnId,
|
UserId: playerEx.SnId,
|
||||||
|
Username: playerEx.Username,
|
||||||
UserIcon: playerEx.Head,
|
UserIcon: playerEx.Head,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Channel: playerEx.Channel,
|
Channel: playerEx.Channel,
|
||||||
|
@ -2578,6 +2584,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
playerEx.CurIsWin = int64(isWin)
|
playerEx.CurIsWin = int64(isWin)
|
||||||
tienlenPerson := model.TienLenPerson{
|
tienlenPerson := model.TienLenPerson{
|
||||||
UserId: playerEx.SnId,
|
UserId: playerEx.SnId,
|
||||||
|
Username: playerEx.Username,
|
||||||
UserIcon: playerEx.Head,
|
UserIcon: playerEx.Head,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Channel: playerEx.Channel,
|
Channel: playerEx.Channel,
|
||||||
|
|
|
@ -245,34 +245,35 @@ func CreatePlayerLoginEvent(snid int32, channel, promoter, platform, city, os, i
|
||||||
|
|
||||||
// 玩家游戏记录
|
// 玩家游戏记录
|
||||||
type PlayerGameRecEvent struct {
|
type PlayerGameRecEvent struct {
|
||||||
RecordId string //游戏记录ID
|
RecordId string //游戏记录ID
|
||||||
SnId int32 //用户ID
|
SnId int32 //用户ID
|
||||||
Channel string //包类型
|
Channel string //包类型
|
||||||
Promoter string //推广
|
Platform string //平台
|
||||||
Platform string //平台
|
OS string //操作系统
|
||||||
City string //城市
|
GameId int32 //游戏id
|
||||||
OS string //操作系统
|
ModeId int32 //游戏模式
|
||||||
TelephonePromoter int32 //电销标记
|
Tax int64 //税收
|
||||||
GameId int32 //游戏id
|
Amount int64 //金币变化,税后(正值为赢;负值为输)
|
||||||
ModeId int32 //游戏模式
|
CreateTime int64 //创建时间
|
||||||
Tax int64 //税收
|
CreateDayTime int64 //账号创建时间0点
|
||||||
Amount int64 //金币变化(正值为赢;负值为输)
|
Out int64 //产出
|
||||||
CreateTime int64 //创建时间
|
In int64 //投入
|
||||||
CreateDayTime int64 //账号创建时间0点
|
IsNew int32 //是否是新人
|
||||||
ValidBet int64 //有效下注数量
|
GameFreeID int32 //游戏freeid
|
||||||
ValidFlow int64 //有效流水数量
|
GamingTime int32 //游戏开始到玩家结算的时长 单位:秒
|
||||||
Out int64 //产出
|
|
||||||
In int64 //投入
|
GameDif int32 // 游戏分组
|
||||||
IsNew int32 //是否是新人
|
FirstGameDifTime int64 // 首次游戏分组时间
|
||||||
GameFreeID int32 //游戏freeid
|
GameDifTimes int64 // 游戏分组游戏次数
|
||||||
GamingTime int32 //游戏开始到玩家结算的时长 单位:秒
|
|
||||||
FirstTime int64 //首次玩该场次游戏时间
|
FirstTime int64 //首次玩该场次游戏时间
|
||||||
PlayTimes int64 //该场次游戏次数
|
PlayTimes int64 //该场次游戏次数
|
||||||
FirstGameTime int64 //首次玩游戏时间
|
|
||||||
PlayGameTimes int64 //该游戏总次数
|
FirstGameTime int64 //首次玩游戏时间
|
||||||
LastLoginTime int64 //最后登录时间
|
PlayGameTimes int64 //该游戏总次数
|
||||||
DeviceId string //设备id
|
|
||||||
ChannelId string //推广渠道id
|
LastLoginTime int64 //最后登录时间
|
||||||
|
ChannelId string //推广渠道id
|
||||||
}
|
}
|
||||||
|
|
||||||
// 玩家游戏记录
|
// 玩家游戏记录
|
||||||
|
|
|
@ -1533,6 +1533,7 @@ type TienLenAddItem struct {
|
||||||
|
|
||||||
type TienLenPerson struct {
|
type TienLenPerson struct {
|
||||||
UserId int32 //玩家ID
|
UserId int32 //玩家ID
|
||||||
|
Username string // 用户名
|
||||||
UserIcon int32 //玩家头像
|
UserIcon int32 //玩家头像
|
||||||
Platform string `json:"-"`
|
Platform string `json:"-"`
|
||||||
Channel string `json:"-"`
|
Channel string `json:"-"`
|
||||||
|
|
|
@ -56,6 +56,7 @@ type GamePlayerListLog struct {
|
||||||
WinSmallGame int64 //拉霸专用 小游戏奖励
|
WinSmallGame int64 //拉霸专用 小游戏奖励
|
||||||
WinTotal int64 //拉霸专用 输赢
|
WinTotal int64 //拉霸专用 输赢
|
||||||
CycleId string // 本轮id,打一轮有多局
|
CycleId string // 本轮id,打一轮有多局
|
||||||
|
Username string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGamePlayerListLog() *GamePlayerListLog {
|
func NewGamePlayerListLog() *GamePlayerListLog {
|
||||||
|
|
|
@ -365,6 +365,7 @@ type WGPlayerInfo struct {
|
||||||
type PlayerData struct {
|
type PlayerData struct {
|
||||||
Id bson.ObjectId `bson:"_id"`
|
Id bson.ObjectId `bson:"_id"`
|
||||||
AccountId string //账号id
|
AccountId string //账号id
|
||||||
|
Username string // 用户名
|
||||||
AccountType int32 //账号类型
|
AccountType int32 //账号类型
|
||||||
SnId int32 //数字唯一id
|
SnId int32 //数字唯一id
|
||||||
NiceId int32 //靓号
|
NiceId int32 //靓号
|
||||||
|
@ -923,7 +924,7 @@ func (this *PlayerData) UpdateParams(params string) *PlayerParams {
|
||||||
return &pp
|
return &pp
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPlayerData(acc string, name, headUrl string, id int32, channel, platform string, params, tel string,
|
func NewPlayerData(acc string, username, name, headUrl string, id int32, channel, platform string, params, tel string,
|
||||||
packTag, ip string, tagkey, accountType int32, deviceOS, channelId string, clientVer int32) *PlayerData {
|
packTag, ip string, tagkey, accountType int32, deviceOS, channelId string, clientVer int32) *PlayerData {
|
||||||
if len(name) == 0 {
|
if len(name) == 0 {
|
||||||
logger.Logger.Trace("New player name is empty.")
|
logger.Logger.Trace("New player name is empty.")
|
||||||
|
@ -939,6 +940,7 @@ func NewPlayerData(acc string, name, headUrl string, id int32, channel, platform
|
||||||
pd := &PlayerData{
|
pd := &PlayerData{
|
||||||
Id: bson.NewObjectId(),
|
Id: bson.NewObjectId(),
|
||||||
AccountId: acc,
|
AccountId: acc,
|
||||||
|
Username: username,
|
||||||
Name: name,
|
Name: name,
|
||||||
Channel: channel,
|
Channel: channel,
|
||||||
ChannelId: channelId,
|
ChannelId: channelId,
|
||||||
|
|
Loading…
Reference in New Issue