|
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>
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 19 of file PluginRegistry.cpp.
|
default |
|
delete |
| 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(), and VoltMod::SharedState::NextOrder.
| PluginContext * VoltMod::PluginRegistry::FindPlugin | ( | std::string_view | name | ) |
Definition at line 44 of file PluginRegistry.cpp.
References VoltMod::ReadFile().
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.
References VoltMod::SharedState::GameData.
| 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.
References VoltMod::CallbackList< Fn >::Empty(), VoltMod::SharedState::PlayerCommand, and VoltMod::SharedState::PlayerCommandDone.
Between ClientConnected and ClientDisconnected on slot.
Definition at line 41 of file PluginRegistry.hpp.
References VoltMod::SharedState::Clients, VoltMod::IsValidSlot(), and VoltMod::ReadFile().
Referenced by VoltMod::EngineHooks::EngineHooks().
|
delete |
| void VoltMod::PluginRegistry::RaiseBuildGameSessionManifest | ( | IEntityResourceManifest * | manifest | ) |
Definition at line 155 of file PluginRegistry.cpp.
References VoltMod::SharedState::BuildGameSessionManifest, VoltMod::CallbackList< Fn >::Dispatch(), and VoltMod::ReadFile().
Definition at line 178 of file PluginRegistry.cpp.
References VoltMod::SharedState::ButtonPress, VoltMod::CallbackList< Fn >::Dispatch(), and VoltMod::ReadFile().
Referenced by VoltMod::ButtonPresses::OnFrame().
| void VoltMod::PluginRegistry::RaiseCheckTransmit | ( | CCheckTransmitInfo ** | infoList, |
| int | infoCount | ||
| ) |
Definition at line 147 of file PluginRegistry.cpp.
References VoltMod::SharedState::CheckTransmit, VoltMod::CallbackList< Fn >::Dispatch(), and VoltMod::ReadFile().
Referenced by VoltMod::EngineHooks::EngineHooks().
| 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::SharedState::ClientConnected, VoltMod::SharedState::Clients, VoltMod::CallbackList< Fn >::Dispatch(), VoltMod::IsValidSlot(), VoltMod::SharedState::Languages, VoltMod::ReadFile(), VoltMod::LanguageTable::Reset(), and VoltMod::ConnectedClient::SteamId.
| 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.
References VoltMod::SharedState::ClientConnecting, VoltMod::CallbackList< Fn >::Dispatch(), and VoltMod::ReadFile().
Definition at line 110 of file PluginRegistry.cpp.
References VoltMod::SharedState::ClientDisconnected, VoltMod::SharedState::Clients, VoltMod::CallbackList< Fn >::Dispatch(), VoltMod::SharedState::Languages, VoltMod::ReadFile(), and VoltMod::LanguageTable::Reset().
Referenced by VoltMod::EngineHooks::EngineHooks().
Definition at line 120 of file PluginRegistry.cpp.
References VoltMod::SharedState::ClientFullyConnected, VoltMod::SharedState::Clients, VoltMod::CallbackList< Fn >::Dispatch(), VoltMod::IsValidSlot(), and VoltMod::ReadFile().
Referenced by VoltMod::EngineHooks::EngineHooks().
Definition at line 132 of file PluginRegistry.cpp.
References VoltMod::SharedState::ClientSettingsChanged, VoltMod::CallbackList< Fn >::Dispatch(), and VoltMod::ReadFile().
Referenced by VoltMod::EngineHooks::EngineHooks().
| 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.
References VoltMod::SharedState::ConsoleCommand, VoltMod::CallbackList< Fn >::Dispatch(), and VoltMod::ReadFile().
| void VoltMod::PluginRegistry::RaiseFrame | ( | ) |
Definition at line 63 of file PluginRegistry.cpp.
References VoltMod::CallbackList< Fn >::Dispatch(), VoltMod::SharedState::Frame, and VoltMod::ReadFile().
Referenced by VoltMod::EngineHooks::EngineHooks().
| void VoltMod::PluginRegistry::RaisePlayerCommand | ( | int | slot, |
| const PlayerInput & | input | ||
| ) |
Definition at line 168 of file PluginRegistry.cpp.
References VoltMod::SharedState::PlayerCommand, VoltMod::RaiseCommand(), and VoltMod::ReadFile().
| void VoltMod::PluginRegistry::RaisePlayerCommandDone | ( | int | slot, |
| const PlayerInput & | input | ||
| ) |
Definition at line 173 of file PluginRegistry.cpp.
References VoltMod::SharedState::PlayerCommandDone, VoltMod::RaiseCommand(), and VoltMod::ReadFile().
| void VoltMod::PluginRegistry::RaiseServerStartup | ( | std::string_view | mapName | ) |
Definition at line 71 of file PluginRegistry.cpp.
References VoltMod::SharedState::CurrentMap, VoltMod::CallbackList< Fn >::Dispatch(), VoltMod::ReadFile(), and VoltMod::SharedState::ServerStartup.
Referenced by VoltMod::EngineHooks::EngineHooks().
| 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.
References VoltMod::SharedState::Commands, and VoltMod::CommandNames::Reserve().
| 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.
References VoltMod::ReadFile().
Record what the host's own schema check found. stamp identifies the layout it checked, so a plugin can tell whether the answer covers the offsets it was built with.
Definition at line 25 of file PluginRegistry.cpp.
References VoltMod::ReadFile(), VoltMod::SharedState::SchemaLayoutStamp, and VoltMod::SharedState::SchemaVerified.