VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
MultiAddonManager.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstdint>
6
7namespace VoltMod
8{
9
10/**
11 * Workshop addons every connecting client must download. The host keeps one list for all plugins, so
12 * an addon two plugins require downloads once, one addon per reconnect; see @ref workshop_guide.
13 *
14 * ```cpp
15 * _subs.Add(runtime.AddonManager.Add(Config.Get().addonId)); // 0 requires nothing
16 * ```
17 */
19{
20public:
21 explicit MultiAddonManager(IPluginAddons& host) : _host(host) {}
22
23 /** Require @p addonId of every client until the Subscription drops; 0 requires nothing. */
25
26 /** Whether @p slot has every addon any plugin requires. */
27 bool IsReady(int slot) const { return _host.IsReady(slot); }
28
29private:
30 IPluginAddons& _host;
31};
32
33} // namespace VoltMod
Subscription Add(uint64_t addonId)
MultiAddonManager(IPluginAddons &host)
Owns one registration and releases it on destruction.
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
virtual bool IsReady(int slot)=0