添加调控开关
This commit is contained in:
parent
72b1faa2ce
commit
db3f7bee67
|
@ -409,6 +409,9 @@ func (this *TienLenSceneData) BroadcastOpPos() {
|
||||||
if B < 0 {
|
if B < 0 {
|
||||||
isWin = false
|
isWin = false
|
||||||
}
|
}
|
||||||
|
if this.WGCreateScene.GetCloseCtrl() {
|
||||||
|
isWin = true
|
||||||
|
}
|
||||||
isTienLenYule := this.IsTienLenYule()
|
isTienLenYule := this.IsTienLenYule()
|
||||||
pack := &tienlen.SCTienLenAIData{
|
pack := &tienlen.SCTienLenAIData{
|
||||||
BombNum: 0, //炸弹数量
|
BombNum: 0, //炸弹数量
|
||||||
|
@ -554,10 +557,12 @@ func (this *TienLenSceneData) GetFreeGameSceneType() int32 {
|
||||||
return this.GetSceneType()
|
return this.GetSceneType()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SendHandCard_Match 发牌
|
||||||
// 比赛场发牌
|
// 比赛场发牌
|
||||||
// 纯真人,随机发牌
|
// 纯真人,随机发牌
|
||||||
// 有机器人和真人,真人拿好牌
|
// 有机器人和真人,真人拿好牌
|
||||||
func (this *TienLenSceneData) SendHandCard_Match() {
|
// mustRandom 必须随机发牌
|
||||||
|
func (this *TienLenSceneData) SendHandCard_Match(mustRandom bool) {
|
||||||
this.poker.Shuffle()
|
this.poker.Shuffle()
|
||||||
buf := this.poker.GetPokerBuf()
|
buf := this.poker.GetPokerBuf()
|
||||||
cardss := map[int][]int32{}
|
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 {
|
type gradeInfo struct {
|
||||||
id int
|
id int
|
||||||
grade int
|
grade int
|
||||||
|
|
|
@ -991,14 +991,18 @@ func (this *SceneHandCardStateTienLen) OnEnter(s *base.Scene) {
|
||||||
if rule.TestOpen {
|
if rule.TestOpen {
|
||||||
sceneEx.SendHandCardTest()
|
sceneEx.SendHandCardTest()
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if len(sceneEx.testPokers) > 1 {
|
if len(sceneEx.testPokers) > 1 {
|
||||||
sceneEx.SendHandCardOdds()
|
sceneEx.SendHandCardOdds()
|
||||||
} else {
|
} else {
|
||||||
if sceneEx.IsMatchScene() || sceneEx.IsCustom() {
|
// 关闭调控发牌
|
||||||
sceneEx.SendHandCard_Match()
|
if sceneEx.WGCreateScene.GetCloseCtrl() {
|
||||||
|
sceneEx.SendHandCard_Match(true)
|
||||||
} else {
|
} 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
|
@ -205,6 +205,7 @@ message WGCreateScene {
|
||||||
MatchParam Match = 16; // 比赛场参数
|
MatchParam Match = 16; // 比赛场参数
|
||||||
repeated int32 ChessRank = 26; // 象棋段位配置
|
repeated int32 ChessRank = 26; // 象棋段位配置
|
||||||
repeated int64 Params = 27; // 游戏参数,GameRule中定义,不要有其他用途,含义不明确
|
repeated int64 Params = 27; // 游戏参数,GameRule中定义,不要有其他用途,含义不明确
|
||||||
|
bool CloseCtrl = 28; // 是否关闭开启控制
|
||||||
}
|
}
|
||||||
|
|
||||||
//PACKET_WG_DESTROYSCENE
|
//PACKET_WG_DESTROYSCENE
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -109,6 +109,7 @@ message GameFree {
|
||||||
int32 GroupId = 1; // 组ID
|
int32 GroupId = 1; // 组ID
|
||||||
bool Status = 2; // 开关
|
bool Status = 2; // 开关
|
||||||
server.DB_GameFree DbGameFree = 3; // excel导出结构
|
server.DB_GameFree DbGameFree = 3; // excel导出结构
|
||||||
|
bool CloseCtrl = 4; // 是否关闭调控开关
|
||||||
}
|
}
|
||||||
|
|
||||||
// 平台级别游戏配置
|
// 平台级别游戏配置
|
||||||
|
|
|
@ -163,6 +163,7 @@ func (this *GameSession) AddScene(args *AddSceneParam) {
|
||||||
Custom: args.S.CustomParam,
|
Custom: args.S.CustomParam,
|
||||||
Match: args.S.MatchParam,
|
Match: args.S.MatchParam,
|
||||||
Params: args.S.params,
|
Params: args.S.params,
|
||||||
|
CloseCtrl: args.S.CloseCtrl,
|
||||||
}
|
}
|
||||||
if args.S.CustomParam.GetRoomConfigId() != 0 {
|
if args.S.CustomParam.GetRoomConfigId() != 0 {
|
||||||
cfg := PlatformMgrSingleton.GetConfig(args.S.platform.IdStr).RoomConfig[args.S.CustomParam.GetRoomConfigId()]
|
cfg := PlatformMgrSingleton.GetConfig(args.S.platform.IdStr).RoomConfig[args.S.CustomParam.GetRoomConfigId()]
|
||||||
|
|
|
@ -127,6 +127,7 @@ func (cfg *GameList) GetGameConfig(gameFreeId int32) *webapiproto.GameFree {
|
||||||
func CompareGameFreeConfigChanged(oldCfg, newCfg *webapiproto.GameFree) bool {
|
func CompareGameFreeConfigChanged(oldCfg, newCfg *webapiproto.GameFree) bool {
|
||||||
if oldCfg.Status != newCfg.Status ||
|
if oldCfg.Status != newCfg.Status ||
|
||||||
oldCfg.GroupId != newCfg.GroupId ||
|
oldCfg.GroupId != newCfg.GroupId ||
|
||||||
|
oldCfg.GetOnCtrl() != newCfg.GetOnCtrl() ||
|
||||||
oldCfg.DbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
|
oldCfg.DbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
|
||||||
oldCfg.DbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
|
oldCfg.DbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
|
||||||
oldCfg.DbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||
|
oldCfg.DbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||
|
||||||
|
|
|
@ -65,8 +65,10 @@ type Scene struct {
|
||||||
*serverproto.CustomParam // 房卡场参数
|
*serverproto.CustomParam // 房卡场参数
|
||||||
*serverproto.MatchParam // 比赛场参数
|
*serverproto.MatchParam // 比赛场参数
|
||||||
*webapiproto.RoomConfigSystem // 系统竞技馆房间
|
*webapiproto.RoomConfigSystem // 系统竞技馆房间
|
||||||
csp *CoinScenePool // 所在场景池
|
CloseCtrl bool // 调控开关
|
||||||
hp *HundredSceneMgr // 百人场房间池
|
|
||||||
|
csp *CoinScenePool // 所在场景池
|
||||||
|
hp *HundredSceneMgr // 百人场房间池
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewScene 创建房间
|
// NewScene 创建房间
|
||||||
|
@ -146,6 +148,10 @@ func NewScene(args *CreateSceneParam) *Scene {
|
||||||
if s.RoomConfigSystem == nil {
|
if s.RoomConfigSystem == nil {
|
||||||
s.RoomConfigSystem = new(webapiproto.RoomConfigSystem)
|
s.RoomConfigSystem = new(webapiproto.RoomConfigSystem)
|
||||||
}
|
}
|
||||||
|
gf := PlatformMgrSingleton.GetGameFree(args.Platform.IdStr, args.GameFreeId)
|
||||||
|
if gf != nil {
|
||||||
|
s.CloseCtrl = gf.GetCloseCtrl()
|
||||||
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue