MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / RefreshInstalledStates

Function RefreshInstalledStates

engine/Poseidon/UI/OptionsUIApp.cpp:1421–1438  ·  view source on GitHub ↗

After a successful download, flip the now-installed rows off Missing so BuildModPath mounts them. Preserves ticks (SetRows copies the rows back).

Source from the content-addressed store, hash-verified

1419 std::vector<StagedModInstall>& installs, bool& hasUpdates)
1420{
1421 const AutoArray<ModRow>& rows = list->GetRows();
1422 for (int i = 0; i < rows.Size(); i++)
1423 {
1424 const ModRow& r = rows[i];
1425 if (!r.checked)
1426 continue;
1427 const std::string modId = BareModId(r.modId);
1428 const std::string folderName = (const char*)r.folderName;
1429 const std::string destDir = ModInstallDir(root, modId, folderName);
1430 StagedModInstall preserved;
1431 if (FindPreservedStagedModInstall(destDir, modId, r.packageRevision, (const char*)r.sha256, preserved))
1432 {
1433 installs.push_back(std::move(preserved));
1434 continue;
1435 }
1436 if ((r.state != ModRowState::Missing && r.freshness != ModRowFreshness::UpdateAvailable) ||
1437 r.downloadUrl.GetLength() == 0)
1438 continue;
1439 hasUpdates = hasUpdates || r.freshness == ModRowFreshness::UpdateAvailable;
1440 StagedModInstall install = MakeStagedModInstall(destDir, modId);
1441 const std::string stagingDir = install.stagingDir;

Callers 1

OnChildDestroyedMethod · 0.85

Calls 4

GetModInstallStatusFunction · 0.85
BareModIdFunction · 0.85
SizeMethod · 0.45
SetRowsMethod · 0.45

Tested by

no test coverage detected