private void AddServiceAreaInfo(eSERVICE_AREA sa) { NkServiceAreaInfo nkServiceAreaInfo = new NkServiceAreaInfo(sa, sa.ToString()); this.SetServiceAreaInfo(ref nkServiceAreaInfo); if (!TsPlatform.IsEditor) { switch (sa) { case eSERVICE_AREA.SERVICE_ANDROID_GLOBALENGLOCAL: case eSERVICE_AREA.SERVICE_ANDROID_GLOBALJPNLOCAL: case eSERVICE_AREA.SERVICE_ANDROID_GLOBALCHNLOCAL: case eSERVICE_AREA.SERVICE_ANDROID_GLOBALTESTLOCAL: case eSERVICE_AREA.SERVICE_ANDROID_USLOCAL: goto IL_77; case eSERVICE_AREA.SERVICE_ANDROID_GLOBALENGQA: case eSERVICE_AREA.SERVICE_ANDROID_GLOBALJPNQA: case eSERVICE_AREA.SERVICE_ANDROID_GLOBALCHNQA: case eSERVICE_AREA.SERVICE_ANDROID_GLOBALTESTQA: IL_53: if (sa != eSERVICE_AREA.SERVICE_ANDROID_KORLOCAL && sa != eSERVICE_AREA.SERVICE_ANDROID_CNLOCAL && sa != eSERVICE_AREA.SERVICE_ANDROID_JPLOCAL && sa != eSERVICE_AREA.SERVICE_IOS_KORLOCAL) { goto IL_96; } goto IL_77; } goto IL_53; IL_77: nkServiceAreaInfo.SetOriginalDataCDNPath(TsPlatform.Operator.GetFileDir() + "/"); } IL_96: this.m_kServiceAreaInfoList.Add(nkServiceAreaInfo); }
public static ITEM_RATE_OPENURL_DATA GetItemRateOpenUrl() { NkServiceAreaInfo currentServiceAreaInfo = NrTSingleton <NrGlobalReference> .Instance.GetCurrentServiceAreaInfo(); string b = currentServiceAreaInfo.eServiceArea.ToString(); foreach (ITEM_RATE_OPENURL_DATA current in BASE_RATE_OPENURL_DATA.m_listItemRateOpenUrl) { if (current.strService_Code == b) { return(current); } } return(null); }
private void SetCurrentServiceAreaInfo(string servicekey) { NkServiceAreaInfo nkServiceAreaInfo = this.FindServiceArea(servicekey); if (nkServiceAreaInfo == null) { UnityEngine.Debug.LogError("##### Game service area can't find. ###### - " + servicekey); if (TsPlatform.IsAndroid) { this.m_kCurrentServiceAreaInfo = this.FindServiceArea(eSERVICE_AREA.SERVICE_ANDROID_KORLOCAL.ToString()); } else if (TsPlatform.IsIPhone) { this.m_kCurrentServiceAreaInfo = this.FindServiceArea(eSERVICE_AREA.SERVICE_IOS_KORLOCAL.ToString()); } Option.SetProtocolRootPath(Protocol.FILE, "/D:/ndoors/at2dev/Mobile/"); PlayerPrefs.SetString(NrPrefsKey.LOCAL_WWW_PATH, "file:///D:/ndoors/at2dev/Mobile/"); this.localWWW = true; this.useCache = false; } else { this.m_kCurrentServiceAreaInfo = nkServiceAreaInfo; Option.SetProtocolRootPath(nkServiceAreaInfo.eProtocolType, nkServiceAreaInfo.szOriginalDataCDNPath); TsPlatform.FileLog("OriginalCDNPath = " + nkServiceAreaInfo.szOriginalDataCDNPath); if (nkServiceAreaInfo.eProtocolType == Protocol.FILE) { this.localWWW = true; this.useCache = false; } else { this.localWWW = false; this.useCache = true; } if (!PlayerPrefs.HasKey(NrPrefsKey.BASE_PATH)) { PlayerPrefs.SetString(NrPrefsKey.BASE_PATH, servicekey); } if (!PlayerPrefs.HasKey(nkServiceAreaInfo.szPrefsKey)) { PlayerPrefs.SetString(nkServiceAreaInfo.szPrefsKey, Option.GetProtocolRootPath(nkServiceAreaInfo.eProtocolType)); } if (!this.PUBLICMODE.Equals("no")) { int num = UnityEngine.Random.Range(0, 3); if (num >= 3) { num = 2; } NrGlobalReference.strLoginServerIP = nkServiceAreaInfo.szLoginIP[num]; NrGlobalReference.strWebPageDomain = nkServiceAreaInfo.szWebDomain; } else { NrGlobalReference.strLoginServerIP = nkServiceAreaInfo.szPrivateIP; NrGlobalReference.strWebPageDomain = nkServiceAreaInfo.szPrivateDomain; NkServiceAreaInfo expr_186 = nkServiceAreaInfo; expr_186.szImageURL += "de"; } TsLog.LogWarning("LoginServerIP : {0}, WebPageDomain : {1}", new object[] { NrGlobalReference.strLoginServerIP, NrGlobalReference.strWebPageDomain }); } UnityEngine.Debug.LogWarning(" ##### Changed service area to " + this.m_kCurrentServiceAreaInfo.eServiceArea.ToString() + " ##### "); this.m_bSetServiceArea = true; }
private void SetServiceAreaInfo(ref NkServiceAreaInfo pkServiceAreaInfo) { string text = pkServiceAreaInfo.szServiceKey; string path = string.Format("Common/ServiceSettings/ServiceSetting_{0}", NrGlobalReference.strLangType); TextAsset textAsset = Resources.Load(path) as TextAsset; if (textAsset == null) { TsLog.LogError("serviceFileAsset != null", new object[0]); return; } NDataReader nDataReader = new NDataReader(); if (!nDataReader.LoadFrom(textAsset.text)) { TsLog.LogError("파일 로드에 실패 하였습니다. \n{0}", new object[] { textAsset.text }); return; } string text2 = string.Empty; bool flag = false; if (NrGlobalReference.strLiteCheck.Equals("on")) { text += "_LITE"; } while (!nDataReader.IsEOF()) { string column = nDataReader.GetCurrentRow().GetColumn(0); if (column.Length == 0) { nDataReader.NextLine(); } else if (column[0] == '#') { nDataReader.NextLine(); } else if (column[0] == '[') { flag = column.ToLower().Equals("[" + text.ToLower() + "]"); nDataReader.NextLine(); } else if (!flag) { nDataReader.NextLine(); } else { string[] array = column.Split(new char[] { '=' }); if (array[0].ToLower().Equals("protocol")) { text2 = array[1]; if (text2.Equals("file")) { pkServiceAreaInfo.eProtocolType = Protocol.FILE; pkServiceAreaInfo.szPrefsKey = NrPrefsKey.LOCAL_WWW_PATH; } else { pkServiceAreaInfo.eProtocolType = Protocol.HTTP; pkServiceAreaInfo.szPrefsKey = NrPrefsKey.INTERNET_WWW_PATH; } } if (array[0].ToLower().Equals("originaldatacdnpath")) { pkServiceAreaInfo.szOriginalDataCDNPath = array[1]; } if (array[0].ToLower().Equals("edgedatacdnpath")) { pkServiceAreaInfo.szEdgeDataCDNPath = array[1]; } if (array[0].ToLower().Equals("loginip")) { pkServiceAreaInfo.szLoginIP[0] = array[1]; pkServiceAreaInfo.szLoginIP[1] = array[1]; pkServiceAreaInfo.szLoginIP[2] = array[1]; } if (array[0].ToLower().Equals("loginip1")) { pkServiceAreaInfo.szLoginIP[0] = array[1]; } if (array[0].ToLower().Equals("loginip2")) { pkServiceAreaInfo.szLoginIP[1] = array[1]; } if (array[0].ToLower().Equals("loginip3")) { pkServiceAreaInfo.szLoginIP[2] = array[1]; } if (array[0].ToLower().Equals("webdomain")) { pkServiceAreaInfo.szWebDomain = array[1]; } if (array[0].ToLower().Equals("privateip")) { pkServiceAreaInfo.szPrivateIP = array[1]; } if (array[0].ToLower().Equals("privatedomain")) { pkServiceAreaInfo.szPrivateDomain = array[1]; } if (array[0].ToLower().Equals("imageurl")) { pkServiceAreaInfo.szImageURL = array[1]; } nDataReader.NextLine(); } } }