|
VoltMod
C++23 framework for CS2 server plugins
|
#include <WorkshopDownloads.hpp>
Inheritance diagram for VoltMod::WorkshopDownloads:Public Member Functions | |
| WorkshopDownloads (const Bindings &bindings, const EngineInterfaces &engine) | |
| bool | Add (uint64_t addonId) override |
| void | Remove (uint64_t addonId) override |
| bool | IsReady (int slot) override |
| void | OnClientConnected (int64_t steamId) |
| void | OnClientDisconnected (int64_t steamId) |
| void | OnFrame () |
Additional Inherited Members | |
Protected Member Functions inherited from VoltMod::IPluginAddons | |
| ~IPluginAddons ()=default | |
The workshop addons connecting clients must download, for every plugin at once: one set of hooks and one list, so an addon two plugins require downloads once. One addon per reconnect; see Workshop addons. Game thread only.
Definition at line 20 of file WorkshopDownloads.hpp.
| VoltMod::WorkshopDownloads::WorkshopDownloads | ( | const Bindings & | bindings, |
| const EngineInterfaces & | engine | ||
| ) |
Unbound bindings or a listen server downloads nothing. bindings must outlive this.
Definition at line 31 of file WorkshopDownloads.cpp.
Require addonId of every client until a matching Remove; false when nothing was added.
Implements VoltMod::IPluginAddons.
Definition at line 35 of file WorkshopDownloads.cpp.
References VoltMod::DownloadQueue::Add(), VoltMod::ReadFile(), and VoltMod::Log::Warn().
Whether slot has every required addon.
Implements VoltMod::IPluginAddons.
Definition at line 55 of file WorkshopDownloads.cpp.
References VoltMod::DownloadQueue::Empty(), VoltMod::DownloadQueue::HasMissing(), VoltMod::IsValidSlot(), and VoltMod::ReadFile().
A reconnect is the only sign a download finished.
Definition at line 65 of file WorkshopDownloads.cpp.
References VoltMod::DownloadQueue::ClientReconnected(), VoltMod::DownloadTimeoutSeconds, VoltMod::DownloadQueue::Empty(), VoltMod::Time::MonotonicSeconds(), and VoltMod::ReadFile().
A player who really left, not one moved by a map change.
Definition at line 73 of file WorkshopDownloads.cpp.
References VoltMod::DownloadQueue::ClientLeft(), VoltMod::DownloadQueue::Empty(), VoltMod::ForgetAfterSeconds, VoltMod::Time::MonotonicSeconds(), and VoltMod::ReadFile().
| void VoltMod::WorkshopDownloads::OnFrame | ( | ) |
Runs the kicks queued last frame: kicking inside the send hook crashes on Windows.
Definition at line 81 of file WorkshopDownloads.cpp.
References VoltMod::Kick, and VoltMod::ReadFile().
Implements VoltMod::IPluginAddons.
Definition at line 49 of file WorkshopDownloads.cpp.
References VoltMod::ReadFile(), and VoltMod::DownloadQueue::Remove().