|
VoltMod
C++23 framework for CS2 server plugins
|
The loaded plugins and the engine events raised on them, one per process. More...
#include <PluginRegistry.hpp>
Public Member Functions | |
| PluginRegistry (LoaderHandoff start={}, IPluginGameData *gameData=nullptr, IPluginAddons *addons=nullptr) | |
| ~PluginRegistry () | |
| PluginRegistry (const PluginRegistry &)=delete | |
| PluginRegistry & | operator= (const PluginRegistry &)=delete |
| PluginContext * | AddPlugin (std::string_view name, std::string_view logTag={}, std::string_view version={}) |
| LeakReport | RemovePlugin (std::string_view name) |
| PluginContext * | FindPlugin (std::string_view name) |
| bool | IsConnected (int slot) const |
| IPluginGameData * | GameData () const |
| void | SetSchemaFields (Schema::LiveFieldLookup lookup) |
| void | RaiseFrame () |
| void | RaiseServerStartup (std::string_view mapName) |
| std::string | RaiseClientConnecting (int slot, int64_t steamId, std::string_view name) |
| void | RaiseClientConnected (int slot, int64_t steamId, std::string_view name, std::string_view address) |
| void | RaiseClientDisconnected (int slot) |
| void | RaiseClientFullyConnected (int slot) |
| void | RaiseClientSettingsChanged (int slot) |
| bool | RaiseConsoleCommand (std::string_view name, std::string_view arguments, int slot) |
| void | RaiseCheckTransmit (CCheckTransmitInfo **infoList, int infoCount) |
| void | RaiseBuildGameSessionManifest (IEntityResourceManifest *manifest) |
| bool | HasCommandListeners () const |
| void | RaisePlayerCommand (int slot, const PlayerInput &input) |
| void | RaisePlayerCommandDone (int slot, const PlayerInput &input) |
| void | RaiseButtonPress (int slot, std::string_view buttonId) |
| void | RegisterHostCommand (std::string_view name) |
The loaded plugins and the engine events raised on them, one per process.
Owns the SharedState. Game thread only; nothing locks. SDK-free so it is unit-tested without the engine.
Definition at line 21 of file PluginRegistry.hpp.
|
explicit |
Definition at line 20 of file PluginRegistry.cpp.
References GameData().
Referenced by operator=(), and PluginRegistry().
|
default |
|
delete |
References PluginRegistry().
| PluginContext * VoltMod::PluginRegistry::AddPlugin | ( | std::string_view | name, |
| std::string_view | logTag = {}, | ||
| std::string_view | version = {} ) |
Give name its own view, at the end of the dispatch order. Nullptr when it already has one. logTag prefixes every line the plugin writes; empty means its name.
Definition at line 31 of file PluginRegistry.cpp.
References FindPlugin().
| PluginContext * VoltMod::PluginRegistry::FindPlugin | ( | std::string_view | name | ) |
Definition at line 44 of file PluginRegistry.cpp.
Referenced by AddPlugin().
|
inline |
The one gamedata resolution every plugin binds from, null when the host has none.
Definition at line 44 of file PluginRegistry.hpp.
Referenced by PluginRegistry().
| bool VoltMod::PluginRegistry::HasCommandListeners | ( | ) | const |
Whether any plugin subscribed to player commands; the host decodes none otherwise.
Definition at line 163 of file PluginRegistry.cpp.
|
inline |
Between ClientConnected and ClientDisconnected on slot.
Definition at line 41 of file PluginRegistry.hpp.
References VoltMod::IsValidSlot().
|
delete |
References PluginRegistry().
| void VoltMod::PluginRegistry::RaiseBuildGameSessionManifest | ( | IEntityResourceManifest * | manifest | ) |
Definition at line 155 of file PluginRegistry.cpp.
Referenced by VoltMod::HookSessionManifest().
| void VoltMod::PluginRegistry::RaiseButtonPress | ( | int | slot, |
| std::string_view | buttonId ) |
Definition at line 178 of file PluginRegistry.cpp.
| void VoltMod::PluginRegistry::RaiseCheckTransmit | ( | CCheckTransmitInfo ** | infoList, |
| int | infoCount ) |
Definition at line 147 of file PluginRegistry.cpp.
| void VoltMod::PluginRegistry::RaiseClientConnected | ( | int | slot, |
| int64_t | steamId, | ||
| std::string_view | name, | ||
| std::string_view | address ) |
Definition at line 95 of file PluginRegistry.cpp.
References VoltMod::IsValidSlot().
| std::string VoltMod::PluginRegistry::RaiseClientConnecting | ( | int | slot, |
| int64_t | steamId, | ||
| std::string_view | name ) |
Ask each plugin whether slot may join. The first refusal's reason, or empty to admit.
Definition at line 80 of file PluginRegistry.cpp.
Referenced by VoltMod::AdmitClient().
| void VoltMod::PluginRegistry::RaiseClientDisconnected | ( | int | slot | ) |
Definition at line 110 of file PluginRegistry.cpp.
| void VoltMod::PluginRegistry::RaiseClientFullyConnected | ( | int | slot | ) |
Definition at line 120 of file PluginRegistry.cpp.
References VoltMod::IsValidSlot().
| void VoltMod::PluginRegistry::RaiseClientSettingsChanged | ( | int | slot | ) |
Definition at line 132 of file PluginRegistry.cpp.
| bool VoltMod::PluginRegistry::RaiseConsoleCommand | ( | std::string_view | name, |
| std::string_view | arguments, | ||
| int | slot ) |
True when a plugin answered it: later plugins never see it and the engine call is blocked.
Definition at line 140 of file PluginRegistry.cpp.
Referenced by VoltMod::RunCommand().
| void VoltMod::PluginRegistry::RaiseFrame | ( | ) |
Definition at line 63 of file PluginRegistry.cpp.
| void VoltMod::PluginRegistry::RaisePlayerCommand | ( | int | slot, |
| const PlayerInput & | input ) |
Definition at line 168 of file PluginRegistry.cpp.
References VoltMod::RaiseCommand().
| void VoltMod::PluginRegistry::RaisePlayerCommandDone | ( | int | slot, |
| const PlayerInput & | input ) |
Definition at line 173 of file PluginRegistry.cpp.
References VoltMod::RaiseCommand().
| void VoltMod::PluginRegistry::RaiseServerStartup | ( | std::string_view | mapName | ) |
Definition at line 71 of file PluginRegistry.cpp.
| void VoltMod::PluginRegistry::RegisterHostCommand | ( | std::string_view | name | ) |
Keep name for the host's own console commands, so no plugin can take it.
Definition at line 186 of file PluginRegistry.cpp.
| LeakReport VoltMod::PluginRegistry::RemovePlugin | ( | std::string_view | name | ) |
Drop every subscription, publication and command name name still holds, and report them.
Definition at line 50 of file PluginRegistry.cpp.
| void VoltMod::PluginRegistry::SetSchemaFields | ( | Schema::LiveFieldLookup | lookup | ) |
Where plugins find live schema fields to fill their offsets from.
Definition at line 26 of file PluginRegistry.cpp.