VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::IPluginEvents Struct Referenceabstract

#include <IPluginEvents.hpp>

Inheritance diagram for VoltMod::IPluginEvents:

Public Types

using FrameFn = void (*)(void* context)
using ServerStartupFn = void (*)(void* context, std::string_view mapName)
using ClientConnectingFn
using ClientConnectedFn
using ClientDisconnectedFn = void (*)(void* context, int slot)
using ClientFullyConnectedFn = void (*)(void* context, int slot)
using ClientSettingsChangedFn = void (*)(void* context, int slot)
using ConsoleCommandFn = bool (*)(void* context, std::string_view name, std::string_view arguments, int slot)
using CheckTransmitFn = void (*)(void* context, CCheckTransmitInfo** infoList, int infoCount)
using BuildGameSessionManifestFn = void (*)(void* context, IEntityResourceManifest* manifest)
using PlayerCommandFn = void (*)(void* context, int slot, const PlayerInput& input)
using ButtonPressFn = void (*)(void* context, int slot, std::string_view buttonId)

Public Member Functions

virtual uint64_t OnFrame (FrameFn callback, void *context)=0
virtual uint64_t OnServerStartup (ServerStartupFn callback, void *context)=0
virtual uint64_t OnClientConnecting (ClientConnectingFn callback, void *context)=0
virtual uint64_t OnClientConnected (ClientConnectedFn callback, void *context)=0
virtual uint64_t OnClientDisconnected (ClientDisconnectedFn callback, void *context)=0
virtual uint64_t OnClientFullyConnected (ClientFullyConnectedFn callback, void *context)=0
virtual uint64_t OnClientSettingsChanged (ClientSettingsChangedFn callback, void *context)=0
virtual uint64_t OnConsoleCommand (ConsoleCommandFn callback, void *context)=0
virtual uint64_t OnCheckTransmit (CheckTransmitFn callback, void *context)=0
virtual uint64_t OnBuildGameSessionManifest (BuildGameSessionManifestFn callback, void *context)=0
virtual uint64_t OnPlayerCommand (PlayerCommandFn callback, void *context)=0
virtual uint64_t OnPlayerCommandDone (PlayerCommandFn callback, void *context)=0
virtual uint64_t OnButtonPress (ButtonPressFn callback, void *context)=0
virtual void Unsubscribe (uint64_t token)=0

Protected Member Functions

 ~IPluginEvents ()=default

Detailed Description

Engine events, raised on every plugin in load order. Game thread only; a callback must not throw across the module boundary.

Definition at line 14 of file IPluginEvents.hpp.

Member Typedef Documentation

◆ BuildGameSessionManifestFn

using VoltMod::IPluginEvents::BuildGameSessionManifestFn = void (*)(void* context, IEntityResourceManifest* manifest)

The next map's resource manifest, which only takes resources during this call.

Definition at line 31 of file IPluginEvents.hpp.

◆ ButtonPressFn

using VoltMod::IPluginEvents::ButtonPressFn = void (*)(void* context, int slot, std::string_view buttonId)

A custom HUD button press, raised on the frame after it arrived. buttonId is client text.

Definition at line 35 of file IPluginEvents.hpp.

◆ CheckTransmitFn

using VoltMod::IPluginEvents::CheckTransmitFn = void (*)(void* context, CCheckTransmitInfo** infoList, int infoCount)

Definition at line 29 of file IPluginEvents.hpp.

◆ ClientConnectedFn

Initial value:
void (*)(void* context, int slot, int64_t steamId, std::string_view name,
std::string_view address)

Definition at line 22 of file IPluginEvents.hpp.

◆ ClientConnectingFn

Initial value:
bool (*)(void* context, int slot, int64_t steamId, std::string_view name, char* reason,
size_t reasonSize)

True refuses the player: later plugins are not asked, and the engine shows reason, which the callback fills with at most reasonSize bytes including the terminator.

Definition at line 20 of file IPluginEvents.hpp.

◆ ClientDisconnectedFn

using VoltMod::IPluginEvents::ClientDisconnectedFn = void (*)(void* context, int slot)

Definition at line 24 of file IPluginEvents.hpp.

◆ ClientFullyConnectedFn

using VoltMod::IPluginEvents::ClientFullyConnectedFn = void (*)(void* context, int slot)

Definition at line 25 of file IPluginEvents.hpp.

◆ ClientSettingsChangedFn

using VoltMod::IPluginEvents::ClientSettingsChangedFn = void (*)(void* context, int slot)

Definition at line 26 of file IPluginEvents.hpp.

◆ ConsoleCommandFn

using VoltMod::IPluginEvents::ConsoleCommandFn = bool (*)(void* context, std::string_view name, std::string_view arguments, int slot)

True when this plugin answered it: later plugins do not see it and the engine call is blocked.

Definition at line 28 of file IPluginEvents.hpp.

◆ FrameFn

using VoltMod::IPluginEvents::FrameFn = void (*)(void* context)

Definition at line 16 of file IPluginEvents.hpp.

◆ PlayerCommandFn

using VoltMod::IPluginEvents::PlayerCommandFn = void (*)(void* context, int slot, const PlayerInput& input)

A player's command, decoded once for every plugin.

Definition at line 33 of file IPluginEvents.hpp.

◆ ServerStartupFn

using VoltMod::IPluginEvents::ServerStartupFn = void (*)(void* context, std::string_view mapName)

Definition at line 17 of file IPluginEvents.hpp.

Constructor & Destructor Documentation

◆ ~IPluginEvents()

VoltMod::IPluginEvents::~IPluginEvents ( )
protecteddefault

Member Function Documentation

◆ OnBuildGameSessionManifest()

virtual uint64_t VoltMod::IPluginEvents::OnBuildGameSessionManifest ( BuildGameSessionManifestFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnButtonPress()

virtual uint64_t VoltMod::IPluginEvents::OnButtonPress ( ButtonPressFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

Referenced by VoltMod::WatchPresses().

◆ OnCheckTransmit()

virtual uint64_t VoltMod::IPluginEvents::OnCheckTransmit ( CheckTransmitFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnClientConnected()

virtual uint64_t VoltMod::IPluginEvents::OnClientConnected ( ClientConnectedFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnClientConnecting()

virtual uint64_t VoltMod::IPluginEvents::OnClientConnecting ( ClientConnectingFn callback,
void * context )
pure virtual

Before the engine admits a player, and before OnClientConnected.

Implemented in VoltMod::PluginContext.

◆ OnClientDisconnected()

virtual uint64_t VoltMod::IPluginEvents::OnClientDisconnected ( ClientDisconnectedFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnClientFullyConnected()

virtual uint64_t VoltMod::IPluginEvents::OnClientFullyConnected ( ClientFullyConnectedFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnClientSettingsChanged()

virtual uint64_t VoltMod::IPluginEvents::OnClientSettingsChanged ( ClientSettingsChangedFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnConsoleCommand()

virtual uint64_t VoltMod::IPluginEvents::OnConsoleCommand ( ConsoleCommandFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnFrame()

virtual uint64_t VoltMod::IPluginEvents::OnFrame ( FrameFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ OnPlayerCommand()

virtual uint64_t VoltMod::IPluginEvents::OnPlayerCommand ( PlayerCommandFn callback,
void * context )
pure virtual

Before the engine runs a player's command. Commands are decoded only while one is subscribed.

Implemented in VoltMod::PluginContext.

Referenced by VoltMod::WatchCommands().

◆ OnPlayerCommandDone()

virtual uint64_t VoltMod::IPluginEvents::OnPlayerCommandDone ( PlayerCommandFn callback,
void * context )
pure virtual

After the engine ran it.

Implemented in VoltMod::PluginContext.

Referenced by VoltMod::WatchCommands().

◆ OnServerStartup()

virtual uint64_t VoltMod::IPluginEvents::OnServerStartup ( ServerStartupFn callback,
void * context )
pure virtual

Implemented in VoltMod::PluginContext.

◆ Unsubscribe()

virtual void VoltMod::IPluginEvents::Unsubscribe ( uint64_t token)
pure virtual

Takes the token a subscription returned, which is never zero. Safe during a dispatch.

Implemented in VoltMod::PluginContext.

Referenced by VoltMod::Internal::HostSubscription().


The documentation for this struct was generated from the following file: