VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::WorkshopDownloads Class Referencefinal

#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

Detailed Description

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.

Constructor & Destructor Documentation

◆ WorkshopDownloads()

VoltMod::WorkshopDownloads::WorkshopDownloads ( const Bindings & bindings,
const EngineInterfaces & engine )

Unbound bindings or a listen server downloads nothing. bindings must outlive this.

Definition at line 29 of file WorkshopDownloads.cpp.

Member Function Documentation

◆ Add()

bool VoltMod::WorkshopDownloads::Add ( uint64_t addonId)
overridevirtual

Require addonId of every client until a matching Remove; false when nothing was added.

Implements VoltMod::IPluginAddons.

Definition at line 33 of file WorkshopDownloads.cpp.

References VoltMod::Log::Warn().

◆ IsReady()

bool VoltMod::WorkshopDownloads::IsReady ( int slot)
overridevirtual

Whether slot has every required addon.

Implements VoltMod::IPluginAddons.

Definition at line 53 of file WorkshopDownloads.cpp.

References VoltMod::IsValidSlot().

◆ OnClientConnected()

void VoltMod::WorkshopDownloads::OnClientConnected ( int64_t steamId)

A reconnect is the only sign a download finished.

Definition at line 63 of file WorkshopDownloads.cpp.

References VoltMod::DownloadTimeoutSeconds, and VoltMod::Time::MonotonicSeconds().

◆ OnClientDisconnected()

void VoltMod::WorkshopDownloads::OnClientDisconnected ( int64_t steamId)

A player who really left, not one moved by a map change.

Definition at line 71 of file WorkshopDownloads.cpp.

References VoltMod::ForgetAfterSeconds, and VoltMod::Time::MonotonicSeconds().

◆ OnFrame()

void VoltMod::WorkshopDownloads::OnFrame ( )

Runs the kicks queued last frame: kicking inside the send hook crashes on Windows.

Definition at line 79 of file WorkshopDownloads.cpp.

◆ Remove()

void VoltMod::WorkshopDownloads::Remove ( uint64_t addonId)
overridevirtual

Implements VoltMod::IPluginAddons.

Definition at line 47 of file WorkshopDownloads.cpp.


The documentation for this class was generated from the following files: