//========================================================================================== #region 日志 public static void UploadLog() { if (m_IsLogUploading) { m_LogUploadTips = "正在上传中,请稍候再操作.."; return; } try { byte[] bytes = LoadCurrentLogFile(); if (bytes != null && bytes.Length > 0) { WWWForm form = new WWWForm(); form.AddField("User", 0); form.AddField("Time", (int)TimeUtils.GetTotalSecondsSince1970()); form.AddBinaryData("Content", bytes); WWW www = new WWW(m_LogUploadUrl, form); MonoHelper.StartCoroutine(UploadLogPost(www)); m_IsLogUploading = true; } } catch (Exception e) { Debuger.LogError("SGFDebugerGUI", "Upload() Failed: " + e.Message + e.StackTrace); return; } }
public void RequestMemoryAsync(MemoryQuest memory_quest, MemoryLoadCallbackFunc callback) { if (AppConst.UseUpdatOriModeReal && AppConst.UseUpdatOriThreadMode) { if (this.m_thread == null) { this.m_thread = new Thread(new ThreadStart(this.OnThreadUpdate)); this.m_thread.Start(); } DownloadData data = new DownloadData(); data.callback = callback; data.memory_quest = memory_quest; //如果没有传save_path,则默认是下载byte[]数据 if (string.IsNullOrEmpty(memory_quest.save_path)) { data.IsFile = false; } else { data.IsFile = true; } Queue <DownloadData> request_list = ResRequest.m_request_list; lock (request_list) { ResRequest.m_request_list.Enqueue(data); } } else { MonoHelper.StartCoroutine(this.LoadToMemoryAsyncImpl(memory_quest, callback)); } }
public void LoadModel(string name) { uniFBXImport.setting.paths.urlModels = Constant.GetModelPath(); uniFBXImport.setting.paths.urlTextures = Constant.GetModelTexPath(); uniFBXImport.setting.paths.filename = name; uniFBXImport.Load(); MonoHelper.StartCoroutine(WaitForLoad()); ShowModelList(); }
public void CheckExtractResource() { bool debugMode = AppConst.DebugMode; if (debugMode) { this.ToNextState(); } else { MonoHelper.StartCoroutine(this.OnExtractResource()); } }
public void Update() { bool start_res_download_outtime_check = this.m_start_res_download_outtime_check; if (start_res_download_outtime_check) { bool flag = this.m_normal_download_state && this.m_start_download_time == 0f; if (flag) { this.m_start_download_time = Time.time; } bool flag2 = this.m_start_download_time > 0f && Time.time - this.m_start_download_time > this.m_dowmload_timeout && (m_normal_list.Count > 0 || this.m_current_res != null); if (flag2) { string file_name = Util.GetAssetsBundlePathFromBase64(this.m_current_res); string error_msg = "auto download res timeout:" + this.m_current_res + " raw filw:" + file_name; Util.ThrowLuaException(error_msg, null, 1); this.CancelDownload(); } } if (this.m_wait_callback) { if (this.m_lua_func != null) { this.m_lua_func.Call(new object[] { this.m_cur_download_state, this.m_cur_download_size }); } if (this.m_cur_download_state && this.m_current_res != null) { if (this.m_open_delay_write_version_mode) { this.m_version_file_list.Add(this.m_current_res); } else { MonoHelper.StartCoroutine(this.WriteVersionFile(this.m_current_res)); } } this.m_wait_callback = false; this.m_cur_download_state = false; this.m_cur_download_size = 0; this.m_current_res = null; this.m_normal_download_state = false; } }
private IEnumerator CheckUpdateFileList(string pack_name, LuaFunction func, int frame_check_count) { int num; for (int index = 0; index < m_pack_list.Count; index = num) { SqliteFilePack pack = m_pack_list[index]; if (pack.m_pack_name == pack_name) { yield return(MonoHelper.StartCoroutine(pack.GetUpdateFileList(func, frame_check_count))); } pack = null; num = index + 1; } yield break; }
public void AutoWriteVersionFile(int count) { if (this.m_open_delay_write_version_mode) { int res_count = this.m_version_file_list.Count; if (res_count > count) { res_count = count; } if (res_count > 0) { MonoHelper.StartCoroutine(this.AutoWriteAsyncVersionFile(res_count)); } if (count == 9999) { this.OnDestroy(); } } }
public void StartCheckUpdatePack(string pack_name, LuaFunction func, int frame_check_count) { MonoHelper.StartCoroutine(CheckUpdateFileList(pack_name, func, frame_check_count)); }
public static void CloseBlock() { MonoHelper.StartCoroutine(LateCloseWindow()); }
/// <summary> /// Load async. /// </summary> /// <param name="id"></param> /// <param name="start"></param> /// <param name="loading"></param> /// <param name="finished"></param> /// <param name="mode"></param> public void LoadAsync(int id, Action <AsyncOperation> start, Action <AsyncOperation> loading, Action <AsyncOperation> finished, LoadSceneMode mode = LoadSceneMode.Single) => _monoHelper.StartCoroutine(LoadAct(id, start, loading, finished, mode));
public void LoadConfig() { MonoHelper.StartCoroutine(LoadLocalConfig()); }
public override void OnStateEnter(GameState pCurState) { Debug.Log("enter UpdateResStateListner"); BusinessManager.Instance.SendMessage(ModuleDef.LaunchModule, "SendMessageCommand", "UpdateMessage", GameConfig.Instance["UpdateDetection"]); MonoHelper.StartCoroutine(ResUpdateManager.Instance.CheckVersionFile()); }