public static void LoadCharactorConfig(string uid) { User_Config.curUid = uid; if (User_Config.config_file.goTo(uid)) { User_Config.recieveSystemChannel = User_Config.config_file.GetValue_Int("recieveSystemChannel", 0); User_Config.recieveWorldChannel = User_Config.config_file.GetValue_Int("recieveWorldChannel", 0); User_Config.recieveNearChannel = User_Config.config_file.GetValue_Int("recieveNearChannel", 0); User_Config.recieveGangChannel = User_Config.config_file.GetValue_Int("recieveGangChannel", 0); User_Config.recieveTeamChannel = User_Config.config_file.GetValue_Int("recieveTeamChannel", 0); User_Config.recieveStrangerChannel = User_Config.config_file.GetValue_Int("recieveStrangerChannel", 0); User_Config.autoVoiceToText = User_Config.config_file.GetValue_Int("autoVoiceToText", 0); User_Config.autoPlayWorldVoice = User_Config.config_file.GetValue_Int("autoPlayWorldVoice", 0); User_Config.autoPlayNearVoice = User_Config.config_file.GetValue_Int("autoPlayNearVoice", 0); } else { User_Config.config_file.SetSelctor(uid); User_Config.config_file.SetInt("recieveSystemChannel", 1); User_Config.config_file.SetInt("recieveWorldChannel", 1); User_Config.config_file.SetInt("recieveNearChannel", 1); User_Config.config_file.SetInt("recieveGangChannel", 1); User_Config.config_file.SetInt("recieveTeamChannel", 1); User_Config.config_file.SetInt("recieveStrangerChannel", 1); User_Config.config_file.SetInt("autoVoiceToText", 0); User_Config.config_file.SetInt("autoPlayWorldVoice", 0); User_Config.config_file.SetInt("autoPlayNearVoice", 0); User_Config.Save(); } }
public static void SetLastServerList(ArrayList list) { if (User_Config.lastServerList == null) { User_Config.lastServerList = new List <ServerInfo>(); } User_Config.lastServerList.AddRange(User_Config.GetServerList(list)); User_Config.lastServerList.Sort((ServerInfo x, ServerInfo y) => x.openTime.CompareTo(y.openTime) * -1); }
public static void LoadGlobalSetting() { User_Config.curUid = "gameSetting"; if (User_Config.config_file.goTo(User_Config.curUid)) { User_Config.autoPlayGangVoice = User_Config.config_file.GetValue_Int("autoPlayGangVoice", 0); User_Config.autoPlayTeamVoice = User_Config.config_file.GetValue_Int("autoPlayTeamVoice", 0); User_Config.autoPlayPrivateChatVoice = User_Config.config_file.GetValue_Int("autoPlayPrivateChatVoice", 0); User_Config.blockAllianPlayer = User_Config.config_file.GetValue_Int("blockAllianPlayer", 0); User_Config.blockOtherPartner = User_Config.config_file.GetValue_Int("blockOtherPartner", 0); User_Config.blockOtherPlayer = User_Config.config_file.GetValue_Int("blockOtherPlayer", 0); User_Config.blockOtherLingqi = User_Config.config_file.GetValue_Int("blockOtherLingqi", 0); User_Config.blockOtherPet = User_Config.config_file.GetValue_Int("blockOtherPet", 0); User_Config.blockMonster = User_Config.config_file.GetValue_Int("blockMonster", 0); User_Config.useLuQi = User_Config.config_file.GetValue_Int("useLuQi", 0); User_Config.quality = User_Config.config_file.GetValue_Int("quality", 0); User_Config.isMusic = User_Config.config_file.GetValue_Int("isMusic", 0); User_Config.isAudio = User_Config.config_file.GetValue_Int("isAudio", 0); User_Config.playerScreenCount = User_Config.config_file.GetValue_Float("playerScreenCount", 0f); User_Config.volumn = User_Config.config_file.GetValue_Float("volumn", 0f); User_Config.noticesTime = User_Config.config_file.GetValue_String("noticesTime", string.Empty); } else { User_Config.config_file.SetSelctor(User_Config.curUid); User_Config.config_file.SetInt("autoPlayGangVoice", 0); User_Config.config_file.SetInt("autoPlayTeamVoice", 0); User_Config.config_file.SetInt("autoPlayPrivateChatVoice", 0); User_Config.config_file.SetInt("showJingjiWings", 1); User_Config.config_file.SetInt("blockAllianPlayer", 0); User_Config.config_file.SetInt("blockOtherPartner", 0); User_Config.config_file.SetInt("blockOtherPlayer", 0); User_Config.config_file.SetInt("blockOtherLingqi", 0); User_Config.config_file.SetInt("blockOtherPet", 0); User_Config.config_file.SetInt("blockMonster", 0); User_Config.config_file.SetInt("quality", 1); User_Config.config_file.SetInt("isMusic", 1); User_Config.config_file.SetInt("isAudio", 1); User_Config.config_file.SetFloat("playerScreenCount", 1f); User_Config.config_file.SetFloat("volumn", 1f); User_Config.config_file.SetInt("useLuQi", 0); User_Config.config_file.SetString("noticesTime", "0"); User_Config.Save(); } }
public static void LoadConfig(string configContent) { User_Config.Initilize(configContent); if (User_Config.config_file != null && User_Config.config_file.goTo("appsetting")) { User_Config.internal_sdk = User_Config.config_file.GetValue_Int("internal_sdk", 0); AppConst.AppName = User_Config.config_file.GetValue_String("app_name", string.Empty); } if (User_Config.config_file != null && User_Config.config_file.goTo("download")) { User_Config.sdk_server_url = User_Config.config_file.GetValue_String("sdk_server_link", string.Empty); User_Config.cdn_server_url = User_Config.config_file.GetValue_String("cdn_server_link", string.Empty); User_Config.resource_server = User_Config.config_file.GetValue_String("resource_server", string.Empty); } if (User_Config.internal_sdk == 1) { return; } if (User_Config.config_file != null && User_Config.config_file.goTo("user")) { if (!string.IsNullOrEmpty(User_Config.config_file.GetValue_String("user_account", string.Empty))) { try { byte[] bytes = Convert.FromBase64String(User_Config.config_file.GetValue_String("user_account", string.Empty)); User_Config.user_account = Encoding.GetString(bytes); } catch (Exception ex) { Debug.LogError("get user account error: " + ex.Message.ToString()); } } if (!string.IsNullOrEmpty(User_Config.config_file.GetValue_String("user_password", string.Empty))) { try { byte[] bytes2 = Convert.FromBase64String(User_Config.config_file.GetValue_String("user_password", string.Empty)); User_Config.user_password = Encoding.GetString(bytes2); } catch (Exception ex2) { Debug.LogError("get user password error: " + ex2.Message.ToString()); } } } if (User_Config.config_file != null && User_Config.config_file.goTo("net")) { string value_String = User_Config.config_file.GetValue_String("server_ip", string.Empty); string value_String2 = User_Config.config_file.GetValue_String("server_port", string.Empty); User_Config.default_server = User_Config.config_file.GetValue_Int("default_serverno", 0); User_Config.ip = string.Format("{0}:{1}", value_String, value_String2); User_Config.gm_url = User_Config.config_file.GetValue_String("gm_url", string.Empty); } if (User_Config.config_file != null && User_Config.config_file.goTo("download")) { string text = User_Config.config_file.GetValue_String("server_link", string.Empty); if (text.IndexOf("http://") == -1 && text.IndexOf("https://") == -1) { text = "http://" + text; } User_Config.server_url = text; } }