|
- --获取创建房间选项配置
- function getRuleFromString(gameId, jushu, ruleStr)
-
- local config=getSubGameConfig(tonumber(gameId))
- if type(config.wanfaConfig) == "string" then
- local isRequired, wanfa = pcall(require, config.wanfaConfig)
- if isRequired and wanfa and type(wanfa.getRuleFromString) == "function" then
- local tt = wanfa.getRuleFromString(gameId, jushu, ruleStr)
- return tt or {}
- end
- end
-
- local tt = {}
- local jsonData = json.decode(ruleStr);
- --"{\"kun\":14,\"gamerule\":0,\"baozi\":10,\"minHuShu\":18,\"specRule\":1}",
- -- 局数
- local jushuText = string.format("%d 局",jushu);
- table.insert(tt, {name = "局数", value = {jushuText}})
-
-
- --判断游戏配置是麻将
- local config=getSubGameConfig(tonumber(gameId))
- if config and config.belongType==3 then
- if jsonData.deductRule and jsonData.deductRule >= 0 then
- local specStr =jsonData.deductRule==0 and "房主付费" or "AA付费"
- if specStr ~= "" then
- table.insert(tt, {name = "房费", value = {specStr}})
- end
- end
-
- local MJWanFa=MJFramework.ImportWanFa("luaScript.SubGameDefine.MaJiang.MJWanFa",tonumber(gameId))
- table.insertTo(tt,MJWanFa.getClubWaFaInfo(ruleStr))
- elseif config and config.belongType==2 then
- if jsonData.deductRule and jsonData.deductRule >= 0 then
- local specStr =jsonData.deductRule==0 and "房主付费" or "AA付费"
- if specStr ~= "" then
- table.insert(tt, {name = "房费", value = {specStr}})
- end
- end
- --[[-- 是否已下载
- local isDownGame = app.subGameManager:isInstaller(tonumber(gameId))
- -- 是否需要更新
- local isUpdate = app.subGameManager:isNeedUpdate(tonumber(gameId))
- if isDownGame == false or isUpdate == true then
- return tt
- end--]]
- local ZPWanFa = ZPFramework.ImportWanFa("luaScript.SubGameDefine.ZiPai.ZPWanFa",gameId)
- table.insertTo(tt,ZPWanFa.getClubRuleInfo(ruleStr))
- end
-
-
- return tt;
- end
-
- --获取包间多玩法桌子上显示的信息
- function getClubTableRuleString(gameId, ruleStr)
- --判断游戏配置是麻将
- local str =""
- local config=getSubGameConfig(tonumber(gameId))
-
- if type(config.wanfaConfig) == "string" then
- local isRequired, wanfa = pcall(require, config.wanfaConfig)
- if isRequired and wanfa and type(wanfa.getClubTableRuleString) == "function" then
- local str = wanfa.getClubTableRuleString(gameId, ruleStr, playerNum)
- return str or ""
- end
- end
-
- if config and config.belongType==3 then
- local MJWanFa=MJFramework.ImportWanFa("luaScript.SubGameDefine.MaJiang.MJWanFa",gameId)
- str = MJWanFa.getClubTableWanFaInfo(ruleStr)
- elseif config and config.belongType==2 then
- local ZPWanFa = ZPFramework.ImportWanFa("luaScript.SubGameDefine.ZiPai.ZPWanFa",gameId)
- str = ZPWanFa.getClubTableWanFaInfo(ruleStr)
- end
-
- if tonumber(gameId) == GAME_IDS.luzhouPaoDeKuai then
- local lzPDKDefine = require("luaScript.SubGameDefine.luzhouPDKDefine")
- str = lzPDKDefine.getClubTableWanFaInfo(ruleStr)
- elseif tonumber(gameId) == GAME_IDS.hejiangPaoDeKuai then
- local hjPDKDefine = require("luaScript.SubGameDefine.hejiangPDKDefine")
- str = hjPDKDefine.getClubTableWanFaInfo(ruleStr)
- end
-
- return str;
- end
|