public void onWebMiniLoaded() { // 删除旧 mini 版本,修改新版本文件名字 UtilApi.delFile(Path.Combine(Ctx.m_instance.m_localFileSys.getLocalWriteDir(), FilesVer.FILENAME)); // 修改新的版本文件名字 UtilApi.renameFile(UtilLogic.combineVerPath(Path.Combine(Ctx.m_instance.m_localFileSys.getLocalWriteDir(), FilesVer.MINIFILENAME), m_miniVer), Path.Combine(Ctx.m_instance.m_localFileSys.getLocalWriteDir(), FilesVer.MINIFILENAME)); m_needUpdateVerFile = (m_localVer.m_miniPath2HashDic[FilesVer.FILENAME].m_fileMd5 != m_webVer.m_miniPath2HashDic[FilesVer.FILENAME].m_fileMd5); // 如果版本不一致,需要重新加载 //m_needUpdateVerFile = true; // 测试强制更新 m_miniLoadResultDisp(); }
public void loadOneUpdateFile(string path, FileVerInfo fileInfo) { //string loadPath = UtilApi.combineVerPath(path, fileInfo.m_fileMd5); //m_loadingPath.Add(loadPath); m_loadingPath.Add(UtilLogic.webFullPath(path)); if (Ctx.m_instance.m_versionSys.m_localVer.m_path2HashDic.ContainsKey(path)) { UtilApi.delFile(Path.Combine(Ctx.m_instance.m_localFileSys.getLocalWriteDir(), UtilLogic.combineVerPath(path, Ctx.m_instance.m_versionSys.m_localVer.m_path2HashDic[path].m_fileMd5))); // 删除当前目录下已经有的 old 文件 } //UtilApi.delFileNoVer(path); // 删除当前目录下已经有的 old 文件 LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); param.m_path = path; param.m_resLoadType = ResLoadType.eLoadWeb; param.m_version = fileInfo.m_fileMd5; param.m_loadEventHandle = onLoadEventHandle; Ctx.m_instance.m_resLoadMgr.loadData(param); Ctx.m_instance.m_poolSys.deleteObj(param); }