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

Class ServerModList

engine/Poseidon/Core/ServerModResolve.hpp:62–77  ·  view source on GitHub ↗

What a server requires of a joining client: a set of mod ids and whether the match must be exact (no extra local mods). Parsed from the server's `mod` string.

Source from the content-addressed store, hash-verified

60/// What a server requires of a joining client: a set of mod ids and whether the
61/// match must be exact (no extra local mods). Parsed from the server's `mod` string.
62class ServerModList
63{
64 public:
65 ServerModList() = default;
66 ServerModList(const std::string& modString, bool equalModRequired);
67
68 const std::vector<ModId>& Required() const { return _required; }
69 bool RequiresExactMatch() const { return _exact; }
70 bool Requires(const ModId& id) const { return _set.count(id) != 0; }
71 bool Empty() const { return _required.empty(); }
72
73 private:
74 std::vector<ModId> _required;
75 std::unordered_set<ModId, ModId::Hash> _set;
76 bool _exact = false;
77};
78
79/// A required mod that is absent on disk but present in the catalog — what we'd
80/// download to satisfy the server.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected