mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Speed up GetAvailableMods for archives.
Refs64bfa089afand44ec2e324eWhen a .zip file is encountered by the VFS population, it reads the info for all files in the archives. This is quite slow for the public archive (400-500ms on my computer), which means calling GetEngineInfo() repeatedly is impossible. By only opening the external mod.json, we skip most of the work. The archive can still be opened if needed as fallback. Differential Revision: https://code.wildfiregames.com/D3216 This was SVN commit r25446.
This commit is contained in:
+2
-2
@@ -309,7 +309,7 @@ void ModIo::StartDownloadMod(u32 idx)
|
||||
if (idx >= m_ModData.size())
|
||||
return;
|
||||
|
||||
const Paths paths(g_args);
|
||||
const Paths paths(g_CmdLineArgs);
|
||||
const OsPath modUserPath = paths.UserData()/"mods";
|
||||
const OsPath modPath = modUserPath/m_ModData[idx].properties["name_id"];
|
||||
if (!DirectoryExists(modPath) && INFO::OK != CreateDirectories(modPath, 0700, false))
|
||||
@@ -482,7 +482,7 @@ bool ModIo::AdvanceRequest(const ScriptInterface& scriptInterface)
|
||||
m_DownloadProgressData.status = DownloadProgressStatus::SUCCESS;
|
||||
|
||||
{
|
||||
Paths paths(g_args);
|
||||
Paths paths(g_CmdLineArgs);
|
||||
CModInstaller installer(paths.UserData() / "mods", paths.Cache());
|
||||
installer.Install(m_DownloadFilePath, g_ScriptContext, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user