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

Method Resolve

engine/Poseidon/Core/ServerModResolve.cpp:54–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54ServerModResolution ServerModResolver::Resolve(const ServerModList& server, const ModCatalog& catalog) const
55{
56 ServerModResolution out;
57
58 for (const ModId& id : server.Required())
59 {
60 if (_installed.count(id) != 0)
61 {
62 out._satisfied.push_back(id);
63 continue;
64 }
65 if (const ModCatalogEntry* e = catalog.Find(id))
66 {
67 out._toDownload.push_back(
68 {id, e->Name().empty() ? id.Value() : e->Name(), e->DownloadUrl(), e->FolderName(), e->SizeBytes()});
69 }
70 else
71 {
72 out._blocked.push_back(id);
73 }
74 }
75
76 // Only an exact-match server forces extras off; otherwise the player keeps them.
77 if (server.RequiresExactMatch())
78 {
79 std::unordered_set<ModId, ModId::Hash> seen;
80 for (const ModId& id : _active)
81 {
82 if (id.Empty() || server.Requires(id))
83 {
84 continue;
85 }
86 if (seen.insert(id).second)
87 {
88 out._toDisable.push_back(id);
89 }
90 }
91 }
92
93 return out;
94}
95
96} // namespace Poseidon

Callers 2

AnswerMpResolveQueryFunction · 0.45

Calls 9

ValueMethod · 0.80
SizeBytesMethod · 0.80
RequiresExactMatchMethod · 0.80
RequiresMethod · 0.80
countMethod · 0.45
FindMethod · 0.45
emptyMethod · 0.45
NameMethod · 0.45
EmptyMethod · 0.45

Tested by

no test coverage detected