MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / resolveMods

Method resolveMods

launcher/modplatform/modpacksch/FTBPackInstallTask.cpp:130–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void PackInstallTask::resolveMods()
131{
132 setStatus(tr("Resolving mods..."));
133 setProgress(0, 100);
134
135 m_file_id_map.clear();
136
137 Flame::Manifest manifest;
138 for (auto const& file : m_version.files) {
139 if (!file.serverOnly && file.url.isEmpty()) {
140 if (file.curseforge.file_id <= 0) {
141 emitFailed(tr("Invalid manifest: There's no information available to download the file '%1'!").arg(file.name));
142 return;
143 }
144
145 Flame::File flame_file;
146 flame_file.projectId = file.curseforge.project_id;
147 flame_file.fileId = file.curseforge.file_id;
148 flame_file.hash = file.sha1;
149
150 manifest.files.insert(flame_file.fileId, flame_file);
151 m_file_id_map.append(flame_file.fileId);
152 } else {
153 m_file_id_map.append(-1);
154 }
155 }
156
157 m_mod_id_resolver_task = new Flame::FileResolvingTask(APPLICATION->network(), manifest);
158
159 connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::succeeded, this, &PackInstallTask::onResolveModsSucceeded);
160 connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::failed, this, &PackInstallTask::onResolveModsFailed);
161 connect(m_mod_id_resolver_task.get(), &Flame::FileResolvingTask::progress, this, &PackInstallTask::setProgress);
162
163 m_mod_id_resolver_task->start();
164}
165
166void PackInstallTask::onResolveModsSucceeded()
167{

Callers

nothing calls this directly

Calls 7

isEmptyMethod · 0.80
insertMethod · 0.80
appendMethod · 0.80
networkMethod · 0.80
clearMethod · 0.45
getMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected