|
VoltMod
C++23 framework for CS2 server plugins
|
#include <DownloadQueue.hpp>
Public Member Functions | |
| bool | Add (uint64_t id) |
| void | Remove (uint64_t id) |
| bool | Empty () const |
| std::vector< uint64_t > | Required () const |
| std::vector< uint64_t > | MissingFor (int64_t steamId) const |
| bool | HasMissing (int64_t steamId) const |
| std::vector< uint64_t > | ClientMountList (int64_t steamId) const |
| AddonDecision | NextToSend (int64_t steamId, double now, int maxAttempts) |
| AddonDecision | DecideJoinMessage (int64_t steamId, bool reconnect, std::string_view addons, double now, int maxAttempts) |
| void | MarkSending (int64_t steamId, uint64_t id, double now) |
| void | ClientReconnected (int64_t steamId, double now, double timeoutSec) |
| void | ClientLeft (int64_t steamId, double now, double forgetAfterSec) |
| void | ClearProgress () |
Which required workshop addons each client still owes, and what to send it next. Keyed by SteamID, since a reconnecting client's slot changes; times are monotonic seconds.
Definition at line 32 of file DownloadQueue.hpp.
Require id of every client. Reference counted; false for id 0.
Definition at line 11 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::WorkshopDownloads::Add().
| void VoltMod::DownloadQueue::ClearProgress | ( | ) |
Forget every client's progress, keeping the requirements.
Definition at line 197 of file DownloadQueue.cpp.
steamId left; clients gone longer than forgetAfterSec are forgotten.
Definition at line 185 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::WorkshopDownloads::OnClientDisconnected().
Required addons steamId has downloaded or is downloading: what it mounts on connect.
Definition at line 67 of file DownloadQueue.cpp.
References VoltMod::ReadFile(), and Required().
Referenced by DecideJoinMessage().
Count the sending addon as downloaded if steamId reconnected within timeoutSec.
Definition at line 160 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::WorkshopDownloads::OnClientConnected().
| AddonDecision VoltMod::DownloadQueue::DecideJoinMessage | ( | int64_t | steamId, |
| bool | reconnect, | ||
| std::string_view | addons, | ||
| double | now, | ||
| int | maxAttempts | ||
| ) |
Decide one outgoing join message for steamId. A message already sending the client away (reconnect) goes through, and its addon counts as sending.
Definition at line 118 of file DownloadQueue.cpp.
References ClientMountList(), VoltMod::KeepMounted, MarkSending(), NextToSend(), VoltMod::ParseAddonList(), VoltMod::ReadFile(), and VoltMod::TrimToFirst.
|
inline |
Whether nothing is required.
Definition at line 40 of file DownloadQueue.hpp.
Referenced by VoltMod::WorkshopDownloads::IsReady(), VoltMod::WorkshopDownloads::OnClientConnected(), and VoltMod::WorkshopDownloads::OnClientDisconnected().
Definition at line 81 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::WorkshopDownloads::IsReady().
Record that id reached steamId without our offer. Costs no attempt.
Definition at line 147 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by DecideJoinMessage().
What steamId has still to download.
Definition at line 56 of file DownloadQueue.cpp.
References VoltMod::ReadFile(), and Required().
Referenced by NextToSend().
| AddonDecision VoltMod::DownloadQueue::NextToSend | ( | int64_t | steamId, |
| double | now, | ||
| int | maxAttempts | ||
| ) |
The next addon for steamId. A repeat offer counts an attempt; past maxAttempts, Kick.
Definition at line 95 of file DownloadQueue.cpp.
References VoltMod::Kick, MissingFor(), VoltMod::ReadFile(), and VoltMod::Send.
Referenced by DecideJoinMessage().
Definition at line 30 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::WorkshopDownloads::Remove().
| std::vector< uint64_t > VoltMod::DownloadQueue::Required | ( | ) | const |
What every client must have, in send order.
Definition at line 39 of file DownloadQueue.cpp.
References VoltMod::ReadFile().
Referenced by ClientMountList(), and MissingFor().