|
VoltMod
C++23 framework for CS2 server plugins
|
#include <PluginContext.hpp>
Inheritance diagram for VoltMod::PluginContext:One plugin's view of the host and the record of what it took, so every call has a known owner. Owned by PluginRegistry; valid from AddPlugin until RemovePlugin.
Definition at line 82 of file PluginContext.hpp.
| VoltMod::PluginContext::PluginContext | ( | SharedState & | state, |
| std::string | name, | ||
| std::string | logTag, | ||
| std::string | version, | ||
| uint64_t | order | ||
| ) |
Definition at line 10 of file PluginContext.cpp.
|
delete |
Require addonId until a matching Remove; false when nothing was added, as for id 0 or a listen server.
Implements VoltMod::IPluginAddons.
Definition at line 87 of file PluginContext.cpp.
References VoltMod::IPluginAddons::Add(), VoltMod::SharedState::Addons, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginContext.
Definition at line 82 of file PluginContext.cpp.
|
overridevirtual |
The absolute csgo directory that relative paths resolve against.
Implements VoltMod::IPluginContext.
Definition at line 35 of file PluginContext.cpp.
References VoltMod::LoaderHandoff::GameDir, and VoltMod::SharedState::Start.
| void VoltMod::PluginContext::DisconnectClients | ( | ) |
Raise OnClientDisconnected on this plugin alone for each player still in, before a mid-map unload.
Definition at line 262 of file PluginContext.cpp.
References VoltMod::SharedState::ClientDisconnected, VoltMod::SharedState::Clients, VoltMod::CallbackList< Fn >::DispatchTo(), VoltMod::MaxPlayers, and VoltMod::ReadFile().
An engine interface by its exact version name, or null.
Implements VoltMod::IPluginContext.
Definition at line 25 of file PluginContext.cpp.
References VoltMod::LoaderHandoff::EngineFactory, and VoltMod::SharedState::Start.
|
overridevirtual |
Implements VoltMod::IPluginContext.
Definition at line 45 of file PluginContext.cpp.
|
overridevirtual |
Implements VoltMod::IPluginServices.
Definition at line 228 of file PluginContext.cpp.
References VoltMod::PublishedInterfaces::Find(), and VoltMod::SharedState::Services.
|
overridevirtual |
Null when the host resolved no gamedata.
Implements VoltMod::IPluginContext.
Definition at line 55 of file PluginContext.cpp.
References VoltMod::SharedState::GameData.
|
overridevirtual |
Each module has its own KHook::__exported__khook; a plugin seeds it from this before hooking.
Implements VoltMod::IPluginContext.
Definition at line 40 of file PluginContext.cpp.
References VoltMod::LoaderHandoff::HookDispatcher, and VoltMod::SharedState::Start.
|
overridevirtual |
True while any plugin, this one included, or the host holds name.
Implements VoltMod::IPluginContext.
Definition at line 72 of file PluginContext.cpp.
References VoltMod::SharedState::Commands, and VoltMod::CommandNames::OwnerOf().
Whether slot has every required addon.
Implements VoltMod::IPluginAddons.
Definition at line 107 of file PluginContext.cpp.
References VoltMod::SharedState::Addons, VoltMod::IPluginAddons::IsReady(), and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginContext.
Definition at line 77 of file PluginContext.cpp.
References VoltMod::SharedState::Languages.
|
overridevirtual |
Lines below this are dropped; volt log <name> <level> changes it.
Implements VoltMod::IPluginContext.
Definition at line 124 of file PluginContext.cpp.
References VoltMod::ReadFile().
|
overridevirtual |
The plugin's name: its manifest name and directory under addons/voltmod/plugins/.
Implements VoltMod::IPluginContext.
Definition at line 15 of file PluginContext.cpp.
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 198 of file PluginContext.cpp.
References VoltMod::SharedState::BuildGameSessionManifest, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 213 of file PluginContext.cpp.
References VoltMod::SharedState::ButtonPress, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 193 of file PluginContext.cpp.
References VoltMod::SharedState::CheckTransmit, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 168 of file PluginContext.cpp.
References VoltMod::SharedState::ClientConnected, and VoltMod::ReadFile().
|
overridevirtual |
Before the engine admits a player, and before OnClientConnected.
Implements VoltMod::IPluginEvents.
Definition at line 163 of file PluginContext.cpp.
References VoltMod::SharedState::ClientConnecting, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 173 of file PluginContext.cpp.
References VoltMod::SharedState::ClientDisconnected, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 178 of file PluginContext.cpp.
References VoltMod::SharedState::ClientFullyConnected, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 183 of file PluginContext.cpp.
References VoltMod::SharedState::ClientSettingsChanged, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 188 of file PluginContext.cpp.
References VoltMod::SharedState::ConsoleCommand, and VoltMod::ReadFile().
Implements VoltMod::IPluginEvents.
Definition at line 153 of file PluginContext.cpp.
References VoltMod::SharedState::Frame, and VoltMod::ReadFile().
|
overridevirtual |
Before the engine runs a player's command. Commands are decoded only while one is subscribed.
Implements VoltMod::IPluginEvents.
Definition at line 203 of file PluginContext.cpp.
References VoltMod::SharedState::PlayerCommand, and VoltMod::ReadFile().
|
overridevirtual |
After the engine ran it.
Implements VoltMod::IPluginEvents.
Definition at line 208 of file PluginContext.cpp.
References VoltMod::SharedState::PlayerCommandDone, and VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginEvents.
Definition at line 158 of file PluginContext.cpp.
References VoltMod::ReadFile(), and VoltMod::SharedState::ServerStartup.
|
delete |
|
overridevirtual |
Implements VoltMod::IPluginServices.
Definition at line 218 of file PluginContext.cpp.
References VoltMod::PublishedInterfaces::Publish(), VoltMod::ReadFile(), and VoltMod::SharedState::Services.
|
overridevirtual |
False when another plugin holds name, which the host logs naming both. Released with the plugin.
Implements VoltMod::IPluginContext.
Definition at line 60 of file PluginContext.cpp.
References VoltMod::SharedState::Commands, VoltMod::Log::Error(), VoltMod::CommandNames::OwnerOf(), and VoltMod::CommandNames::Register().
Implements VoltMod::IPluginAddons.
Definition at line 97 of file PluginContext.cpp.
References VoltMod::SharedState::Addons, VoltMod::ReadFile(), and VoltMod::IPluginAddons::Remove().
| LeakReport VoltMod::PluginContext::RemoveAll | ( | ) |
Remove what the plugin still holds. Command names are the host's to remove, so they are not reported.
Definition at line 286 of file PluginContext.cpp.
References VoltMod::SharedState::Addons, VoltMod::SharedState::Commands, VoltMod::ReadFile(), VoltMod::IPluginAddons::Remove(), VoltMod::CommandNames::RemoveAll(), VoltMod::PublishedInterfaces::RemoveAll(), VoltMod::SharedState::Services, and VoltMod::LeakReport::Subscriptions.
| void VoltMod::PluginContext::ReplayMissedEvents | ( | ) |
Raise on this plugin alone what it missed by loading mid-map: OnServerStartup for the running map, then OnClientConnected and OnClientFullyConnected for each player already in.
Definition at line 233 of file PluginContext.cpp.
References VoltMod::SharedState::ClientConnected, VoltMod::SharedState::ClientFullyConnected, VoltMod::SharedState::Clients, VoltMod::SharedState::CurrentMap, VoltMod::CallbackList< Fn >::DispatchTo(), VoltMod::MaxPlayers, VoltMod::ReadFile(), and VoltMod::SharedState::ServerStartup.
|
overridevirtual |
The hash of the baked schema layout the host compared with the live game.
Implements VoltMod::IPluginContext.
Definition at line 129 of file PluginContext.cpp.
References VoltMod::SharedState::SchemaLayoutStamp.
|
overridevirtual |
Implements VoltMod::IPluginContext.
Definition at line 134 of file PluginContext.cpp.
References VoltMod::SharedState::SchemaVerified.
A game server interface by its exact version name, or null.
Implements VoltMod::IPluginContext.
Definition at line 30 of file PluginContext.cpp.
References VoltMod::LoaderHandoff::ServerFactory, and VoltMod::SharedState::Start.
|
overridevirtual |
Implements VoltMod::IPluginContext.
Definition at line 50 of file PluginContext.cpp.
Definition at line 90 of file PluginContext.hpp.
References VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginServices.
Definition at line 223 of file PluginContext.cpp.
References VoltMod::SharedState::Services, and VoltMod::PublishedInterfaces::Unpublish().
A token this plugin never took is ignored.
Implements VoltMod::IPluginEvents.
Definition at line 274 of file PluginContext.cpp.
References VoltMod::ReadFile().
|
overridevirtual |
Implements VoltMod::IPluginContext.
Definition at line 20 of file PluginContext.cpp.
Print one line under this plugin's logTag. level is a LogLevel.
Implements VoltMod::IPluginContext.
Definition at line 112 of file PluginContext.cpp.
References VoltMod::Log::Emit(), and VoltMod::ReadFile().