添加调控开关

This commit is contained in:
sk 2024-10-15 16:14:50 +08:00
parent 72b1faa2ce
commit db3f7bee67
9 changed files with 2355 additions and 2316 deletions

View File

@ -409,6 +409,9 @@ func (this *TienLenSceneData) BroadcastOpPos() {
if B < 0 {
isWin = false
}
if this.WGCreateScene.GetCloseCtrl() {
isWin = true
}
isTienLenYule := this.IsTienLenYule()
pack := &tienlen.SCTienLenAIData{
BombNum: 0, //炸弹数量
@ -554,10 +557,12 @@ func (this *TienLenSceneData) GetFreeGameSceneType() int32 {
return this.GetSceneType()
}
// SendHandCard_Match 发牌
// 比赛场发牌
// 纯真人,随机发牌
// 有机器人和真人,真人拿好牌
func (this *TienLenSceneData) SendHandCard_Match() {
// mustRandom 必须随机发牌
func (this *TienLenSceneData) SendHandCard_Match(mustRandom bool) {
this.poker.Shuffle()
buf := this.poker.GetPokerBuf()
cardss := map[int][]int32{}
@ -579,7 +584,7 @@ func (this *TienLenSceneData) SendHandCard_Match() {
}
}
}
if len(realPlayers) > 0 && len(robotPlayers) > 0 {
if !mustRandom && len(realPlayers) > 0 && len(robotPlayers) > 0 {
type gradeInfo struct {
id int
grade int

View File

@ -991,14 +991,18 @@ func (this *SceneHandCardStateTienLen) OnEnter(s *base.Scene) {
if rule.TestOpen {
sceneEx.SendHandCardTest()
} else {
if len(sceneEx.testPokers) > 1 {
sceneEx.SendHandCardOdds()
} else {
if sceneEx.IsMatchScene() || sceneEx.IsCustom() {
sceneEx.SendHandCard_Match()
// 关闭调控发牌
if sceneEx.WGCreateScene.GetCloseCtrl() {
sceneEx.SendHandCard_Match(true)
} else {
sceneEx.SendHandCardOdds()
if sceneEx.IsMatchScene() || sceneEx.IsCustom() {
sceneEx.SendHandCard_Match(false)
} else {
sceneEx.SendHandCardOdds()
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -205,6 +205,7 @@ message WGCreateScene {
MatchParam Match = 16; //
repeated int32 ChessRank = 26; //
repeated int64 Params = 27; // ,GameRule中定义,
bool CloseCtrl = 28; //
}
//PACKET_WG_DESTROYSCENE

File diff suppressed because it is too large Load Diff

View File

@ -109,6 +109,7 @@ message GameFree {
int32 GroupId = 1; // ID
bool Status = 2; //
server.DB_GameFree DbGameFree = 3; // excel导出结构
bool CloseCtrl = 4; //
}
//

View File

@ -163,6 +163,7 @@ func (this *GameSession) AddScene(args *AddSceneParam) {
Custom: args.S.CustomParam,
Match: args.S.MatchParam,
Params: args.S.params,
CloseCtrl: args.S.CloseCtrl,
}
if args.S.CustomParam.GetRoomConfigId() != 0 {
cfg := PlatformMgrSingleton.GetConfig(args.S.platform.IdStr).RoomConfig[args.S.CustomParam.GetRoomConfigId()]

View File

@ -127,6 +127,7 @@ func (cfg *GameList) GetGameConfig(gameFreeId int32) *webapiproto.GameFree {
func CompareGameFreeConfigChanged(oldCfg, newCfg *webapiproto.GameFree) bool {
if oldCfg.Status != newCfg.Status ||
oldCfg.GroupId != newCfg.GroupId ||
oldCfg.GetOnCtrl() != newCfg.GetOnCtrl() ||
oldCfg.DbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
oldCfg.DbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
oldCfg.DbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||

View File

@ -65,8 +65,10 @@ type Scene struct {
*serverproto.CustomParam // 房卡场参数
*serverproto.MatchParam // 比赛场参数
*webapiproto.RoomConfigSystem // 系统竞技馆房间
csp *CoinScenePool // 所在场景池
hp *HundredSceneMgr // 百人场房间池
CloseCtrl bool // 调控开关
csp *CoinScenePool // 所在场景池
hp *HundredSceneMgr // 百人场房间池
}
// NewScene 创建房间
@ -146,6 +148,10 @@ func NewScene(args *CreateSceneParam) *Scene {
if s.RoomConfigSystem == nil {
s.RoomConfigSystem = new(webapiproto.RoomConfigSystem)
}
gf := PlatformMgrSingleton.GetGameFree(args.Platform.IdStr, args.GameFreeId)
if gf != nil {
s.CloseCtrl = gf.GetCloseCtrl()
}
return s
}