public void SetingConfig(EsObject esConfig) { if (esConfig.variableExists(DEFINE_LOBBY_NAME)) { nameLobby = esConfig.getString(DEFINE_LOBBY_NAME); } if (esConfig.variableExists(DEFINE_BETTING)) { betting = esConfig.getInteger(DEFINE_BETTING); } if (esConfig.variableExists(DEFINE_INVITED_USERS)) { invitedUsers = esConfig.getStringArray(DEFINE_INVITED_USERS); } GameConfig config = new GameConfig( esConfig.getBoolean(DEFINE_USING_TYPE_RULE), esConfig.getBoolean(DEFINE_USING_U_TRON_RULE), esConfig.getBoolean(DEFINE_USING_U_XUONG_RULE), esConfig.getBoolean(DEFINE_USING_XAO_KHAN_RULE), esConfig.getBoolean(DEFINE_USING_DEN_CHONG_RULE), esConfig.getBoolean(DEFINE_USING_CHOT_CHONG_RULE)); if (esConfig.variableExists(DEFINE_LOBBY_PASWORD)) { config.password = esConfig.getString(DEFINE_LOBBY_PASWORD); } this.config = config; }
public void SetingConfig(EsObject esConfig) { if (esConfig.variableExists(DEFINE_LOBBY_NAME)) { nameLobby = esConfig.getString(DEFINE_LOBBY_NAME); } if (esConfig.variableExists(DEFINE_BETTING)) { betting = esConfig.getInteger(DEFINE_BETTING); } if (esConfig.variableExists(DEFINE_INVITED_USERS)) { invitedUsers = esConfig.getStringArray(DEFINE_INVITED_USERS); } if (esConfig.variableExists(DEFINE_PLAY_ACTION_TIME)) { timePlay = esConfig.getInteger(DEFINE_PLAY_ACTION_TIME); } if (esConfig.variableExists(DEFINE_USING_AUTO_BAT_BAO)) { autoBatBao = esConfig.getBoolean(DEFINE_USING_AUTO_BAT_BAO); } if (esConfig.variableExists(DEFINE_USING_AUTO_U)) { autoU = esConfig.getBoolean(DEFINE_USING_AUTO_U); } if (esConfig.variableExists(DEFINE_USING_NUOI_GA)) { ruleGa = (EGaRule)esConfig.getInteger(DEFINE_USING_NUOI_GA); } GameConfig config = new GameConfig( esConfig.getInteger(DEFINE_RULE_FULL_PLAYING), esConfig.getInteger(DEFINE_USING_NUOI_GA), esConfig.getBoolean(DEFINE_USING_AUTO_BAT_BAO), esConfig.getInteger(DEFINE_PLAY_ACTION_TIME), esConfig.getBoolean(DEFINE_USING_AUTO_U)); if (esConfig.variableExists(DEFINE_LOBBY_PASWORD)) { config.password = esConfig.getString(DEFINE_LOBBY_PASWORD); } this.config = config; }
public override void SetDataJoinLobby(EsObject obj) { SetDataChannelLobby(obj); if (obj.variableExists("gameDetails")) { EsObject gameDetails = obj.getEsObject("gameDetails"); if (gameDetails.variableExists("config")) { EsObject esConfig = gameDetails.getEsObject("config"); SetingConfig(esConfig); } if (gameDetails.variableExists("parent")) { parent = new RoomInfo(gameDetails.getEsObject("parent")); } if (gameDetails.variableExists(DEFINE_INVITED_USERS)) { invitedUsers = gameDetails.getStringArray(DEFINE_INVITED_USERS); } if (gameDetails.variableExists("roomMasterUsername")) { roomMasterUsername = gameDetails.getString("roomMasterUsername"); } if (gameDetails.variableExists("gameIndex")) { gameIndex = gameDetails.getInteger("gameIndex"); } if (gameDetails.variableExists("defaultInfo")) { EsObject defaultInfo = gameDetails.getEsObject("defaultInfo"); numberRobotAllowed = defaultInfo.getInteger("numRobotAllowed"); } } }