tienlen记录调控信息
This commit is contained in:
parent
39b71ea93f
commit
5e0b6139f9
|
@ -1632,6 +1632,8 @@ func (this *Scene) NewBigCoinNotice(player *Player, num int64, msgType int64) {
|
||||||
|
|
||||||
type GameDetailedParam struct {
|
type GameDetailedParam struct {
|
||||||
Trend20Lately string //最近20局开奖结果
|
Trend20Lately string //最近20局开奖结果
|
||||||
|
CtrlType int
|
||||||
|
PlayerPool map[int]int
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存详细游戏日志
|
// 保存详细游戏日志
|
||||||
|
@ -1651,7 +1653,8 @@ func (this *Scene) SaveGameDetailedLog(logid string, gamedetailednote string, ga
|
||||||
log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId),
|
log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId),
|
||||||
this.DbGameFree.GetGameMode(), this.DbGameFree.Id, int32(len(this.Players)),
|
this.DbGameFree.GetGameMode(), this.DbGameFree.Id, int32(len(this.Players)),
|
||||||
int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore,
|
int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore,
|
||||||
gamedetailednote, p.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[this.GameId], trend20Lately)
|
gamedetailednote, p.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[this.GameId], trend20Lately,
|
||||||
|
gameDetailedParam.CtrlType, gameDetailedParam.PlayerPool)
|
||||||
if log != nil {
|
if log != nil {
|
||||||
if this.IsMatchScene() {
|
if this.IsMatchScene() {
|
||||||
log.MatchId = this.MatchId
|
log.MatchId = this.MatchId
|
||||||
|
@ -1664,7 +1667,8 @@ func (this *Scene) SaveGameDetailedLog(logid string, gamedetailednote string, ga
|
||||||
log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId),
|
log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId),
|
||||||
this.DbGameFree.GetGameMode(), this.DbGameFree.Id, int32(len(this.Players)),
|
this.DbGameFree.GetGameMode(), this.DbGameFree.Id, int32(len(this.Players)),
|
||||||
int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore,
|
int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore,
|
||||||
gamedetailednote, this.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[this.GameId], trend20Lately)
|
gamedetailednote, this.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[this.GameId], trend20Lately,
|
||||||
|
gameDetailedParam.CtrlType, gameDetailedParam.PlayerPool)
|
||||||
if log != nil {
|
if log != nil {
|
||||||
if this.IsMatchScene() {
|
if this.IsMatchScene() {
|
||||||
log.MatchId = this.MatchId
|
log.MatchId = this.MatchId
|
||||||
|
|
|
@ -29,6 +29,7 @@ type TienLenPlayerData struct {
|
||||||
curHandLimitTimeOut time.Duration // 出牌时间上限
|
curHandLimitTimeOut time.Duration // 出牌时间上限
|
||||||
isNotOverLastHand bool //手牌不能压过上家出牌标志
|
isNotOverLastHand bool //手牌不能压过上家出牌标志
|
||||||
cardScore int // 手牌评分
|
cardScore int // 手牌评分
|
||||||
|
playerPool int // 个人水池分
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *TienLenPlayerData) init() {
|
func (this *TienLenPlayerData) init() {
|
||||||
|
@ -49,6 +50,7 @@ func (this *TienLenPlayerData) init() {
|
||||||
this.curHandLimitTimeOut = rule.TienLenPlayerOpTimeout
|
this.curHandLimitTimeOut = rule.TienLenPlayerOpTimeout
|
||||||
this.isNotOverLastHand = false
|
this.isNotOverLastHand = false
|
||||||
this.cardScore = 0
|
this.cardScore = 0
|
||||||
|
this.playerPool = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *TienLenPlayerData) Clear() {
|
func (this *TienLenPlayerData) Clear() {
|
||||||
|
@ -67,6 +69,7 @@ func (this *TienLenPlayerData) Clear() {
|
||||||
this.ThinkLongCnt = 0
|
this.ThinkLongCnt = 0
|
||||||
this.curHandLimitTimeOut = rule.TienLenPlayerOpTimeout
|
this.curHandLimitTimeOut = rule.TienLenPlayerOpTimeout
|
||||||
this.isNotOverLastHand = false
|
this.isNotOverLastHand = false
|
||||||
|
this.playerPool = 0
|
||||||
|
|
||||||
this.MarkFlag(base.PlayerState_WaitNext)
|
this.MarkFlag(base.PlayerState_WaitNext)
|
||||||
this.TestLog = this.TestLog[:0]
|
this.TestLog = this.TestLog[:0]
|
||||||
|
|
|
@ -55,6 +55,7 @@ type TienLenSceneData struct {
|
||||||
cHintCards []int32 //客户端提示出牌记录
|
cHintCards []int32 //客户端提示出牌记录
|
||||||
isCardsKu bool //是否是牌库
|
isCardsKu bool //是否是牌库
|
||||||
cardsKuId int32 //牌库ID
|
cardsKuId int32 //牌库ID
|
||||||
|
ctrlType int // 1控赢 2控输 0不控
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTienLenSceneData(s *base.Scene) *TienLenSceneData {
|
func NewTienLenSceneData(s *base.Scene) *TienLenSceneData {
|
||||||
|
@ -85,6 +86,7 @@ func (this *TienLenSceneData) init() bool {
|
||||||
this.card_play_action_seq_int32 = [][]int32{}
|
this.card_play_action_seq_int32 = [][]int32{}
|
||||||
this.bombToEnd = 0
|
this.bombToEnd = 0
|
||||||
this.allPlayerCards = [][]int32{}
|
this.allPlayerCards = [][]int32{}
|
||||||
|
this.ctrlType = 0
|
||||||
this.recordId, _ = model.AutoIncGameLogId()
|
this.recordId, _ = model.AutoIncGameLogId()
|
||||||
if this.GetPlayerNum() == 0 {
|
if this.GetPlayerNum() == 0 {
|
||||||
this.SetPlayerNum(rule.MaxNumOfPlayer)
|
this.SetPlayerNum(rule.MaxNumOfPlayer)
|
||||||
|
@ -114,6 +116,7 @@ func (this *TienLenSceneData) Clear() {
|
||||||
this.isAllRob = false
|
this.isAllRob = false
|
||||||
this.robotGamingNum = 0
|
this.robotGamingNum = 0
|
||||||
this.allPlayerCards = [][]int32{}
|
this.allPlayerCards = [][]int32{}
|
||||||
|
this.ctrlType = 0
|
||||||
this.recordId, _ = model.AutoIncGameLogId()
|
this.recordId, _ = model.AutoIncGameLogId()
|
||||||
for _, player := range this.players {
|
for _, player := range this.players {
|
||||||
if player != nil {
|
if player != nil {
|
||||||
|
@ -1053,6 +1056,7 @@ func (this *TienLenSceneData) SendHandCardOdds() {
|
||||||
robotPlayers = append(robotPlayers, seat)
|
robotPlayers = append(robotPlayers, seat)
|
||||||
} else {
|
} else {
|
||||||
seat.odds = this.GetPlayerOdds(seat.Player, this.GameId, this.robotGamingNum > 0)
|
seat.odds = this.GetPlayerOdds(seat.Player, this.GameId, this.robotGamingNum > 0)
|
||||||
|
seat.playerPool = int(this.PlayerPoolOdds(seat.Player))
|
||||||
if seat.odds > 0 {
|
if seat.odds > 0 {
|
||||||
realPlayersGood = append(realPlayersGood, seat)
|
realPlayersGood = append(realPlayersGood, seat)
|
||||||
G += seat.odds
|
G += seat.odds
|
||||||
|
@ -1233,6 +1237,7 @@ func (this *TienLenSceneData) SendHandCardOdds() {
|
||||||
logger.Logger.Tracef("TienLen SendHandCardOdds Good:%v G:%v Bad:%v B:%v", isGood, G, isBad, B)
|
logger.Logger.Tracef("TienLen SendHandCardOdds Good:%v G:%v Bad:%v B:%v", isGood, G, isBad, B)
|
||||||
|
|
||||||
if isBad && !isTestPoker && len(robotPlayers) > 0 && !noviceCtrl && !noviceTianHu {
|
if isBad && !isTestPoker && len(robotPlayers) > 0 && !noviceCtrl && !noviceTianHu {
|
||||||
|
this.ctrlType = 2
|
||||||
gf := base.ConfigMgrInst.GetConfig(this.Platform).GameConfig
|
gf := base.ConfigMgrInst.GetConfig(this.Platform).GameConfig
|
||||||
items := []int32{gf.GetTianHu(), gf.GetPaiKu(), gf.GetFenCha()}
|
items := []int32{gf.GetTianHu(), gf.GetPaiKu(), gf.GetFenCha()}
|
||||||
score := this.RandInt(int(gf.GetTianHu() + gf.GetPaiKu() + gf.GetFenCha()))
|
score := this.RandInt(int(gf.GetTianHu() + gf.GetPaiKu() + gf.GetFenCha()))
|
||||||
|
@ -1495,7 +1500,8 @@ func (this *TienLenSceneData) SendHandCardOdds() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isBad && !isTestPoker && !noviceCtrl && !noviceTianHu { // 天胡调控没有生效
|
if !isBad && !isTestPoker && !noviceCtrl && !noviceTianHu { // 天胡调控没有生效
|
||||||
if isGood || isBad {
|
if isGood {
|
||||||
|
this.ctrlType = 1
|
||||||
// 牌平分,按从大到小排序
|
// 牌平分,按从大到小排序
|
||||||
// 使用分差配置,最好牌和最差牌的牌型分差大于分差配置
|
// 使用分差配置,最好牌和最差牌的牌型分差大于分差配置
|
||||||
for i := 0; i < 20; i++ { // 尝试20次,如果还不能满足分差配置,则直接发牌
|
for i := 0; i < 20; i++ { // 尝试20次,如果还不能满足分差配置,则直接发牌
|
||||||
|
|
|
@ -1606,6 +1606,13 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
BaseScore: s.GetBaseScore(),
|
BaseScore: s.GetBaseScore(),
|
||||||
TaxRate: s.DbGameFree.GetTaxRate(),
|
TaxRate: s.DbGameFree.GetTaxRate(),
|
||||||
RoomMode: s.GetSceneMode(),
|
RoomMode: s.GetSceneMode(),
|
||||||
|
PlayerPool: make(map[int]int),
|
||||||
|
}
|
||||||
|
for _, v := range sceneEx.seats {
|
||||||
|
if v == nil || !v.IsGameing() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
tienlenType.PlayerPool[int(v.SnId)] = v.playerPool
|
||||||
}
|
}
|
||||||
|
|
||||||
nGamingPlayerCount := sceneEx.GetGameingPlayerCnt()
|
nGamingPlayerCount := sceneEx.GetGameingPlayerCnt()
|
||||||
|
@ -2499,7 +2506,11 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
}
|
}
|
||||||
if isSave {
|
if isSave {
|
||||||
// 牌局记录
|
// 牌局记录
|
||||||
sceneEx.SaveGameDetailedLog(sceneEx.recordId, info, &base.GameDetailedParam{})
|
sceneEx.SaveGameDetailedLog(sceneEx.recordId, info, &base.GameDetailedParam{
|
||||||
|
Trend20Lately: "",
|
||||||
|
CtrlType: sceneEx.ctrlType,
|
||||||
|
PlayerPool: tienlenType.PlayerPool,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,8 @@ type GameDetailedLog struct {
|
||||||
Time time.Time //记录时间
|
Time time.Time //记录时间
|
||||||
Trend20Lately string //最近游戏走势
|
Trend20Lately string //最近游戏走势
|
||||||
Ts int64 //时间戳
|
Ts int64 //时间戳
|
||||||
|
CtrlType int // 1控赢 2控输 0不控
|
||||||
|
PlayerPool map[int]int // 个人水池分
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGameDetailedLog() *GameDetailedLog {
|
func NewGameDetailedLog() *GameDetailedLog {
|
||||||
|
@ -63,7 +65,7 @@ func NewGameDetailedLog() *GameDetailedLog {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGameDetailedLogEx(logid string, gameid, sceneid, gamemode, gamefreeid, playercount, gametiming, gamebasebet int32,
|
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) *GameDetailedLog {
|
gamedetailednote string, platform string, clubId int32, clubRoom string, cpCtx CoinPoolCtx, ver int32, trend20Lately string, ctrlType int, playerPool map[int]int) *GameDetailedLog {
|
||||||
cl := NewGameDetailedLog()
|
cl := NewGameDetailedLog()
|
||||||
cl.LogId = logid
|
cl.LogId = logid
|
||||||
cl.GameId = gameid
|
cl.GameId = gameid
|
||||||
|
@ -83,6 +85,8 @@ func NewGameDetailedLogEx(logid string, gameid, sceneid, gamemode, gamefreeid, p
|
||||||
cl.GameDetailVer = ver
|
cl.GameDetailVer = ver
|
||||||
cl.Trend20Lately = trend20Lately
|
cl.Trend20Lately = trend20Lately
|
||||||
cl.Ts = time.Now().Unix()
|
cl.Ts = time.Now().Unix()
|
||||||
|
cl.CtrlType = ctrlType
|
||||||
|
cl.PlayerPool = playerPool
|
||||||
return cl
|
return cl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1521,6 +1521,8 @@ type TienLenType struct {
|
||||||
TaxRate int32 //税率(万分比)
|
TaxRate int32 //税率(万分比)
|
||||||
PlayerData []TienLenPerson //玩家信息
|
PlayerData []TienLenPerson //玩家信息
|
||||||
RoomMode int
|
RoomMode int
|
||||||
|
CtrlType int `json:"-"` // 1控赢 2控输 0不控
|
||||||
|
PlayerPool map[int]int `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TienLenAddItem struct {
|
type TienLenAddItem struct {
|
||||||
|
|
Loading…
Reference in New Issue