public override void OnExit() { TsLog.Log("--- {0}.OnExit", new object[] { base.GetType().FullName }); if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo != null && NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_bGameConnected) { GS_SET_DRAMA_REQ gS_SET_DRAMA_REQ = new GS_SET_DRAMA_REQ(); gS_SET_DRAMA_REQ.SetType = 2; SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_SET_DRAMA_REQ, gS_SET_DRAMA_REQ); } NrLoadPageScreen.CustomLoadingProgress = false; }
public virtual bool LoadFromTableContext(string strContext) { bool flag = false; using (TsDataReader tsDataReader = new TsDataReader()) { flag = tsDataReader.LoadFrom(strContext, "[Table]", this); } if (!flag) { TsLog.LogError("##### Failed! LoadFromTableContext! - " + base.GetType().ToString(), new object[0]); } return(true); }
public void AddSequenceChallengeTable(ChallengeTable table) { if (!this.m_listChallengeData.Contains(table)) { this.m_listChallengeData.Add(table); } else { TsLog.LogWarning("m_listChallengeData Add Error", new object[] { table.m_nUnique }); } }
public static bool Request(string listFileName, PreDownloader.DownlaodToComplete callback) { if (!Option.EnablePreDownload) { TsLog.LogWarning("[PreDownload] TsBundle.Predownloader.Rqeuset({0}) => Disabled pre-download", new object[] { listFileName }); return(false); } BackgroundInstall backgroundInstall = new BackgroundInstall(); return(backgroundInstall._RequestPreDownload(listFileName, callback)); }
private static TsQualityManager.Level GetLevel_Mobile() { int num = SystemInfo.graphicsPixelFillrate; int graphicsMemorySize = SystemInfo.graphicsMemorySize; int processorCount = SystemInfo.processorCount; int systemMemorySize = SystemInfo.systemMemorySize; int supportedRenderTargetCount = SystemInfo.supportedRenderTargetCount; bool supportsShadows = SystemInfo.supportsShadows; if (num < 0) { int num2 = processorCount * 100; int num3 = (int)Convert.ToInt16((double)graphicsMemorySize * 0.2); num = num2 + num3; } int[] array = new int[] { 500, 600, 1000, 1200 }; int num4 = array.Length; while (--num4 > 0 && num < array[num4]) { } if (num < array[0]) { TsLog.LogWarning("[자동 품질 설정] H/W 사양이 낮아도 너무 낮아~ (FillRate={0})", new object[] { num }); } int num5 = Mathf.Clamp(num4, 2, 4); TsLog.Log("[자동 품질 설정] QualityLevel=\"{0}\" (FillRate={1}, CPU={2}, VideoRAM={3}, SystemRAM={4}, RenderTargets={5}, SupportShadow={6}, Processor=\"{7}\")", new object[] { (TsQualityManager.Level)num5, num, processorCount, graphicsMemorySize, systemMemorySize, supportedRenderTargetCount, supportsShadows, SystemInfo.processorType }); return((TsQualityManager.Level)num5); }
private bool ExcuteEndTrigger() { bool flag = false; bool flag2 = true; foreach (GameObject current in this.EndTriggerList) { if (!(current == null)) { EndTrigger component = current.GetComponent <EndTrigger>(); if (flag) { current.SetActive(true); component.Init(this); if (EventTrigger.m_DebugMode) { TsLog.Log("[{0}] Start EndTrigger: {1}", new object[] { base.GetType().Name, current.name }); } } if (current.activeInHierarchy) { if (!component.bPopNext) { flag = component.IsNextPop(); } current.SetActive(component.Excute()); if (!current.activeInHierarchy && EventTrigger.m_DebugMode) { TsLog.Log("[{0}] End EndTrigger: {1}", new object[] { base.GetType().Name, current.name }); } flag2 = false; } } } if (flag2) { this.EndEndTrigger(); return(false); } return(true); }
public bool Switch() { if (this._targetGO == null) { TsLog.LogError("Error~! TsAudioListenerSwitcher.Switch() reason = Cannot Found targetGameObject~!", new object[0]); return(false); } if (this._targetGO.name.Equals(this.AttachedGameObjectName)) { if (this._targetGO.transform.parent == null) { return(false); } this._targetGO = this._targetGO.transform.parent.gameObject; } AudioListener component = this._targetGO.GetComponent <AudioListener>(); Transform transform = this._targetGO.transform.FindChild(this.AttachedGameObjectName); if (transform == null) { this._attachedChildGO = new GameObject(this.AttachedGameObjectName, new Type[] { typeof(AudioListener) }); this._attachedChildGO.transform.position = this._targetGO.transform.position; this._attachedChildGO.transform.rotation = this._targetGO.transform.rotation; this._attachedChildGO.transform.parent = this._targetGO.transform; } else { this._attachedChildGO = transform.gameObject; } try { this._audioListener = this._attachedChildGO.GetComponent <AudioListener>(); this._audioListener.enabled = true; } catch (Exception ex) { TsLog.LogError(ex.ToString(), new object[0]); return(false); } if (component != null) { UnityEngine.Object.Destroy(component); } TsAudioManager.Instance.OnSuccess_AudioListenerSwitch(this); return(true); }
private static T Acquire <T>(ObjectPoolKey data, object param) where T : class, IPoolObject { Type typeFromHandle = typeof(T); IObjectPoolContainer objectPoolContainer = ObjectPoolManager.I_GetObjectPoolContainer(data); TsLog.Assert(objectPoolContainer != null, "ObjectPoolConatiner is not found for {0} class.", new object[] { typeFromHandle.Name }); T t = (T)((object)null); if (objectPoolContainer == null) { TsLog.Assert(false, "ObjectPoolManager. Class {0} poolContainer is null", new object[] { typeFromHandle.Name }); } else if (objectPoolContainer.objectPoolAttr == null) { TsLog.Assert(false, "ObjectPoolManager. ObjectPoolAttribute for class {0} is null", new object[] { typeFromHandle.Name }); } else if (objectPoolContainer.objectPoolAttr.CreateObjectStaticPrivate == null) { TsLog.Assert(false, "{0} class ObjectPoolAttribute.CreateInstance is not found!", new object[] { typeFromHandle.Name }); } else { t = (objectPoolContainer.Acquire() as T); if (t == null) { TsLog.LogError("ObjectPoolManager.Acquire<T>(). Fail creation {0}.", new object[] { typeFromHandle.Name }); } else { t.OnCreate(param); } } return(t); }
internal bool _RequestPreDownload(string listFileName, PreDownloader.DownlaodToComplete callback) { if (!Option.EnablePreDownload) { TsLog.LogWarning("[PreDownload] Request( \"{0}\" ) => Disalbe Pre-Download.", new object[] { listFileName }); return(false); } BackgroundInstall.Progress progress; if (BackgroundInstall.ms_ProgressCollection.TryGetValue(listFileName, out progress) && progress.downloading) { TsLog.LogWarning("[PreDownload] Request( \"{0}\" ) => alreay request pre-download.", new object[] { listFileName }); return(false); } if (Path.HasExtension(listFileName)) { WWWItem wWWItem = Holder.TryGetOrCreateBundle(listFileName, Option.undefinedStackName); if (wWWItem == null) { TsLog.LogWarning("[PreDownload] Request( \"{0}\" ) => cannot read file from AssetBundle.", new object[] { listFileName }); return(false); } wWWItem.SetCallback(new PostProcPerItem(this._DownloadComplete_ListFile), callback); wWWItem.SetItemType(ItemType.USER_STRING); TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true); } else { TextAsset textAsset = ResourceCache.LoadFromResourcesImmediate(string.Format("PreDownload/{0}", listFileName)) as TextAsset; if (!textAsset) { TsLog.LogWarning("[PreDownload] Request( \"{0}\" ) => cannot read file from resources.", new object[] { listFileName }); return(false); } this._DownloadAssets(listFileName, textAsset.text, callback); } return(true); }
public void SetSkipLoad() { this.m_bLoadedOrSkipped = true; string basePath = NrTSingleton <NrGlobalReference> .Instance.basePath; string message = string.Format("Skip to load \"{0}/{1}\" file.", basePath, PatchFinalList.filename); if (basePath.Contains("DESIGN") || !NrTSingleton <NrGlobalReference> .Instance.useCache) { TsLog.LogWarning(message, new object[0]); } else { TsLog.Assert(false, message, new object[0]); } }
public void InitExcute() { EventTriggerItem_Behavior eventTriggerItem_Behavior = this._GetItem(); if (eventTriggerItem_Behavior == null) { if (NrTSingleton <NrGlobalReference> .Instance.IsEnableLog) { TsLog.Log("Null Behavior:" + base.gameObject.name, new object[0]); } return; } this.bPopNext = false; eventTriggerItem_Behavior.InitExcute(); }
public static void Recv_LS_ENCRYPTKEY_NFY(NkDeserializePacket kDeserializePacket) { LS_ENCRYPTKEY_NFY packet = kDeserializePacket.GetPacket <LS_ENCRYPTKEY_NFY>(); SendPacket.GetInstance().SetEncryptKey(packet.ui8Key1_send, packet.ui8Key2_send, false); TsLog.LogWarning("Recv_LS_ENCRYPTKEY_NFY", new object[0]); if (TsPlatform.IsEditor) { MsgHandler.Handle("LOGIN_USER_REQ", new object[0]); } else { MsgHandler.Handle("PLATFORM_LOGIN_REQ", new object[0]); } }
public static void LoadSkyMeterial(IDownloadedItem wItem, object obj) { if (!wItem.canAccessAssetBundle) { return; } try { RenderSettings.skybox = (wItem.GetSafeBundle().mainAsset as Material); } catch (Exception obj2) { TsLog.LogWarning(obj2); } }
public static void SetSkipMainStep(int skipCntMainStep) { TsLog.Assert(0 <= skipCntMainStep && skipCntMainStep < 5, "Invalid Progress Skip Count", new object[0]); NrLoadPageScreen._mainStepMax = skipCntMainStep; NrLoadPageScreen._mainStepCnt = 0; if (skipCntMainStep == 0) { NrLoadPageScreen._mainStepRatio = 1f; } else { NrLoadPageScreen._mainStepRatio = 1f / (float)NrLoadPageScreen._mainStepMax; } NrLoadPageScreen.ResetProgress(1f); }
public static bool IsVersionCached(string url, int version, bool forceUseCustomCache) { bool flag = (!TsCaching.useCustomCacheOnly && !forceUseCustomCache) ? Caching.IsVersionCached(url, version) : CustomCaching.IsVersionCached(url, version); if (Option.EnableTrace) { TsLog.Log("[TsBundle] IsVersionCached( url=\"{0}\", version={1} ) => {2}", new object[] { url, version, flag }); } return(flag); }
public static void Assert(bool condition, string message, params object[] objs) { if (condition) { return; } if (!TsLog.EnableLogType(TsLog.ELogType.Assert)) { return; } string text = string.Format(message, objs); Debug.LogError(text); TsLog.Instance._assertLog.Add(text); }
public static GameObject LoadFromResourcesWithClone(string keyLower, GameObject goParent) { GameObject gameObject = ResourceCache.LoadFromResources(keyLower) as GameObject; if (null == gameObject) { TsLog.LogError("Fail! CResources::LoadClone - {0}\n\\rCallStack : {1}", new object[] { keyLower, StackTraceUtility.ExtractStackTrace() }); return(null); } return(ResourceCache.CloneObject(gameObject, goParent)); }
private static void MemoryClean() { Resources.UnloadUnusedAssets(); GC.Collect(); GC.Collect(); AutoMemoryCleanUp.m_bEnableMemoryClean = false; float realtimeSinceStartup = Time.realtimeSinceStartup; AutoMemoryCleanUp.m_StayNextChkTime = realtimeSinceStartup + AutoMemoryCleanUp.STAY_PEROID; AutoMemoryCleanUp.m_RegularNextChkTime = realtimeSinceStartup + AutoMemoryCleanUp.REGULAR_PREIOD; TsLog.LogWarning("[Memory] AutoMemoryCleanUp.CleanUp() => call GC, UnloadUsedAsset()\n AppMemory : {0}", new object[] { NrTSingleton <NrMainSystem> .Instance.AppMemory }); }
public void OnItemConfirm(IUIObject obj) { if (this.m_SelectItem != null) { ReforgeMainDlg reforgeMainDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.REFORGEMAIN_DLG) as ReforgeMainDlg; reforgeMainDlg.Set_Value(this.m_SelectItem); reforgeMainDlg.SetSolID(this.m_SolID); this.Close(); } else { TsLog.Log("m_SelectItem == null", new object[0]); } }
public void Init(EventTrigger parent) { EventTriggerItem_EndTrigger eventTriggerItem_EndTrigger = this._GetItem(); if (eventTriggerItem_EndTrigger == null) { if (NrTSingleton <NrGlobalReference> .Instance.IsEnableLog) { TsLog.Log("Null EndTrigger:" + base.gameObject.name, new object[0]); } return; } this.ParentTrigger = parent; eventTriggerItem_EndTrigger.Init(); }
public static void InitiailzeCustomCaching(string url, string local) { if (string.IsNullOrEmpty(url)) { TsLog.LogError("CustomCaching. Fail initialization. web url is null", new object[0]); return; } if (string.IsNullOrEmpty(local)) { TsLog.LogError("CustomCaching. Fail initialization. local path is null", new object[0]); return; } TsLog.LogWarning("$$$SysConfig:InitializeCustomCaching.........", new object[0]); CustomCaching.InitiailzeCustumCaching(url, local); }
private void onDataReceivedListenPort(object sender, SerialDataReceivedEventArgs e) { this.Invoke(new MethodInvoker(delegate { printListenPortReceivedData("-------------------- recv start"); })); System.Array.Clear(m_listen_port_read_buf, 0, m_listen_port_read_buf.Length); m_listen_port_read_len = 0; int onetime_read_len = 0; while (m_listen_port.BytesToRead > 0) { onetime_read_len = ((m_listen_port_read_len + m_listen_port.BytesToRead) < m_listen_port_read_buf.Length ? m_listen_port.BytesToRead : (m_listen_port_read_buf.Length - m_listen_port_read_len)); m_listen_port.Read(m_listen_port_read_buf, m_listen_port_read_len, onetime_read_len); m_listen_port_read_len += onetime_read_len; } //String read_msg_0 = System.Text.Encoding.ASCII.GetString(m_listen_port_read_buf); //String read_msg_1 = System.Text.Encoding.UTF8.GetString(m_listen_port_read_buf); //String read_msg_2 = System.Text.Encoding.Unicode.GetString(m_listen_port_read_buf); //String read_msg_3 = System.Text.Encoding.UTF32.GetString(m_listen_port_read_buf); String read_msg = System.Text.Encoding.Default.GetString(m_listen_port_read_buf); // 운영체제에 맞는 코드 페이지 TsLog.writeLog(read_msg); // log this.Invoke(new MethodInvoker(delegate { printListenPortReceivedData(" >> read: " + m_listen_port_read_len.ToString()); })); this.Invoke(new MethodInvoker(delegate { printListenPortReceivedData("-------------------- recv end--"); })); //String read_data = m_listen_port.ReadExisting(); //this.Invoke(new MethodInvoker(delegate { printListenPortReceivedData(read_data); })); if (0 < m_listen_port_read_len) { // request save ObjPrinterSerialRawDataBuf input_raw_data = new ObjPrinterSerialRawDataBuf(); input_raw_data.setObj("test_input_type", m_listen_port_read_buf, 0, m_listen_port_read_len, "test_output_type"); input_raw_data.requestSendRowData(); // push to list lock (m_recv_raw_data_list_lock) { m_recv_raw_data_list.Add(input_raw_data); } // button enable this.Invoke(new MethodInvoker(delegate { setFormControlEnable(true); })); } }
private void CheckPoolCounter_I() { if (this.initCapacity <= 0) { TsLog.LogWarning("{0} ObjectPoolAttribute.initCapacity is invalid value({1}). use default value 16", new object[] { this.typeName, this.initCapacity }); this.initCapacity = 16; } else if (this.initCapacity > 1024) { TsLog.LogWarning("{0} ObjectPoolAttribute.initCapacity is too big ({1}).", new object[] { this.initCapacity }); } if (this.initCount < 0) { TsLog.LogWarning("{0} ObjectPoolAttribute.initCapacity is invalid value({1}). use default value 16", new object[] { this.typeName, this.initCapacity }); this.initCount = ((this.initCapacity <= 16) ? this.initCapacity : 16); } else if (this.initCount > this.initCapacity) { TsLog.LogWarning("{0} ObjectPoolAttribute.initCount is bigger than initCapacity", new object[] { this.typeName }); this.initCapacity = this.initCount; } if (this.limitCount < this.initCapacity) { TsLog.LogWarning("{0} ObjectPoolAttribute.limitCount is smaller than initCapacity", new object[] { this.typeName }); this.limitCount = this.initCapacity; } if (TsPlatform.IsMobile && this.initCount > 16) { this.initCount = 16; } }
public GameObject[] ReadXML(XmlReader Reader) { if (Reader == null) { if (NrTSingleton <NrGlobalReference> .Instance.IsEnableLog) { TsLog.Log("Can't Read XMLFile : " + Application.dataPath + "/../Test.xml", new object[0]); } return(null); } GameObject[] result; try { List <GameObject> list = new List <GameObject>(); Reader.ReadStartElement("EventTrigger"); while (Reader.ReadToNextSibling("Object")) { if (Reader.NodeType == XmlNodeType.EndElement) { break; } if (Reader.NodeType == XmlNodeType.Element) { string attribute = Reader.GetAttribute("Name"); GameObject gameObject = EventTriggerHelper.CreateEventTriggerObject(attribute, typeof(EventTrigger_Game), null); EventTrigger component = gameObject.GetComponent <EventTrigger>(); component.ReadXML(Reader); list.Add(gameObject); } Reader.Read(); } Reader.Close(); if (NrTSingleton <NrGlobalReference> .Instance.IsEnableLog) { TsLog.Log("Readed XML", new object[0]); } result = list.ToArray(); } catch (Exception ex) { if (NrTSingleton <NrGlobalReference> .Instance.IsEnableLog) { TsLog.LogError(ex.Message + " " + ex.StackTrace, new object[0]); } result = null; } return(result); }
public static void Reset() { try { float realtimeSinceStartup = Time.realtimeSinceStartup; AutoMemoryCleanUp.m_StayNextChkTime = realtimeSinceStartup + AutoMemoryCleanUp.STAY_PEROID; AutoMemoryCleanUp.m_RegularNextChkTime = realtimeSinceStartup + AutoMemoryCleanUp.REGULAR_PREIOD; AutoMemoryCleanUp.m_fMemCheckTime = realtimeSinceStartup + AutoMemoryCleanUp.MEM_CHECK_TIME; AutoMemoryCleanUp.m_CheckingMemSize = NrTSingleton <NrMainSystem> .Instance.AppMemory; AutoMemoryCleanUp.m_LimitMemoryCount = 0; } catch (Exception obj) { TsLog.LogError(obj); } }
public static string GetProtocolRootPath(Protocol prtcl) { string text = Option.ms_protocol[(int)prtcl]; string text2 = Option.ms_rootPath[(int)prtcl]; if (string.IsNullOrEmpty(text) || string.IsNullOrEmpty(text2)) { TsLog.LogError("TsBundle.Option is not initialized. You must call TsBundle.Option.SetProtocolRootPath() first. Protocol={0} Root={1}", new object[] { text.ToString(), text2 }); return("undefined"); } return(text + text2); }
private void ClickPrev(IUIObject obj) { if (this.m_ShowType == InfiBattleDefine.eINFIBATTLE_RANKMODE.eINFIBATTLE_RANKMODE_LASTWEEK) { return; } if (this.m_iCurrentPage > 1) { int num = (this.m_iCurrentPage - 2) * 10 + 1; TsLog.LogWarning(" ClickPrev {0}", new object[] { num }); this.GetRank((byte)this.m_eRankMode, num); } }
private void ReadCommonBlock(BinaryReader br, int blockSize) { this.lineHeight = (int)br.ReadUInt16(); this.baseHeight = (int)br.ReadUInt16(); this.texWidth = (int)br.ReadUInt16(); this.texHeight = (int)br.ReadUInt16(); int num = (int)br.ReadUInt16(); if (num > 1) { TsLog.LogError("Multiple pages/textures detected for font \"" + this.face + "\". only one font atlas is supported.", new object[0]); } int count = blockSize - 10; br.ReadBytes(count); }
public void Collect(TsSceneSwitcher.ESceneType eSceneType, GameObject go) { if (!TsSceneSwitcher.IsValidSceneType(eSceneType) || go == null) { TsLog.LogWarning("Invalid SceneType[{0}] go[{1}]", new object[] { eSceneType, (!(go == null)) ? go.name : "null" }); return; } GameObject gameObject = this._MakeRootSceneGO(eSceneType); this._AddOrGetComponent(go, eSceneType); this._Collect(go, gameObject, eSceneType, gameObject.activeInHierarchy); }
public void CollectAllMapGameObjects(TsSceneSwitcher.ESceneType eSceneType, bool isActive) { if (!TsSceneSwitcher.IsValidSceneType(eSceneType)) { TsLog.LogWarning("Invalid SceneType= " + eSceneType, new object[0]); return; } GameObject rootGO = this._MakeRootSceneGO(eSceneType); GameObject gameObject = this._GetBundle_RootSceneGO(eSceneType); if (gameObject == null) { return; } this._TraverseToSetMarkAndCollect(rootGO, gameObject, eSceneType); }