Compare commits
8 Commits
bcbc162549
...
1f24dd29b6
Author | SHA1 | Date |
---|---|---|
|
1f24dd29b6 | |
|
4b29c43709 | |
|
4e59c6600c | |
|
442801fc9a | |
|
490576b1dc | |
|
2c48adeca7 | |
|
43c3d3571b | |
|
779d8a64a4 |
|
@ -47,3 +47,5 @@ tools/xlsx2binary/agc.go
|
||||||
/ranksrv/ranksrv
|
/ranksrv/ranksrv
|
||||||
/schedulesrv/schedulesrv
|
/schedulesrv/schedulesrv
|
||||||
/machine/machine
|
/machine/machine
|
||||||
|
/statistics/statistics
|
||||||
|
/statistics/task/task*
|
|
@ -1,8 +1,8 @@
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
xcopy ..\data\* .\data\ /s /e /y /exclude:..\shell\exclude.txt
|
xcopy ..\data\* .\data\ /s /e /y /exclude:..\exclude.txt
|
||||||
|
|
||||||
for /f %%i in (../shell/programs.txt) do (
|
for /f %%i in (../programs.txt) do (
|
||||||
echo go build %%i
|
echo go build %%i
|
||||||
go build -o ./%%i/%%i.exe ../%%i/
|
go build -o ./%%i/%%i.exe ../%%i/
|
||||||
)
|
)
|
||||||
|
|
|
@ -898,3 +898,7 @@ var GuideIdToGainWay = map[int]int{
|
||||||
GuideIdNewPlayer: GainWayGuide,
|
GuideIdNewPlayer: GainWayGuide,
|
||||||
GuideIdCustom: GainWayGuide2,
|
GuideIdCustom: GainWayGuide2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetGameDifKey(gamedif string) string {
|
||||||
|
return fmt.Sprintf("gamedif-%v", gamedif)
|
||||||
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ func GameDetailedLogsCollection(plt string) *mongo.Collection {
|
||||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"ts", "cycleid"}, Background: true, Sparse: true})
|
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"ts", "cycleid"}, Background: true, Sparse: true})
|
||||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"time", "cycleid"}, Background: true, Sparse: true})
|
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"time", "cycleid"}, Background: true, Sparse: true})
|
||||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-time", "cycleid"}, Background: true, Sparse: true})
|
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-time", "cycleid"}, Background: true, Sparse: true})
|
||||||
|
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"gamedif"}, Background: true, Sparse: true})
|
||||||
}
|
}
|
||||||
return c_gamedetailed
|
return c_gamedetailed
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ func GamePlayerListLogsCollection(plt string) *mongo.Collection {
|
||||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "cycleid"}, Background: true, Sparse: true})
|
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "cycleid"}, Background: true, Sparse: true})
|
||||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"cycleid"}, Background: true, Sparse: true})
|
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"cycleid"}, Background: true, Sparse: true})
|
||||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"ts", "cycleid"}, Background: true, Sparse: true})
|
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"ts", "cycleid"}, Background: true, Sparse: true})
|
||||||
|
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"gamedif"}, Background: true, Sparse: true})
|
||||||
}
|
}
|
||||||
return c_gameplayerlistlog
|
return c_gameplayerlistlog
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ func ItemLogsCollection(plt string) *mongo.Collection {
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid", "roomconfigid"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid", "roomconfigid"}, Background: true, Sparse: true})
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
|
||||||
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gamedif"}, Background: true, Sparse: true})
|
||||||
}
|
}
|
||||||
return c_itemlog
|
return c_itemlog
|
||||||
}
|
}
|
||||||
|
|
|
@ -945,8 +945,6 @@ func AvengersCheckAndSaveLog(sceneEx *AvengersSceneData, playerEx *AvengersPlaye
|
||||||
LogId: logid,
|
LogId: logid,
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -44,13 +44,16 @@ func (this *Scene) SaveGameDetailedLog(param *SaveGameDetailedParam) *SaveGameDe
|
||||||
f := func(plt string) {
|
f := func(plt string) {
|
||||||
log := &model.GameDetailedLog{
|
log := &model.GameDetailedLog{
|
||||||
Id: bson.NewObjectId(),
|
Id: bson.NewObjectId(),
|
||||||
LogId: param.LogId,
|
|
||||||
GameId: this.GameId,
|
|
||||||
Platform: plt,
|
Platform: plt,
|
||||||
|
LogId: param.LogId,
|
||||||
|
GameDif: this.GetDBGameFree().GetGameDif(),
|
||||||
|
GameId: this.GetDBGameFree().GetGameId(),
|
||||||
|
GameClass: this.GetDBGameFree().GetGameClass(),
|
||||||
|
GameMode: this.GetDBGameFree().GetGameMode(),
|
||||||
|
GameType: this.GetDBGameFree().GetGameType(),
|
||||||
|
GameFreeId: this.GetDBGameFree().GetId(),
|
||||||
MatchId: this.GetMatch().GetMatchSortId(),
|
MatchId: this.GetMatch().GetMatchSortId(),
|
||||||
SceneId: this.SceneId,
|
SceneId: this.SceneId,
|
||||||
GameMode: this.GameMode,
|
|
||||||
GameFreeid: this.GetGameFreeId(),
|
|
||||||
PlayerCount: int32(len(this.Players)),
|
PlayerCount: int32(len(this.Players)),
|
||||||
GameTiming: int32(param.GameTime),
|
GameTiming: int32(param.GameTime),
|
||||||
GameBaseBet: this.GetBaseScore(),
|
GameBaseBet: this.GetBaseScore(),
|
||||||
|
@ -98,8 +101,6 @@ type SaveGamePlayerListLogParam struct {
|
||||||
Platform string // 平台
|
Platform string // 平台
|
||||||
Snid int32 // 玩家id
|
Snid int32 // 玩家id
|
||||||
PlayerName string // 玩家名字
|
PlayerName string // 玩家名字
|
||||||
Channel string // 渠道
|
|
||||||
ChannelId string // 推广渠道
|
|
||||||
TotalIn int64 // 总投入
|
TotalIn int64 // 总投入
|
||||||
TotalOut int64 // 总产出(税前)
|
TotalOut int64 // 总产出(税前)
|
||||||
TaxCoin int64 // 总税收
|
TaxCoin int64 // 总税收
|
||||||
|
@ -155,33 +156,35 @@ func (this *Scene) SaveGamePlayerListLog(param *SaveGamePlayerListLogParam) *Sav
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
log := &model.GamePlayerListLog{
|
log := &model.GamePlayerListLog{
|
||||||
LogId: bson.NewObjectId(),
|
LogId: bson.NewObjectId(),
|
||||||
|
Platform: param.Platform,
|
||||||
|
GameDif: this.GetDBGameFree().GetGameDif(),
|
||||||
|
GameId: this.GetDBGameFree().GetGameId(),
|
||||||
|
GameClass: this.GetDBGameFree().GetGameClass(),
|
||||||
|
GameMode: this.GetDBGameFree().GetGameMode(),
|
||||||
|
GameType: this.GetDBGameFree().GetGameType(),
|
||||||
|
GameFreeId: this.GetGameFreeId(),
|
||||||
|
BaseScore: baseScore,
|
||||||
|
GameDetailedLogId: param.LogId,
|
||||||
|
Channel: p.Channel,
|
||||||
|
ChannelId: p.ChannelId,
|
||||||
|
RoomType: this.SceneMode,
|
||||||
|
Ts: now.Unix(),
|
||||||
|
Time: now,
|
||||||
|
CycleId: this.CycleID,
|
||||||
SnId: p.SnId,
|
SnId: p.SnId,
|
||||||
Name: param.PlayerName,
|
Name: param.PlayerName,
|
||||||
GameId: this.GameId,
|
|
||||||
BaseScore: baseScore,
|
|
||||||
TaxCoin: param.TaxCoin,
|
|
||||||
Platform: param.Platform,
|
|
||||||
Channel: param.Channel,
|
|
||||||
SceneId: this.SceneId,
|
SceneId: this.SceneId,
|
||||||
GameMode: this.GameMode,
|
|
||||||
GameFreeid: this.GetGameFreeId(),
|
|
||||||
GameDetailedLogId: param.LogId,
|
|
||||||
IsFirstGame: param.IsFirstGame,
|
|
||||||
BetAmount: param.BetAmount,
|
|
||||||
WinAmountNoAnyTax: param.WinAmountNoAnyTax,
|
|
||||||
TotalIn: param.TotalIn,
|
|
||||||
TotalOut: param.TotalOut,
|
|
||||||
Time: now,
|
|
||||||
RoomType: this.SceneMode,
|
|
||||||
GameDif: this.GetDBGameFree().GetGameDif(),
|
|
||||||
GameClass: this.GetDBGameFree().GetGameClass(),
|
|
||||||
MatchId: this.GetMatch().GetMatchSortId(),
|
MatchId: this.GetMatch().GetMatchSortId(),
|
||||||
MatchType: int64(this.GetMatch().GetMatchType()),
|
MatchType: int64(this.GetMatch().GetMatchType()),
|
||||||
Ts: now.Unix(),
|
WinAmountNoAnyTax: param.WinAmountNoAnyTax,
|
||||||
|
TaxCoin: param.TaxCoin,
|
||||||
|
BetAmount: param.BetAmount,
|
||||||
|
IsFirstGame: param.IsFirstGame,
|
||||||
|
TotalIn: param.TotalIn,
|
||||||
|
TotalOut: param.TotalOut,
|
||||||
IsFree: param.IsFree,
|
IsFree: param.IsFree,
|
||||||
WinSmallGame: param.WinSmallGame,
|
WinSmallGame: param.WinSmallGame,
|
||||||
WinTotal: param.WinTotal,
|
WinTotal: param.WinTotal,
|
||||||
CycleId: this.CycleID,
|
|
||||||
}
|
}
|
||||||
if param.OnlyLog {
|
if param.OnlyLog {
|
||||||
ret.Log = append(ret.Log, log)
|
ret.Log = append(ret.Log, log)
|
||||||
|
@ -223,10 +226,11 @@ func (s *SaveGameDetailedCopy) Save() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// LabaLog 拉霸缓存游戏记录
|
// LabaLog 拉霸缓存游戏记录,为了统计游戏时长
|
||||||
type LabaLog struct {
|
type LabaLog struct {
|
||||||
PlayerListLog *SaveGamePlayerListLogCopy
|
PlayerListLog *SaveGamePlayerListLogCopy
|
||||||
GameDetailLog *SaveGameDetailedCopy
|
GameDetailLog *SaveGameDetailedCopy
|
||||||
|
CacheTime time.Time // 缓存时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache 临时缓存
|
// Cache 临时缓存
|
||||||
|
@ -238,13 +242,31 @@ func (l *LabaLog) Cache(s *Scene, detailLog *SaveGameDetailedParam, playerListLo
|
||||||
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()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save 保存
|
// Save 保存
|
||||||
func (l *LabaLog) Save(f func(log *LabaLog)) {
|
func (l *LabaLog) Save(second int32) {
|
||||||
f(l)
|
if second <= 0 {
|
||||||
|
second = int32(time.Now().Sub(l.CacheTime).Seconds())
|
||||||
|
}
|
||||||
|
|
||||||
|
if l.PlayerListLog != nil {
|
||||||
|
if l.PlayerListLog.UpLog != nil {
|
||||||
|
for _, v := range l.PlayerListLog.UpLog.Log {
|
||||||
|
v.GamingTime = second
|
||||||
|
}
|
||||||
|
}
|
||||||
l.PlayerListLog.Save()
|
l.PlayerListLog.Save()
|
||||||
|
}
|
||||||
|
|
||||||
|
if l.GameDetailLog != nil {
|
||||||
|
for _, v := range l.GameDetailLog.Log {
|
||||||
|
v.GameTiming = second
|
||||||
|
}
|
||||||
l.GameDetailLog.Save()
|
l.GameDetailLog.Save()
|
||||||
|
}
|
||||||
|
|
||||||
l.Clear()
|
l.Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,4 +274,5 @@ func (l *LabaLog) Save(f func(log *LabaLog)) {
|
||||||
func (l *LabaLog) Clear() {
|
func (l *LabaLog) Clear() {
|
||||||
l.PlayerListLog = nil
|
l.PlayerListLog = nil
|
||||||
l.GameDetailLog = nil
|
l.GameDetailLog = nil
|
||||||
|
l.CacheTime = time.Time{}
|
||||||
}
|
}
|
||||||
|
|
|
@ -638,8 +638,8 @@ type ReportGameEventOnly struct {
|
||||||
|
|
||||||
func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEventOnly {
|
func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEventOnly {
|
||||||
// 记录玩家 首次参与该场次的游戏时间 游戏次数
|
// 记录玩家 首次参与该场次的游戏时间 游戏次数
|
||||||
var gameFirstTime, gameFreeFirstTime time.Time
|
var gameFirstTime, gameFreeFirstTime, gamedifFirstTime time.Time
|
||||||
var gameTimes, gameFreeTimes int64
|
var gameTimes, gameFreeTimes, gamedifTimes int64
|
||||||
data, ok := this.GDatas[this.scene.KeyGamefreeId]
|
data, ok := this.GDatas[this.scene.KeyGamefreeId]
|
||||||
if ok {
|
if ok {
|
||||||
gameFreeFirstTime = data.FirstTime
|
gameFreeFirstTime = data.FirstTime
|
||||||
|
@ -659,7 +659,7 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
isNew = 1
|
isNew = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if param.GameTime < 0 {
|
if param.GameTime <= 0 {
|
||||||
param.GameTime = int64(time.Now().Sub(this.scene.GameNowTime).Seconds())
|
param.GameTime = int64(time.Now().Sub(this.scene.GameNowTime).Seconds())
|
||||||
}
|
}
|
||||||
if param.GameTime < 0 {
|
if param.GameTime < 0 {
|
||||||
|
@ -670,30 +670,31 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
ret.Param = param
|
ret.Param = param
|
||||||
log := &model.PlayerGameRecEvent{
|
log := &model.PlayerGameRecEvent{
|
||||||
Id: primitive.NewObjectID().Hex(),
|
Id: primitive.NewObjectID().Hex(),
|
||||||
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,
|
Platform: this.Platform,
|
||||||
//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,
|
||||||
Tax: param.Tax,
|
Tax: param.Tax,
|
||||||
Amount: param.Change,
|
Amount: param.Change,
|
||||||
CreateTime: this.CreateTime.Unix(),
|
CreateTime: time.Now().Unix(),
|
||||||
CreateDayTime: tCreateDay.Unix(),
|
CreateDayTime: tCreateDay.Unix(),
|
||||||
Out: param.Out,
|
Out: param.Out,
|
||||||
In: param.In,
|
In: param.In,
|
||||||
IsNew: isNew,
|
IsNew: isNew,
|
||||||
GameFreeID: this.scene.GetGameFreeId(),
|
GameFreeID: this.scene.GetGameFreeId(),
|
||||||
GamingTime: int32(param.GameTime),
|
GamingTime: int32(param.GameTime),
|
||||||
|
GameDif: this.scene.GetDBGameFree().GetGameDif(),
|
||||||
|
FirstGameDifTime: gamedifFirstTime.Unix(),
|
||||||
|
GameDifTimes: gamedifTimes,
|
||||||
FirstTime: gameFreeFirstTime.Unix(),
|
FirstTime: gameFreeFirstTime.Unix(),
|
||||||
PlayTimes: gameFreeTimes,
|
PlayTimes: gameFreeTimes,
|
||||||
FirstGameTime: gameFirstTime.Unix(),
|
FirstGameTime: gameFirstTime.Unix(),
|
||||||
PlayGameTimes: gameTimes,
|
PlayGameTimes: gameTimes,
|
||||||
LastLoginTime: this.LastLoginTime.Unix(),
|
LastLoginTime: this.LastLoginTime.Unix(),
|
||||||
//DeviceId: this.DeviceId,
|
ChannelId: this.ChannelId,
|
||||||
}
|
}
|
||||||
if param.OnlyLog {
|
if param.OnlyLog {
|
||||||
ret.Log = append(ret.Log, log)
|
ret.Log = append(ret.Log, log)
|
||||||
|
|
|
@ -2057,6 +2057,7 @@ func (this *Scene) IsControl(hasRobotGaming bool) bool {
|
||||||
|
|
||||||
// Statistics 玩家游戏数据统计
|
// Statistics 玩家游戏数据统计
|
||||||
// 包含水池统计,黑白名单统计,新手调控统计,个人水池统计
|
// 包含水池统计,黑白名单统计,新手调控统计,个人水池统计
|
||||||
|
// 拉霸游戏数据统计,一次下注记录一次 StaticsLaba
|
||||||
func (this *Scene) Statistics(param *StaticParam) {
|
func (this *Scene) Statistics(param *StaticParam) {
|
||||||
if param == nil {
|
if param == nil {
|
||||||
return
|
return
|
||||||
|
@ -2110,6 +2111,7 @@ func (this *Scene) Statistics(param *StaticParam) {
|
||||||
var statics []*model.PlayerGameStatics
|
var statics []*model.PlayerGameStatics
|
||||||
keyGameId := strconv.Itoa(this.GetGameId())
|
keyGameId := strconv.Itoa(this.GetGameId())
|
||||||
keyGameFreeId := strconv.Itoa(int(this.GetGameFreeId()))
|
keyGameFreeId := strconv.Itoa(int(this.GetGameFreeId()))
|
||||||
|
keyGameDif := common.GetGameDifKey(this.GetDBGameFree().GetGameDif())
|
||||||
// 当天数据统计
|
// 当天数据统计
|
||||||
// 按场次分
|
// 按场次分
|
||||||
if data, ok := p.TodayGameData.CtrlData[keyGameFreeId]; ok {
|
if data, ok := p.TodayGameData.CtrlData[keyGameFreeId]; ok {
|
||||||
|
@ -2127,6 +2129,14 @@ func (this *Scene) Statistics(param *StaticParam) {
|
||||||
p.TodayGameData.CtrlData[keyGameId] = data
|
p.TodayGameData.CtrlData[keyGameId] = data
|
||||||
statics = append(statics, data)
|
statics = append(statics, data)
|
||||||
}
|
}
|
||||||
|
// 按游戏组分
|
||||||
|
if data, ok := p.TodayGameData.CtrlData[keyGameDif]; ok {
|
||||||
|
statics = append(statics, data)
|
||||||
|
} else {
|
||||||
|
data = model.NewPlayerGameStatics()
|
||||||
|
p.TodayGameData.CtrlData[keyGameDif] = data
|
||||||
|
statics = append(statics, data)
|
||||||
|
}
|
||||||
// 按场次分
|
// 按场次分
|
||||||
if data, ok := p.GDatas[keyGameFreeId]; ok {
|
if data, ok := p.GDatas[keyGameFreeId]; ok {
|
||||||
if data.FirstTime.IsZero() {
|
if data.FirstTime.IsZero() {
|
||||||
|
@ -2149,6 +2159,27 @@ func (this *Scene) Statistics(param *StaticParam) {
|
||||||
p.GDatas[keyGameId] = data
|
p.GDatas[keyGameId] = data
|
||||||
statics = append(statics, &data.Statics)
|
statics = append(statics, &data.Statics)
|
||||||
}
|
}
|
||||||
|
//按游戏组分
|
||||||
|
getMinTime := func() time.Time {
|
||||||
|
var minTime = time.Now()
|
||||||
|
for _, v := range srvdata.GameFreeMgr.GetGameId(this.GetDBGameFree().GetGameDif()) {
|
||||||
|
vv := p.GDatas[strconv.Itoa(int(v))]
|
||||||
|
if vv != nil && vv.FirstTime.Before(minTime) {
|
||||||
|
minTime = vv.FirstTime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return minTime
|
||||||
|
}
|
||||||
|
if data, ok := p.GDatas[keyGameDif]; ok {
|
||||||
|
if data.FirstTime.IsZero() {
|
||||||
|
data.FirstTime = getMinTime()
|
||||||
|
}
|
||||||
|
statics = append(statics, &data.Statics)
|
||||||
|
} else {
|
||||||
|
data = &model.PlayerGameInfo{FirstTime: getMinTime()}
|
||||||
|
p.GDatas[keyGameDif] = data
|
||||||
|
statics = append(statics, &data.Statics)
|
||||||
|
}
|
||||||
|
|
||||||
// 新手输赢统计
|
// 新手输赢统计
|
||||||
if !model.GameParamData.CloseNovice && !common.InSliceInt(model.GameParamData.CloseNoviceGame, int(this.GameId)) && isControl && wbLevel == 0 && isNovice {
|
if !model.GameParamData.CloseNovice && !common.InSliceInt(model.GameParamData.CloseNoviceGame, int(this.GameId)) && isControl && wbLevel == 0 && isNovice {
|
||||||
|
@ -2319,6 +2350,7 @@ func (this *Scene) StaticsLaba(param *StaticLabaParam) {
|
||||||
var statics []*model.PlayerGameStatics
|
var statics []*model.PlayerGameStatics
|
||||||
keyGameId := strconv.Itoa(this.GetGameId())
|
keyGameId := strconv.Itoa(this.GetGameId())
|
||||||
keyGameFreeId := strconv.Itoa(int(this.GetGameFreeId()))
|
keyGameFreeId := strconv.Itoa(int(this.GetGameFreeId()))
|
||||||
|
keyGameDif := common.GetGameDifKey(this.GetDBGameFree().GetGameDif())
|
||||||
// 当天数据统计
|
// 当天数据统计
|
||||||
// 按场次分
|
// 按场次分
|
||||||
if data, ok := p.TodayGameData.CtrlData[keyGameFreeId]; ok {
|
if data, ok := p.TodayGameData.CtrlData[keyGameFreeId]; ok {
|
||||||
|
@ -2336,6 +2368,14 @@ func (this *Scene) StaticsLaba(param *StaticLabaParam) {
|
||||||
p.TodayGameData.CtrlData[keyGameId] = data
|
p.TodayGameData.CtrlData[keyGameId] = data
|
||||||
statics = append(statics, data)
|
statics = append(statics, data)
|
||||||
}
|
}
|
||||||
|
// 按游戏组
|
||||||
|
if data, ok := p.TodayGameData.CtrlData[keyGameDif]; ok {
|
||||||
|
statics = append(statics, data)
|
||||||
|
} else {
|
||||||
|
data = model.NewPlayerGameStatics()
|
||||||
|
p.TodayGameData.CtrlData[keyGameDif] = data
|
||||||
|
statics = append(statics, data)
|
||||||
|
}
|
||||||
// 按场次分
|
// 按场次分
|
||||||
if data, ok := p.GDatas[keyGameFreeId]; ok {
|
if data, ok := p.GDatas[keyGameFreeId]; ok {
|
||||||
if data.FirstTime.IsZero() {
|
if data.FirstTime.IsZero() {
|
||||||
|
@ -2358,6 +2398,27 @@ func (this *Scene) StaticsLaba(param *StaticLabaParam) {
|
||||||
p.GDatas[keyGameId] = data
|
p.GDatas[keyGameId] = data
|
||||||
statics = append(statics, &data.Statics)
|
statics = append(statics, &data.Statics)
|
||||||
}
|
}
|
||||||
|
// 按游戏组
|
||||||
|
getMinTime := func() time.Time {
|
||||||
|
var minTime = time.Now()
|
||||||
|
for _, v := range srvdata.GameFreeMgr.GetGameId(this.GetDBGameFree().GetGameDif()) {
|
||||||
|
vv := p.GDatas[strconv.Itoa(int(v))]
|
||||||
|
if vv != nil && vv.FirstTime.Before(minTime) {
|
||||||
|
minTime = vv.FirstTime
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return minTime
|
||||||
|
}
|
||||||
|
if data, ok := p.GDatas[keyGameDif]; ok {
|
||||||
|
if data.FirstTime.IsZero() {
|
||||||
|
data.FirstTime = getMinTime()
|
||||||
|
}
|
||||||
|
statics = append(statics, &data.Statics)
|
||||||
|
} else {
|
||||||
|
data = &model.PlayerGameInfo{FirstTime: getMinTime()}
|
||||||
|
p.GDatas[keyGameDif] = data
|
||||||
|
statics = append(statics, &data.Statics)
|
||||||
|
}
|
||||||
|
|
||||||
for _, data := range statics {
|
for _, data := range statics {
|
||||||
if data != nil {
|
if data != nil {
|
||||||
|
|
|
@ -1035,8 +1035,6 @@ func CaiShenCheckAndSaveLog(sceneEx *CaiShenSceneData, playerEx *CaiShenPlayerDa
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -1315,8 +1315,6 @@ func (this *SceneStateBilled) OnEnter(s *base.Scene) {
|
||||||
Platform: o_player.Platform,
|
Platform: o_player.Platform,
|
||||||
Snid: o_player.UserId,
|
Snid: o_player.UserId,
|
||||||
PlayerName: "",
|
PlayerName: "",
|
||||||
Channel: o_player.Channel,
|
|
||||||
ChannelId: o_player.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: o_player.GainTaxCoin,
|
TaxCoin: o_player.GainTaxCoin,
|
||||||
|
|
|
@ -795,8 +795,6 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -904,8 +904,6 @@ func EasterIslandCheckAndSaveLog(sceneEx *EasterIslandSceneData, playerEx *Easte
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -267,8 +267,6 @@ func (this *FishingPlayerData) SaveDetailedLog(s *base.Scene) {
|
||||||
Platform: this.Platform,
|
Platform: this.Platform,
|
||||||
Snid: this.SnId,
|
Snid: this.SnId,
|
||||||
PlayerName: this.Name,
|
PlayerName: this.Name,
|
||||||
Channel: this.Channel,
|
|
||||||
ChannelId: this.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: int64(this.sTaxCoin),
|
TaxCoin: int64(this.sTaxCoin),
|
||||||
|
|
|
@ -537,8 +537,6 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -548,8 +548,6 @@ func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMou
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -548,8 +548,6 @@ func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerD
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -535,8 +535,6 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -548,8 +548,6 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -345,8 +345,6 @@ func (s *FruitsSceneData) SaveLog(p *FruitsPlayerData, isOffline int) {
|
||||||
Platform: p.Platform,
|
Platform: p.Platform,
|
||||||
Snid: p.SnId,
|
Snid: p.SnId,
|
||||||
PlayerName: p.Name,
|
PlayerName: p.Name,
|
||||||
Channel: p.Channel,
|
|
||||||
ChannelId: p.ChannelId,
|
|
||||||
TotalIn: totalIn,
|
TotalIn: totalIn,
|
||||||
TotalOut: totalOut,
|
TotalOut: totalOut,
|
||||||
TaxCoin: p.taxCoin,
|
TaxCoin: p.taxCoin,
|
||||||
|
|
|
@ -954,8 +954,6 @@ func IceAgeCheckAndSaveLog(sceneEx *IceAgeSceneData, playerEx *IceAgePlayerData)
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -367,8 +367,6 @@ func (s *RichBlessedSceneData) SaveLog(p *RichBlessedPlayerData, isOffline int)
|
||||||
Platform: p.Platform,
|
Platform: p.Platform,
|
||||||
Snid: p.SnId,
|
Snid: p.SnId,
|
||||||
PlayerName: p.Name,
|
PlayerName: p.Name,
|
||||||
Channel: p.Channel,
|
|
||||||
ChannelId: p.ChannelId,
|
|
||||||
TotalIn: totalIn,
|
TotalIn: totalIn,
|
||||||
TotalOut: totalOut,
|
TotalOut: totalOut,
|
||||||
TaxCoin: p.taxCoin,
|
TaxCoin: p.taxCoin,
|
||||||
|
|
|
@ -1179,8 +1179,6 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
@ -1258,8 +1256,6 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -790,8 +790,6 @@ func TamQuocCheckAndSaveLog(sceneEx *TamQuocSceneData, playerEx *TamQuocPlayerDa
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
|
|
@ -188,8 +188,6 @@ func (this *PolicyThirteen) OnPlayerLeave(s *base.Scene, p *base.Player, reason
|
||||||
Platform: playerEx.Platform,
|
Platform: playerEx.Platform,
|
||||||
Snid: playerEx.SnId,
|
Snid: playerEx.SnId,
|
||||||
PlayerName: playerEx.Name,
|
PlayerName: playerEx.Name,
|
||||||
Channel: playerEx.Channel,
|
|
||||||
ChannelId: playerEx.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: playerEx.taxCoin,
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
@ -1438,8 +1436,6 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
||||||
Platform: o_player.Platform,
|
Platform: o_player.Platform,
|
||||||
Snid: o_player.SnId,
|
Snid: o_player.SnId,
|
||||||
PlayerName: o_player.Name,
|
PlayerName: o_player.Name,
|
||||||
Channel: o_player.Channel,
|
|
||||||
ChannelId: o_player.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: o_player.taxCoin,
|
TaxCoin: o_player.taxCoin,
|
||||||
|
|
|
@ -2761,8 +2761,6 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
LogId: sceneEx.recordId,
|
LogId: sceneEx.recordId,
|
||||||
Platform: o_player.Platform,
|
Platform: o_player.Platform,
|
||||||
Snid: o_player.UserId,
|
Snid: o_player.UserId,
|
||||||
Channel: o_player.Channel,
|
|
||||||
ChannelId: o_player.ChannelId,
|
|
||||||
TotalIn: totalin,
|
TotalIn: totalin,
|
||||||
TotalOut: totalout,
|
TotalOut: totalout,
|
||||||
TaxCoin: o_player.BillTaxCoin,
|
TaxCoin: o_player.BillTaxCoin,
|
||||||
|
|
|
@ -263,7 +263,7 @@ type PlayerGameRecEvent struct {
|
||||||
GameFreeID int32 //游戏freeid
|
GameFreeID int32 //游戏freeid
|
||||||
GamingTime int32 //游戏开始到玩家结算的时长 单位:秒
|
GamingTime int32 //游戏开始到玩家结算的时长 单位:秒
|
||||||
|
|
||||||
GameDif int32 // 游戏分组
|
GameDif string // 游戏分组
|
||||||
FirstGameDifTime int64 // 首次游戏分组时间
|
FirstGameDifTime int64 // 首次游戏分组时间
|
||||||
GameDifTimes int64 // 游戏分组游戏次数
|
GameDifTimes int64 // 游戏分组游戏次数
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,33 @@ type CoinPoolCtx struct {
|
||||||
Controlled bool //被水池控制了
|
Controlled bool //被水池控制了
|
||||||
}
|
}
|
||||||
|
|
||||||
type GameDetailedLogRet struct {
|
type GameDetailedLog struct {
|
||||||
Gplt GameDetailedLogType
|
Id bson.ObjectId `bson:"_id"`
|
||||||
|
Platform string // 平台
|
||||||
|
LogId string // 记录ID,每局游戏唯一
|
||||||
|
GameDif string // 游戏组
|
||||||
|
GameId int32 // 游戏id
|
||||||
|
GameClass int32 // 游戏类型
|
||||||
|
GameMode int32 // 游戏模式,弃用
|
||||||
|
GameType int32 // 游戏类型
|
||||||
|
GameFreeId int32 // 场次id
|
||||||
|
CycleId string // 房卡场id,多轮有相同的id
|
||||||
|
MatchId int64 // 比赛ID,应该用字符串的
|
||||||
|
SceneId int32 // 房间id,会重复
|
||||||
|
PlayerCount int32 // 玩家数量
|
||||||
|
GameTiming int32 // 游戏用时,秒
|
||||||
|
GameBaseBet int32 // 游戏底分
|
||||||
|
Ts int64 // 时间戳
|
||||||
|
Time time.Time // 记录时间
|
||||||
|
GameDetailedNote string // 游戏详情
|
||||||
|
GameDetailVer int32 // 游戏详情版本
|
||||||
|
|
||||||
|
CpCtx CoinPoolCtx // 水池上下文信息
|
||||||
|
Trend20Lately string // 最近游戏走势
|
||||||
|
CtrlType int // 1控赢 2控输 0不控
|
||||||
|
PlayerPool map[int]int // 个人水池分 玩家id:分
|
||||||
}
|
}
|
||||||
|
|
||||||
type GameDetailedLogType struct {
|
type GameDetailedLogType struct {
|
||||||
PageNo int //当前页码
|
PageNo int //当前页码
|
||||||
PageSize int //每页数量
|
PageSize int //每页数量
|
||||||
|
@ -33,64 +57,8 @@ type GameDetailedLogType struct {
|
||||||
Data []*GameDetailedLog //当页数据
|
Data []*GameDetailedLog //当页数据
|
||||||
}
|
}
|
||||||
|
|
||||||
type GameDetailedLog struct {
|
type GameDetailedLogRet struct {
|
||||||
Id bson.ObjectId `bson:"_id"` //记录ID
|
Gplt GameDetailedLogType
|
||||||
LogId string //记录ID,每局游戏唯一
|
|
||||||
GameId int32 //游戏id
|
|
||||||
ClubId int32 //俱乐部Id
|
|
||||||
ClubRoom string //俱乐部包间
|
|
||||||
Platform string //平台id
|
|
||||||
Channel string //渠道
|
|
||||||
Promoter string //推广员
|
|
||||||
MatchId int64 //比赛ID,应该用字符串的
|
|
||||||
SceneId int32 //房间id,会重复
|
|
||||||
GameMode int32 //游戏类型
|
|
||||||
GameFreeid int32 //游戏类型房间号
|
|
||||||
PlayerCount int32 //玩家数量
|
|
||||||
GameTiming int32 //本局游戏用时(mm)
|
|
||||||
GameBaseBet int32 //游戏单位低分
|
|
||||||
GameDetailedNote string //游戏详情
|
|
||||||
GameDetailVer int32 //游戏详情版本
|
|
||||||
CpCtx CoinPoolCtx //水池上下文信息
|
|
||||||
Time time.Time //记录时间
|
|
||||||
Trend20Lately string //最近游戏走势
|
|
||||||
Ts int64 //时间戳
|
|
||||||
CtrlType int // 1控赢 2控输 0不控
|
|
||||||
PlayerPool map[int]int // 个人水池分
|
|
||||||
CycleId string // 本轮id,打一轮有多局
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameDetailedLog() *GameDetailedLog {
|
|
||||||
log := &GameDetailedLog{Id: bson.NewObjectId()}
|
|
||||||
return log
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameDetailedLogEx(logid string, gameid, sceneid, gamemode, gamefreeid, playercount, gametiming, gamebasebet int32,
|
|
||||||
gamedetailednote string, platform string, clubId int32, clubRoom string, cpCtx CoinPoolCtx, ver int32,
|
|
||||||
trend20Lately string, ctrlType int, playerPool map[int]int, cycleId string) *GameDetailedLog {
|
|
||||||
cl := NewGameDetailedLog()
|
|
||||||
cl.LogId = logid
|
|
||||||
cl.GameId = gameid
|
|
||||||
cl.ClubId = clubId
|
|
||||||
cl.ClubRoom = clubRoom
|
|
||||||
cl.SceneId = sceneid
|
|
||||||
cl.GameMode = gamemode
|
|
||||||
cl.GameFreeid = gamefreeid
|
|
||||||
cl.PlayerCount = playercount
|
|
||||||
cl.GameTiming = gametiming
|
|
||||||
cl.GameBaseBet = gamebasebet
|
|
||||||
cl.GameDetailedNote = gamedetailednote
|
|
||||||
cl.Platform = platform
|
|
||||||
tNow := time.Now()
|
|
||||||
cl.Time = tNow
|
|
||||||
cl.CpCtx = cpCtx
|
|
||||||
cl.GameDetailVer = ver
|
|
||||||
cl.Trend20Lately = trend20Lately
|
|
||||||
cl.Ts = time.Now().Unix()
|
|
||||||
cl.CtrlType = ctrlType
|
|
||||||
cl.PlayerPool = playerPool
|
|
||||||
cl.CycleId = cycleId
|
|
||||||
return cl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertGameDetailedLog(log *GameDetailedLog) (err error) {
|
func InsertGameDetailedLog(log *GameDetailedLog) (err error) {
|
||||||
|
|
|
@ -21,86 +21,36 @@ type GameTotalRecord struct {
|
||||||
|
|
||||||
type GamePlayerListLog struct {
|
type GamePlayerListLog struct {
|
||||||
LogId bson.ObjectId `bson:"_id"` //记录ID
|
LogId bson.ObjectId `bson:"_id"` //记录ID
|
||||||
SnId int32 //用户Id
|
Platform string // 平台
|
||||||
Name string //名称
|
GameDif string // 游戏组
|
||||||
GameId int32 //游戏id
|
GameId int32 // 游戏id
|
||||||
BaseScore int32 //游戏底注
|
GameClass int32 // 游戏类型
|
||||||
ClubId int32 //俱乐部Id
|
GameMode int32 // 游戏模式,弃用
|
||||||
ClubRoom string //俱乐部包间
|
GameType int32 // 游戏类型
|
||||||
TaxCoin int64 //税收
|
GameFreeId int32 // 场次id
|
||||||
ClubPumpCoin int64 //俱乐部额外抽水
|
BaseScore int32 // 游戏底注
|
||||||
Platform string //平台id
|
GameDetailedLogId string // 游戏记录Id
|
||||||
Channel string //渠道
|
Channel string // 包类型
|
||||||
Promoter string //推广员
|
ChannelId string // 推广渠道
|
||||||
PackageTag string //包标识
|
RoomType int32 // 房间类型
|
||||||
SceneId int32 //场景ID
|
Ts int64 // 记录时间
|
||||||
GameMode int32 //游戏类型
|
Time time.Time // 记录时间
|
||||||
GameFreeid int32 //游戏类型房间号
|
|
||||||
GameDetailedLogId string //游戏记录Id
|
|
||||||
IsFirstGame bool //是否第一次游戏
|
|
||||||
//对于拉霸类:BetAmount=100 WinAmountNoAnyTax=0 (表示投入多少、收益多少,值>=0)
|
|
||||||
//拉霸类小游戏会是:BetAmount=0 WinAmountNoAnyTax=100 (投入0、收益多少,值>=0)
|
|
||||||
//对战场:BetAmount=0 WinAmountNoAnyTax=100 (投入会有是0、收益有正负,WinAmountNoAnyTax=100则盈利,WinAmountNoAnyTax=-100则输100)
|
|
||||||
BetAmount int64 //下注金额
|
|
||||||
WinAmountNoAnyTax int64 //盈利金额,不包含任何税
|
|
||||||
TotalIn int64 //本局投入
|
|
||||||
TotalOut int64 //本局产出
|
|
||||||
Time time.Time //记录时间
|
|
||||||
RoomType int32 //房间类型
|
|
||||||
GameDif string //游戏标识
|
|
||||||
GameClass int32 //游戏类型 1棋牌 2电子 3百人 4捕鱼 5视讯 6彩票 7体育
|
|
||||||
MatchId int64
|
|
||||||
MatchType int64 //0.普通场 1.锦标赛 2.冠军赛 3.vip专属
|
|
||||||
Ts int64
|
|
||||||
IsFree bool //拉霸专用 是否免费
|
|
||||||
WinSmallGame int64 //拉霸专用 小游戏奖励
|
|
||||||
WinTotal int64 //拉霸专用 输赢
|
|
||||||
CycleId string // 本轮id,打一轮有多局
|
CycleId string // 本轮id,打一轮有多局
|
||||||
}
|
|
||||||
|
|
||||||
func NewGamePlayerListLog() *GamePlayerListLog {
|
SnId int32 // 用户Id
|
||||||
log := &GamePlayerListLog{LogId: bson.NewObjectId()}
|
Name string // 名称
|
||||||
return log
|
SceneId int32 // 房间id,会重复
|
||||||
}
|
MatchId int64 // 比赛ID,应该用字符串的
|
||||||
func NewGamePlayerListLogEx(snid int32, gamedetailedlogid string, platform, channel, promoter, packageTag string, gameid, baseScore,
|
MatchType int64 // 0.普通场 1.锦标赛 2.冠军赛 3.vip专属
|
||||||
sceneid, gamemode, gamefreeid int32, totalin, totalout int64, clubId int32, clubRoom string, taxCoin, pumpCoin int64, roomType int32,
|
WinAmountNoAnyTax int64 // 盈利金额,不包含任何税
|
||||||
betAmount, winAmountNoAnyTax int64, key, name string, gameClass int32, isFirst bool, matchid, matchType int64,
|
TaxCoin int64 // 税收
|
||||||
isFree bool, winSmallGame, winTotal int64, cycleId string) *GamePlayerListLog {
|
BetAmount int64 // 下注金额
|
||||||
cl := NewGamePlayerListLog()
|
IsFirstGame bool // 是否第一次游戏
|
||||||
cl.SnId = snid
|
TotalIn int64 // 本局投入
|
||||||
cl.GameDetailedLogId = gamedetailedlogid
|
TotalOut int64 // 本局产出
|
||||||
cl.Platform = platform
|
IsFree bool // 拉霸专用 是否免费
|
||||||
cl.Name = name
|
WinSmallGame int64 // 拉霸专用 小游戏奖励
|
||||||
cl.Channel = channel
|
WinTotal int64 // 拉霸专用 输赢
|
||||||
cl.Promoter = promoter
|
|
||||||
cl.PackageTag = packageTag
|
|
||||||
cl.GameFreeid = gamefreeid
|
|
||||||
cl.GameId = gameid
|
|
||||||
cl.BaseScore = baseScore
|
|
||||||
cl.ClubId = clubId
|
|
||||||
cl.GameMode = gamemode
|
|
||||||
cl.SceneId = sceneid
|
|
||||||
cl.TotalIn = totalin
|
|
||||||
cl.TotalOut = totalout
|
|
||||||
cl.ClubRoom = clubRoom
|
|
||||||
cl.TaxCoin = taxCoin
|
|
||||||
cl.IsFirstGame = isFirst
|
|
||||||
cl.ClubPumpCoin = pumpCoin
|
|
||||||
cl.RoomType = roomType
|
|
||||||
cl.BetAmount = betAmount
|
|
||||||
cl.WinAmountNoAnyTax = winAmountNoAnyTax
|
|
||||||
cl.GameDif = key
|
|
||||||
cl.GameClass = gameClass
|
|
||||||
cl.IsFree = isFree
|
|
||||||
cl.WinSmallGame = winSmallGame
|
|
||||||
cl.WinTotal = winTotal
|
|
||||||
tNow := time.Now()
|
|
||||||
cl.Ts = tNow.Unix()
|
|
||||||
cl.Time = tNow
|
|
||||||
cl.MatchId = matchid
|
|
||||||
cl.MatchType = matchType
|
|
||||||
cl.CycleId = cycleId
|
|
||||||
return cl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GamePlayerListRet struct {
|
type GamePlayerListRet struct {
|
||||||
|
|
|
@ -28,6 +28,7 @@ type ItemLog struct {
|
||||||
TypeId int32 // 变化类型
|
TypeId int32 // 变化类型
|
||||||
GameId int64 // 游戏id,游戏中获得时有值
|
GameId int64 // 游戏id,游戏中获得时有值
|
||||||
GameFreeId int64 // 场次id,游戏中获得时有值
|
GameFreeId int64 // 场次id,游戏中获得时有值
|
||||||
|
GameDif string // 游戏分组
|
||||||
Cost []*Item // 消耗的道具
|
Cost []*Item // 消耗的道具
|
||||||
Id string // 撤销的id,兑换失败
|
Id string // 撤销的id,兑换失败
|
||||||
RoomConfigId int32 // 房间配置id
|
RoomConfigId int32 // 房间配置id
|
||||||
|
@ -50,6 +51,7 @@ type ItemParam struct {
|
||||||
TypeId int32 // 变化类型
|
TypeId int32 // 变化类型
|
||||||
GameId int64 // 游戏id,游戏中获得时有值
|
GameId int64 // 游戏id,游戏中获得时有值
|
||||||
GameFreeId int64 // 场次id,游戏中获得时有值
|
GameFreeId int64 // 场次id,游戏中获得时有值
|
||||||
|
GameDif string // 游戏分组
|
||||||
Cost []*Item // 消耗的道具
|
Cost []*Item // 消耗的道具
|
||||||
LogId string // 撤销的id,兑换失败
|
LogId string // 撤销的id,兑换失败
|
||||||
RoomConfigId int32 // 房间配置id
|
RoomConfigId int32 // 房间配置id
|
||||||
|
@ -71,6 +73,7 @@ func NewItemLogEx(param ItemParam) *ItemLog {
|
||||||
itemLog.TypeId = param.TypeId
|
itemLog.TypeId = param.TypeId
|
||||||
itemLog.GameId = param.GameId
|
itemLog.GameId = param.GameId
|
||||||
itemLog.GameFreeId = param.GameFreeId
|
itemLog.GameFreeId = param.GameFreeId
|
||||||
|
itemLog.GameDif = param.GameDif
|
||||||
itemLog.Cost = param.Cost
|
itemLog.Cost = param.Cost
|
||||||
itemLog.Id = param.LogId
|
itemLog.Id = param.LogId
|
||||||
itemLog.RoomConfigId = param.RoomConfigId
|
itemLog.RoomConfigId = param.RoomConfigId
|
||||||
|
@ -246,7 +249,7 @@ type InsertItemLogReq struct {
|
||||||
Logs []*ItemLog
|
Logs []*ItemLog
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertItemLog(configItems map[int32]*server.DB_GameItem, param *AddItemParam, isOffline bool) error {
|
func InsertItemLog(configItems map[int32]*server.DB_GameItem, param *AddItemParam, gamedif string, isOffline bool) error {
|
||||||
if rpcCli == nil {
|
if rpcCli == nil {
|
||||||
logger.Logger.Warnf("rpcCli is nil")
|
logger.Logger.Warnf("rpcCli is nil")
|
||||||
return errors.New("rpcCli is nil")
|
return errors.New("rpcCli is nil")
|
||||||
|
@ -280,6 +283,7 @@ func InsertItemLog(configItems map[int32]*server.DB_GameItem, param *AddItemPara
|
||||||
TypeId: param.GainWay,
|
TypeId: param.GainWay,
|
||||||
GameId: param.GameId,
|
GameId: param.GameId,
|
||||||
GameFreeId: param.GameFreeId,
|
GameFreeId: param.GameFreeId,
|
||||||
|
GameDif: gamedif,
|
||||||
Cost: param.Cost,
|
Cost: param.Cost,
|
||||||
LogId: param.LogId,
|
LogId: param.LogId,
|
||||||
RoomConfigId: param.RoomConfigId,
|
RoomConfigId: param.RoomConfigId,
|
||||||
|
|
|
@ -690,6 +690,15 @@ func (this *BagMgr) AddItems(param *model.AddItemParam) (*BagInfo, bag.OpResultC
|
||||||
logType = ItemConsume
|
logType = ItemConsume
|
||||||
num = -v.ItemNum
|
num = -v.ItemNum
|
||||||
}
|
}
|
||||||
|
gamedif := ""
|
||||||
|
plt := PlatformMgrSingleton.GetPlatform(p.Platform)
|
||||||
|
if plt != nil {
|
||||||
|
gf := plt.GameConfig.GetGameConfig(int32(param.GameFreeId))
|
||||||
|
if gf != nil {
|
||||||
|
gamedif = gf.GetDbGameFree().GetGameDif()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 日志
|
// 日志
|
||||||
log := model.NewItemLogEx(model.ItemParam{
|
log := model.NewItemLogEx(model.ItemParam{
|
||||||
Platform: p.Platform,
|
Platform: p.Platform,
|
||||||
|
@ -702,6 +711,7 @@ func (this *BagMgr) AddItems(param *model.AddItemParam) (*BagInfo, bag.OpResultC
|
||||||
TypeId: param.GainWay,
|
TypeId: param.GainWay,
|
||||||
GameId: param.GameId,
|
GameId: param.GameId,
|
||||||
GameFreeId: param.GameFreeId,
|
GameFreeId: param.GameFreeId,
|
||||||
|
GameDif: gamedif,
|
||||||
Cost: param.Cost,
|
Cost: param.Cost,
|
||||||
LogId: param.LogId,
|
LogId: param.LogId,
|
||||||
RoomConfigId: param.RoomConfigId,
|
RoomConfigId: param.RoomConfigId,
|
||||||
|
@ -765,6 +775,15 @@ func (this *BagMgr) AddItemsOffline(param *model.AddItemParam, callback func(err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gamedif := ""
|
||||||
|
plt := PlatformMgrSingleton.GetPlatform(param.Platform)
|
||||||
|
if plt != nil && param.GameFreeId > 0 {
|
||||||
|
gf := plt.GameConfig.GetGameConfig(int32(param.GameFreeId))
|
||||||
|
if gf != nil {
|
||||||
|
gamedif = gf.GetDbGameFree().GetGameDif()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 玩家离线时
|
// 玩家离线时
|
||||||
var findPlayer *model.PlayerBaseInfo
|
var findPlayer *model.PlayerBaseInfo
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
@ -793,7 +812,7 @@ func (this *BagMgr) AddItemsOffline(param *model.AddItemParam, callback func(err
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// 保存日志
|
// 保存日志
|
||||||
if err := model.InsertItemLog(srvdata.GameItemMgr.GetItems(param.Platform), param, true); err != nil {
|
if err := model.InsertItemLog(srvdata.GameItemMgr.GetItems(param.Platform), param, gamedif, true); err != nil {
|
||||||
logger.Logger.Errorf("离线保存道具变更日志错误 %v", err)
|
logger.Logger.Errorf("离线保存道具变更日志错误 %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue