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

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)

Detailed Description

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.

Constructor & Destructor Documentation

◆ PluginRegistry() [1/2]

VoltMod::PluginRegistry::PluginRegistry ( LoaderHandoff start = {},
IPluginGameData * gameData = nullptr,
IPluginAddons * addons = nullptr )
explicit

Definition at line 20 of file PluginRegistry.cpp.

References GameData().

Referenced by operator=(), and PluginRegistry().

◆ ~PluginRegistry()

VoltMod::PluginRegistry::~PluginRegistry ( )
default

◆ PluginRegistry() [2/2]

VoltMod::PluginRegistry::PluginRegistry ( const PluginRegistry & )
delete

References PluginRegistry().

Member Function Documentation

◆ AddPlugin()

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().

◆ FindPlugin()

PluginContext * VoltMod::PluginRegistry::FindPlugin ( std::string_view name)

Definition at line 44 of file PluginRegistry.cpp.

Referenced by AddPlugin().

◆ GameData()

IPluginGameData * VoltMod::PluginRegistry::GameData ( ) const
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().

◆ HasCommandListeners()

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.

◆ IsConnected()

bool VoltMod::PluginRegistry::IsConnected ( int slot) const
inline

Between ClientConnected and ClientDisconnected on slot.

Definition at line 41 of file PluginRegistry.hpp.

References VoltMod::IsValidSlot().

◆ operator=()

PluginRegistry & VoltMod::PluginRegistry::operator= ( const PluginRegistry & )
delete

References PluginRegistry().

◆ RaiseBuildGameSessionManifest()

void VoltMod::PluginRegistry::RaiseBuildGameSessionManifest ( IEntityResourceManifest * manifest)

Definition at line 155 of file PluginRegistry.cpp.

Referenced by VoltMod::HookSessionManifest().

◆ RaiseButtonPress()

void VoltMod::PluginRegistry::RaiseButtonPress ( int slot,
std::string_view buttonId )

Definition at line 178 of file PluginRegistry.cpp.

◆ RaiseCheckTransmit()

void VoltMod::PluginRegistry::RaiseCheckTransmit ( CCheckTransmitInfo ** infoList,
int infoCount )

Definition at line 147 of file PluginRegistry.cpp.

◆ RaiseClientConnected()

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().

◆ RaiseClientConnecting()

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().

◆ RaiseClientDisconnected()

void VoltMod::PluginRegistry::RaiseClientDisconnected ( int slot)

Definition at line 110 of file PluginRegistry.cpp.

◆ RaiseClientFullyConnected()

void VoltMod::PluginRegistry::RaiseClientFullyConnected ( int slot)

Definition at line 120 of file PluginRegistry.cpp.

References VoltMod::IsValidSlot().

◆ RaiseClientSettingsChanged()

void VoltMod::PluginRegistry::RaiseClientSettingsChanged ( int slot)

Definition at line 132 of file PluginRegistry.cpp.

◆ RaiseConsoleCommand()

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().

◆ RaiseFrame()

void VoltMod::PluginRegistry::RaiseFrame ( )

Definition at line 63 of file PluginRegistry.cpp.

◆ RaisePlayerCommand()

void VoltMod::PluginRegistry::RaisePlayerCommand ( int slot,
const PlayerInput & input )

Definition at line 168 of file PluginRegistry.cpp.

References VoltMod::RaiseCommand().

◆ RaisePlayerCommandDone()

void VoltMod::PluginRegistry::RaisePlayerCommandDone ( int slot,
const PlayerInput & input )

Definition at line 173 of file PluginRegistry.cpp.

References VoltMod::RaiseCommand().

◆ RaiseServerStartup()

void VoltMod::PluginRegistry::RaiseServerStartup ( std::string_view mapName)

Definition at line 71 of file PluginRegistry.cpp.

◆ RegisterHostCommand()

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.

◆ RemovePlugin()

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.

◆ SetSchemaFields()

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.


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