7#include <unordered_map>
40 bool Empty()
const {
return _required.empty(); }
43 std::vector<uint64_t>
Required()
const;
81 std::vector<uint64_t> Downloaded;
91 std::vector<Requirement> _required;
92 std::unordered_map<int64_t, Client> _clients;
AddonDecision DecideJoinMessage(int64_t steamId, bool reconnect, std::string_view addons, double now, int maxAttempts)
bool HasMissing(int64_t steamId) const
void ClientReconnected(int64_t steamId, double now, double timeoutSec)
std::vector< uint64_t > ClientMountList(int64_t steamId) const
void MarkSending(int64_t steamId, uint64_t id, double now)
std::vector< uint64_t > Required() const
void ClientLeft(int64_t steamId, double now, double forgetAfterSec)
AddonDecision NextToSend(int64_t steamId, double now, int maxAttempts)
std::vector< uint64_t > MissingFor(int64_t steamId) const
static std::string ReadFile(const std::filesystem::path &path)
std::vector< uint64_t > AppendToAddonList(std::string &field, const std::vector< uint64_t > &ids)
void RemoveFromAddonList(std::string &field, const std::vector< uint64_t > &ids)
std::vector< uint64_t > ParseAddonList(std::string_view field)
@ TrimToFirst
the message names several addons; keep only AddonDecision::Id
@ Kick
the client refused AddonDecision::Id too often
@ Unchanged
send the message as it is
@ Send
point the client at AddonDecision::Id and wait for its reconnect
@ KeepMounted
a map change names no addon; name AddonDecision::Id so the client keeps it
std::size_t Remaining
addons still owed after Id, or cut from the message; for logging