Merge remote-tracking branch 'origin/develop' into dev_slots
This commit is contained in:
commit
4b8093d09e
|
@ -231,6 +231,7 @@ type LabaLog struct {
|
||||||
PlayerListLog *SaveGamePlayerListLogCopy
|
PlayerListLog *SaveGamePlayerListLogCopy
|
||||||
GameDetailLog *SaveGameDetailedCopy
|
GameDetailLog *SaveGameDetailedCopy
|
||||||
CacheTime time.Time // 缓存时间
|
CacheTime time.Time // 缓存时间
|
||||||
|
noEmpty bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache 临时缓存
|
// Cache 临时缓存
|
||||||
|
@ -238,17 +239,30 @@ func (l *LabaLog) Cache(s *Scene, detailLog *SaveGameDetailedParam, playerListLo
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l.Save(2) // 如果没有收到结束消息,算2秒游戏时长
|
||||||
|
|
||||||
detailLog.OnlyLog = true
|
detailLog.OnlyLog = true
|
||||||
playerListLog.OnlyLog = true
|
playerListLog.OnlyLog = true
|
||||||
l.GameDetailLog = s.SaveGameDetailedLog(detailLog)
|
l.GameDetailLog = s.SaveGameDetailedLog(detailLog)
|
||||||
l.PlayerListLog = s.SaveGamePlayerListLog(playerListLog)
|
l.PlayerListLog = s.SaveGamePlayerListLog(playerListLog)
|
||||||
l.CacheTime = time.Now()
|
l.CacheTime = time.Now()
|
||||||
|
l.noEmpty = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save 保存
|
// Save 保存
|
||||||
|
// second 为0时,自动计算时间,从开始转动计时
|
||||||
func (l *LabaLog) Save(second int32) {
|
func (l *LabaLog) Save(second int32) {
|
||||||
|
if !l.noEmpty {
|
||||||
|
return
|
||||||
|
}
|
||||||
if second <= 0 {
|
if second <= 0 {
|
||||||
second = int32(time.Now().Sub(l.CacheTime).Seconds())
|
sub := time.Now().Sub(l.CacheTime).Milliseconds()
|
||||||
|
if sub <= 1000 {
|
||||||
|
second = 1
|
||||||
|
} else {
|
||||||
|
second = int32(sub / 1000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if l.PlayerListLog != nil {
|
if l.PlayerListLog != nil {
|
||||||
|
@ -272,6 +286,7 @@ func (l *LabaLog) Save(second int32) {
|
||||||
|
|
||||||
// Clear 清空
|
// Clear 清空
|
||||||
func (l *LabaLog) Clear() {
|
func (l *LabaLog) Clear() {
|
||||||
|
l.noEmpty = false
|
||||||
l.PlayerListLog = nil
|
l.PlayerListLog = nil
|
||||||
l.GameDetailLog = nil
|
l.GameDetailLog = nil
|
||||||
l.CacheTime = time.Time{}
|
l.CacheTime = time.Time{}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
type FortuneDragonPlayerData struct {
|
type FortuneDragonPlayerData struct {
|
||||||
*base.Player
|
*base.Player
|
||||||
|
base.LabaLog
|
||||||
leaveTime int32 //离开时间
|
leaveTime int32 //离开时间
|
||||||
SlotsSession *base.SlotsSession
|
SlotsSession *base.SlotsSession
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ func (p *FortuneDragonPlayerData) Clear() {
|
||||||
p.taxCoin = 0
|
p.taxCoin = 0
|
||||||
p.winCoin = 0
|
p.winCoin = 0
|
||||||
p.currentLogId = ""
|
p.currentLogId = ""
|
||||||
|
p.LabaLog.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要带到world上进行数据处理
|
// 需要带到world上进行数据处理
|
||||||
|
|
|
@ -112,6 +112,7 @@ func (this *ScenePolicyFortuneDragon) OnPlayerLeave(s *base.Scene, p *base.Playe
|
||||||
}
|
}
|
||||||
logger.Logger.Trace("(this *ScenePolicyFortuneDragon) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
logger.Logger.Trace("(this *ScenePolicyFortuneDragon) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
if playerEx, ok := p.ExtraData.(*FortuneDragonPlayerData); ok {
|
if playerEx, ok := p.ExtraData.(*FortuneDragonPlayerData); ok {
|
||||||
|
playerEx.Save(2)
|
||||||
m := playerEx.PushPlayer()
|
m := playerEx.PushPlayer()
|
||||||
if m != nil && len(m) > 0 {
|
if m != nil && len(m) > 0 {
|
||||||
b, err := json.Marshal(m)
|
b, err := json.Marshal(m)
|
||||||
|
@ -476,6 +477,8 @@ func (this *SceneStateStartFortuneDragon) OnPlayerOp(s *base.Scene, p *base.Play
|
||||||
|
|
||||||
// 记录本次操作
|
// 记录本次操作
|
||||||
FortuneDragonAndSaveLog(sceneEx, playerEx, data)
|
FortuneDragonAndSaveLog(sceneEx, playerEx, data)
|
||||||
|
case 1000:
|
||||||
|
playerEx.Save(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -520,11 +523,6 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logid, _ := model.AutoIncGameLogId()
|
logid, _ := model.AutoIncGameLogId()
|
||||||
playerEx.currentLogId = logid
|
playerEx.currentLogId = logid
|
||||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
|
||||||
LogId: logid,
|
|
||||||
Detail: info,
|
|
||||||
GameTime: 2,
|
|
||||||
})
|
|
||||||
var totalin, totalout int64
|
var totalin, totalout int64
|
||||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
totalin = playerEx.totalBet
|
totalin = playerEx.totalBet
|
||||||
|
@ -532,7 +530,10 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD
|
||||||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||||
}
|
}
|
||||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
playerEx.Cache(sceneEx.Scene, &base.SaveGameDetailedParam{
|
||||||
|
LogId: logid,
|
||||||
|
Detail: info,
|
||||||
|
}, &base.SaveGamePlayerListLogParam{
|
||||||
LogId: logid,
|
LogId: logid,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
|
@ -544,7 +545,6 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD
|
||||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||||
IsFree: playerEx.isFree,
|
IsFree: playerEx.isFree,
|
||||||
GameTime: 2,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
type FortuneMousePlayerData struct {
|
type FortuneMousePlayerData struct {
|
||||||
*base.Player
|
*base.Player
|
||||||
|
base.LabaLog
|
||||||
leaveTime int32 //离开时间
|
leaveTime int32 //离开时间
|
||||||
SlotsSession *base.SlotsSession
|
SlotsSession *base.SlotsSession
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@ func (p *FortuneMousePlayerData) Clear() {
|
||||||
p.taxCoin = 0
|
p.taxCoin = 0
|
||||||
p.winCoin = 0
|
p.winCoin = 0
|
||||||
p.currentLogId = ""
|
p.currentLogId = ""
|
||||||
|
p.LabaLog.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要带到world上进行数据处理
|
// 需要带到world上进行数据处理
|
||||||
|
|
|
@ -111,6 +111,7 @@ func (this *ScenePolicyFortuneMouse) OnPlayerLeave(s *base.Scene, p *base.Player
|
||||||
}
|
}
|
||||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
if playerEx, ok := p.ExtraData.(*FortuneMousePlayerData); ok {
|
if playerEx, ok := p.ExtraData.(*FortuneMousePlayerData); ok {
|
||||||
|
playerEx.Save(2)
|
||||||
m := playerEx.PushPlayer()
|
m := playerEx.PushPlayer()
|
||||||
if m != nil && len(m) > 0 {
|
if m != nil && len(m) > 0 {
|
||||||
b, err := json.Marshal(m)
|
b, err := json.Marshal(m)
|
||||||
|
@ -480,6 +481,8 @@ func (this *SceneStateStartFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Playe
|
||||||
|
|
||||||
// 记录本次操作
|
// 记录本次操作
|
||||||
FortuneMouseAndSaveLog(sceneEx, playerEx, data)
|
FortuneMouseAndSaveLog(sceneEx, playerEx, data)
|
||||||
|
case 1000:
|
||||||
|
playerEx.Save(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -531,11 +534,6 @@ func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMou
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logid, _ := model.AutoIncGameLogId()
|
logid, _ := model.AutoIncGameLogId()
|
||||||
playerEx.currentLogId = logid
|
playerEx.currentLogId = logid
|
||||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
|
||||||
LogId: logid,
|
|
||||||
Detail: info,
|
|
||||||
GameTime: 2,
|
|
||||||
})
|
|
||||||
var totalin, totalout int64
|
var totalin, totalout int64
|
||||||
if respinStatus == 0 || respinStatus == 1 {
|
if respinStatus == 0 || respinStatus == 1 {
|
||||||
totalin = playerEx.totalBet
|
totalin = playerEx.totalBet
|
||||||
|
@ -543,7 +541,10 @@ func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMou
|
||||||
if respinStatus == 0 || respinStatus == 3 {
|
if respinStatus == 0 || respinStatus == 3 {
|
||||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||||
}
|
}
|
||||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
playerEx.Cache(sceneEx.Scene, &base.SaveGameDetailedParam{
|
||||||
|
LogId: logid,
|
||||||
|
Detail: info,
|
||||||
|
}, &base.SaveGamePlayerListLogParam{
|
||||||
LogId: logid,
|
LogId: logid,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
|
@ -551,11 +552,10 @@ func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMou
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
BetAmount: playerEx.totalBet,
|
BetAmount: totalin,
|
||||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||||
IsFree: totalin == 0,
|
IsFree: totalin == 0,
|
||||||
GameTime: 2,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
type FortuneOxPlayerData struct {
|
type FortuneOxPlayerData struct {
|
||||||
*base.Player
|
*base.Player
|
||||||
|
base.LabaLog
|
||||||
leaveTime int32 //离开时间
|
leaveTime int32 //离开时间
|
||||||
SlotsSession *base.SlotsSession
|
SlotsSession *base.SlotsSession
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@ func (p *FortuneOxPlayerData) Clear() {
|
||||||
p.taxCoin = 0
|
p.taxCoin = 0
|
||||||
p.winCoin = 0
|
p.winCoin = 0
|
||||||
p.currentLogId = ""
|
p.currentLogId = ""
|
||||||
|
p.LabaLog.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要带到world上进行数据处理
|
// 需要带到world上进行数据处理
|
||||||
|
|
|
@ -111,6 +111,7 @@ func (this *ScenePolicyFortuneOx) OnPlayerLeave(s *base.Scene, p *base.Player, r
|
||||||
}
|
}
|
||||||
logger.Logger.Trace("(this *ScenePolicyFortuneOx) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
logger.Logger.Trace("(this *ScenePolicyFortuneOx) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
if playerEx, ok := p.ExtraData.(*FortuneOxPlayerData); ok {
|
if playerEx, ok := p.ExtraData.(*FortuneOxPlayerData); ok {
|
||||||
|
playerEx.Save(2)
|
||||||
m := playerEx.PushPlayer()
|
m := playerEx.PushPlayer()
|
||||||
if m != nil && len(m) > 0 {
|
if m != nil && len(m) > 0 {
|
||||||
b, err := json.Marshal(m)
|
b, err := json.Marshal(m)
|
||||||
|
@ -480,6 +481,8 @@ func (this *SceneStateStartFortuneOx) OnPlayerOp(s *base.Scene, p *base.Player,
|
||||||
|
|
||||||
// 记录本次操作
|
// 记录本次操作
|
||||||
FortuneOxAndSaveLog(sceneEx, playerEx, data)
|
FortuneOxAndSaveLog(sceneEx, playerEx, data)
|
||||||
|
case 1000:
|
||||||
|
playerEx.Save(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -531,11 +534,6 @@ func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerD
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logid, _ := model.AutoIncGameLogId()
|
logid, _ := model.AutoIncGameLogId()
|
||||||
playerEx.currentLogId = logid
|
playerEx.currentLogId = logid
|
||||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
|
||||||
LogId: logid,
|
|
||||||
Detail: info,
|
|
||||||
GameTime: 2,
|
|
||||||
})
|
|
||||||
var totalin, totalout int64
|
var totalin, totalout int64
|
||||||
if respinStatus == 0 || respinStatus == 1 {
|
if respinStatus == 0 || respinStatus == 1 {
|
||||||
totalin = playerEx.totalBet
|
totalin = playerEx.totalBet
|
||||||
|
@ -543,7 +541,10 @@ func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerD
|
||||||
if respinStatus == 0 || respinStatus == 3 {
|
if respinStatus == 0 || respinStatus == 3 {
|
||||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||||
}
|
}
|
||||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
playerEx.Cache(sceneEx.Scene, &base.SaveGameDetailedParam{
|
||||||
|
LogId: logid,
|
||||||
|
Detail: info,
|
||||||
|
}, &base.SaveGamePlayerListLogParam{
|
||||||
LogId: logid,
|
LogId: logid,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
|
@ -555,7 +556,6 @@ func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerD
|
||||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||||
IsFree: totalin == 0,
|
IsFree: totalin == 0,
|
||||||
GameTime: 2,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
type FortuneRabbitPlayerData struct {
|
type FortuneRabbitPlayerData struct {
|
||||||
*base.Player
|
*base.Player
|
||||||
|
base.LabaLog
|
||||||
leaveTime int32 //离开时间
|
leaveTime int32 //离开时间
|
||||||
SlotsSession *base.SlotsSession
|
SlotsSession *base.SlotsSession
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ func (p *FortuneRabbitPlayerData) Clear() {
|
||||||
p.taxCoin = 0
|
p.taxCoin = 0
|
||||||
p.winCoin = 0
|
p.winCoin = 0
|
||||||
p.currentLogId = ""
|
p.currentLogId = ""
|
||||||
|
p.LabaLog.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要带到world上进行数据处理
|
// 需要带到world上进行数据处理
|
||||||
|
|
|
@ -111,6 +111,7 @@ func (this *ScenePolicyFortuneRabbit) OnPlayerLeave(s *base.Scene, p *base.Playe
|
||||||
}
|
}
|
||||||
logger.Logger.Trace("(this *ScenePolicyFortuneRabbit) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
logger.Logger.Trace("(this *ScenePolicyFortuneRabbit) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
if playerEx, ok := p.ExtraData.(*FortuneRabbitPlayerData); ok {
|
if playerEx, ok := p.ExtraData.(*FortuneRabbitPlayerData); ok {
|
||||||
|
playerEx.LabaLog.Save(2) // 没有收到结束消息,算2秒游戏时长
|
||||||
m := playerEx.PushPlayer()
|
m := playerEx.PushPlayer()
|
||||||
if m != nil && len(m) > 0 {
|
if m != nil && len(m) > 0 {
|
||||||
b, err := json.Marshal(m)
|
b, err := json.Marshal(m)
|
||||||
|
@ -474,6 +475,9 @@ func (this *SceneStateStartFortuneRabbit) OnPlayerOp(s *base.Scene, p *base.Play
|
||||||
|
|
||||||
// 记录本次操作
|
// 记录本次操作
|
||||||
FortuneRabbitAndSaveLog(sceneEx, playerEx, data)
|
FortuneRabbitAndSaveLog(sceneEx, playerEx, data)
|
||||||
|
|
||||||
|
case 1000:
|
||||||
|
playerEx.Save(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -518,11 +522,6 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logid, _ := model.AutoIncGameLogId()
|
logid, _ := model.AutoIncGameLogId()
|
||||||
playerEx.currentLogId = logid
|
playerEx.currentLogId = logid
|
||||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
|
||||||
LogId: logid,
|
|
||||||
Detail: info,
|
|
||||||
GameTime: 2,
|
|
||||||
})
|
|
||||||
var totalin, totalout int64
|
var totalin, totalout int64
|
||||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
totalin = playerEx.totalBet
|
totalin = playerEx.totalBet
|
||||||
|
@ -530,7 +529,10 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR
|
||||||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||||
}
|
}
|
||||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
playerEx.Cache(sceneEx.Scene, &base.SaveGameDetailedParam{
|
||||||
|
LogId: logid,
|
||||||
|
Detail: info,
|
||||||
|
}, &base.SaveGamePlayerListLogParam{
|
||||||
LogId: logid,
|
LogId: logid,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
|
@ -542,7 +544,6 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR
|
||||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||||
IsFree: playerEx.isFree,
|
IsFree: playerEx.isFree,
|
||||||
GameTime: 2,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
type FortuneTigerPlayerData struct {
|
type FortuneTigerPlayerData struct {
|
||||||
*base.Player
|
*base.Player
|
||||||
|
base.LabaLog
|
||||||
leaveTime int32 //离开时间
|
leaveTime int32 //离开时间
|
||||||
SlotsSession *base.SlotsSession
|
SlotsSession *base.SlotsSession
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ func (p *FortuneTigerPlayerData) Clear() {
|
||||||
p.taxCoin = 0
|
p.taxCoin = 0
|
||||||
p.winCoin = 0
|
p.winCoin = 0
|
||||||
p.currentLogId = ""
|
p.currentLogId = ""
|
||||||
|
p.LabaLog.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要带到world上进行数据处理
|
// 需要带到world上进行数据处理
|
||||||
|
|
|
@ -111,6 +111,7 @@ func (this *ScenePolicyFortuneTiger) OnPlayerLeave(s *base.Scene, p *base.Player
|
||||||
}
|
}
|
||||||
logger.Logger.Trace("(this *ScenePolicyFortuneTiger) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
logger.Logger.Trace("(this *ScenePolicyFortuneTiger) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
if playerEx, ok := p.ExtraData.(*FortuneTigerPlayerData); ok {
|
if playerEx, ok := p.ExtraData.(*FortuneTigerPlayerData); ok {
|
||||||
|
playerEx.LabaLog.Save(2) // 没有收到结束消息,算2秒游戏时长
|
||||||
m := playerEx.PushPlayer()
|
m := playerEx.PushPlayer()
|
||||||
if m != nil && len(m) > 0 {
|
if m != nil && len(m) > 0 {
|
||||||
b, err := json.Marshal(m)
|
b, err := json.Marshal(m)
|
||||||
|
@ -480,6 +481,9 @@ func (this *SceneStateStartFortuneTiger) OnPlayerOp(s *base.Scene, p *base.Playe
|
||||||
|
|
||||||
// 记录本次操作
|
// 记录本次操作
|
||||||
FortuneTigerAndSaveLog(sceneEx, playerEx, data)
|
FortuneTigerAndSaveLog(sceneEx, playerEx, data)
|
||||||
|
|
||||||
|
case 1000:
|
||||||
|
playerEx.Save(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -531,11 +535,6 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logid, _ := model.AutoIncGameLogId()
|
logid, _ := model.AutoIncGameLogId()
|
||||||
playerEx.currentLogId = logid
|
playerEx.currentLogId = logid
|
||||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
|
||||||
LogId: logid,
|
|
||||||
Detail: info,
|
|
||||||
GameTime: 2,
|
|
||||||
})
|
|
||||||
var totalin, totalout int64
|
var totalin, totalout int64
|
||||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
totalin = playerEx.totalBet
|
totalin = playerEx.totalBet
|
||||||
|
@ -543,7 +542,10 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig
|
||||||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||||
}
|
}
|
||||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
playerEx.Cache(sceneEx.Scene, &base.SaveGameDetailedParam{
|
||||||
|
LogId: logid,
|
||||||
|
Detail: info,
|
||||||
|
}, &base.SaveGamePlayerListLogParam{
|
||||||
LogId: logid,
|
LogId: logid,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
|
@ -555,7 +557,6 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig
|
||||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||||
IsFree: totalin == 0,
|
IsFree: totalin == 0,
|
||||||
GameTime: 2,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -513,6 +513,8 @@ message ASQueryOnlineReportList{
|
||||||
int32 OrderType = 6;//排序方式 0,、倒序 1、正序
|
int32 OrderType = 6;//排序方式 0,、倒序 1、正序
|
||||||
int32 GameFreeId = 7;
|
int32 GameFreeId = 7;
|
||||||
string Channel = 8;
|
string Channel = 8;
|
||||||
|
string GameDif = 9; // 游戏组
|
||||||
|
string ChannelId = 10; // 推广渠道ID
|
||||||
}
|
}
|
||||||
message SAQueryOnlineReportList{
|
message SAQueryOnlineReportList{
|
||||||
TagCode Tag = 1; //错误码
|
TagCode Tag = 1; //错误码
|
||||||
|
|
|
@ -9,13 +9,13 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type LogLogin struct {
|
type LogLogin struct {
|
||||||
ID uint `gorm:"primaryKey"`
|
ID uint `gorm:"primaryKey"`
|
||||||
Snid int `gorm:"index"`
|
Snid int `gorm:"index"`
|
||||||
OnlineType int `gorm:"index"`
|
OnlineType int `gorm:"index"`
|
||||||
//OnlineTs int `gorm:"index"`
|
OnlineTs int64 `gorm:"index"`
|
||||||
OnlineTime time.Time `gorm:"index"`
|
OnlineTime time.Time `gorm:"index"`
|
||||||
OfflineType int `gorm:"index"`
|
OfflineType int `gorm:"index"`
|
||||||
//OfflineTs int `gorm:"index"`
|
OfflineTs int64 `gorm:"index"`
|
||||||
OfflineTime time.Time `gorm:"index"`
|
OfflineTime time.Time `gorm:"index"`
|
||||||
ChannelId string `gorm:"index"` // 推广渠道
|
ChannelId string `gorm:"index"` // 推广渠道
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ var Tables = []interface{}{
|
||||||
&LogLogin{},
|
&LogLogin{},
|
||||||
&LogLoginMid{},
|
&LogLoginMid{},
|
||||||
&UserAccount{},
|
&UserAccount{},
|
||||||
&UserLogin{},
|
//&UserLogin{},
|
||||||
&UserID{},
|
//&UserID{},
|
||||||
&LogInviteScoreMid{},
|
&LogInviteScoreMid{},
|
||||||
&LogInviteScore{},
|
&LogInviteScore{},
|
||||||
&LogInviteUser{},
|
&LogInviteUser{},
|
||||||
|
|
|
@ -8,6 +8,7 @@ type UserAccount struct {
|
||||||
Snid int `gorm:"index"`
|
Snid int `gorm:"index"`
|
||||||
//RegisterTs int `gorm:"index"`
|
//RegisterTs int `gorm:"index"`
|
||||||
RegisterTime time.Time `gorm:"index"`
|
RegisterTime time.Time `gorm:"index"`
|
||||||
|
RegisterTs int64 `gorm:"index"`
|
||||||
ChannelId string `gorm:"index"` // 推广渠道
|
ChannelId string `gorm:"index"` // 推广渠道
|
||||||
|
|
||||||
DeviceName string `gorm:"index"`
|
DeviceName string `gorm:"index"`
|
||||||
|
|
|
@ -91,12 +91,12 @@ func LogLogin(platform string, batchSize int) ([]*mysqlmodel.LogLogin, error) {
|
||||||
|
|
||||||
if n == 0 {
|
if n == 0 {
|
||||||
e = &mysqlmodel.LogLogin{
|
e = &mysqlmodel.LogLogin{
|
||||||
Snid: int(v.SnId),
|
Snid: int(v.SnId),
|
||||||
OnlineType: onlineType,
|
OnlineType: onlineType,
|
||||||
//OnlineTs: int(v.Ts),
|
OnlineTs: v.Time.Unix(),
|
||||||
OnlineTime: v.Time,
|
OnlineTime: v.Time,
|
||||||
OfflineType: 0,
|
OfflineType: 0,
|
||||||
//OfflineTs: 0,
|
OfflineTs: 0,
|
||||||
OfflineTime: v.Time,
|
OfflineTime: v.Time,
|
||||||
DeviceName: v.DeviceName,
|
DeviceName: v.DeviceName,
|
||||||
AppVersion: v.AppVersion,
|
AppVersion: v.AppVersion,
|
||||||
|
@ -132,7 +132,7 @@ func LogLogin(platform string, batchSize int) ([]*mysqlmodel.LogLogin, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
e.OfflineType = mysqlmodel.LogTypeOffline
|
e.OfflineType = mysqlmodel.LogTypeOffline
|
||||||
//e.OfflineTs = int(v.Ts)
|
e.OfflineTs = v.Time.Unix()
|
||||||
e.OfflineTime = v.Time
|
e.OfflineTime = v.Time
|
||||||
if err = db.Model(e).Select("OfflineType", "OfflineTime").Updates(e).Error; err != nil {
|
if err = db.Model(e).Select("OfflineType", "OfflineTime").Updates(e).Error; err != nil {
|
||||||
logger.Logger.Errorf("mysql: SyncLogLogin failed to update log_login: %v", err)
|
logger.Logger.Errorf("mysql: SyncLogLogin failed to update log_login: %v", err)
|
||||||
|
|
|
@ -68,9 +68,9 @@ func UserAccount(platform string, batchSize int) ([]*mysqlmodel.UserAccount, err
|
||||||
for _, v := range accounts {
|
for _, v := range accounts {
|
||||||
logger.Logger.Tracef("mongo account: %+v", *v)
|
logger.Logger.Tracef("mongo account: %+v", *v)
|
||||||
a := &mysqlmodel.UserAccount{
|
a := &mysqlmodel.UserAccount{
|
||||||
MID: v.AccountId.Hex(),
|
MID: v.AccountId.Hex(),
|
||||||
Snid: int(v.SnId),
|
Snid: int(v.SnId),
|
||||||
//RegisterTs: int(v.RegisterTs),
|
RegisterTs: v.RegisteTime.Unix(),
|
||||||
RegisterTime: v.RegisteTime,
|
RegisterTime: v.RegisteTime,
|
||||||
Tel: v.Tel,
|
Tel: v.Tel,
|
||||||
ChannelId: v.ChannelId,
|
ChannelId: v.ChannelId,
|
||||||
|
@ -81,17 +81,17 @@ func UserAccount(platform string, batchSize int) ([]*mysqlmodel.UserAccount, err
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = tx.First(&mysqlmodel.UserID{}, "snid = ?", v.SnId).Error; err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
|
//if err = tx.First(&mysqlmodel.UserID{}, "snid = ?", v.SnId).Error; err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
logger.Logger.Errorf("mysql: UserAccount failed to find user_id: %v", err)
|
// logger.Logger.Errorf("mysql: UserAccount failed to find user_id: %v", err)
|
||||||
return err
|
// return err
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
//if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
if err = tx.Create(&mysqlmodel.UserID{Snid: int(v.SnId)}).Error; err != nil {
|
// if err = tx.Create(&mysqlmodel.UserID{Snid: int(v.SnId)}).Error; err != nil {
|
||||||
logger.Logger.Errorf("mysql: UserAccount failed to create user_id: %v", err)
|
// logger.Logger.Errorf("mysql: UserAccount failed to create user_id: %v", err)
|
||||||
return err
|
// return err
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
as = append(as, a)
|
as = append(as, a)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1113,12 +1113,10 @@ func init() {
|
||||||
pack.Msg = "数据序列化失败" + err.Error()
|
pack.Msg = "数据序列化失败" + err.Error()
|
||||||
return common.ResponseTag_ParamError, pack
|
return common.ResponseTag_ParamError, pack
|
||||||
}
|
}
|
||||||
platform := msg.Platform
|
|
||||||
pageNo := msg.PageNo
|
pageNo := msg.PageNo
|
||||||
pageSize := msg.PageSize
|
pageSize := msg.PageSize
|
||||||
orderColumn := msg.OrderColumn
|
orderColumn := msg.OrderColumn
|
||||||
orderType := msg.OrderType
|
orderType := msg.OrderType
|
||||||
channel := msg.Channel
|
|
||||||
|
|
||||||
start := (pageNo - 1) * pageSize
|
start := (pageNo - 1) * pageSize
|
||||||
end := pageNo * pageSize
|
end := pageNo * pageSize
|
||||||
|
@ -1132,21 +1130,37 @@ func init() {
|
||||||
if !p.IsOnLine() {
|
if !p.IsOnLine() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if msg.GameFreeId == 0 {
|
if msg.GameDif != "" {
|
||||||
if msg.GameId != 0 && (p.scene == nil || p.scene.gameId != int(msg.GameId)) {
|
if p.scene == nil || p.scene.dbGameFree.GetGameDif() != msg.GameDif {
|
||||||
continue
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if p.scene == nil || p.scene.dbGameFree.GetId() != msg.GameFreeId {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if platform != DefaultPlatform && p.Platform != platform {
|
if msg.ChannelId != "" {
|
||||||
continue
|
if p.ChannelId != msg.ChannelId {
|
||||||
}
|
continue
|
||||||
if channel != "" && p.Channel != channel {
|
}
|
||||||
|
}
|
||||||
|
if msg.GameFreeId > 0 {
|
||||||
|
if p.scene == nil || p.scene.GetGameFreeId() != msg.GameFreeId {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msg.GameId > 0 {
|
||||||
|
if p.scene == nil || p.scene.gameId != int(msg.GameId) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.Platform != DefaultPlatform && msg.Platform != "" {
|
||||||
|
if p.Platform != msg.Platform {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.Channel != "" && p.Channel != msg.Channel {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
players = append(players, p)
|
players = append(players, p)
|
||||||
}
|
}
|
||||||
// 排序
|
// 排序
|
||||||
|
|
Loading…
Reference in New Issue