|
VoltMod
C++23 framework for CS2 server plugins
|
Classes | |
| class | ClientLanguage |
| class | HostPlayerLanguages |
| class | PluginModule |
| class | InstalledHook |
| struct | SteamLanguage |
| struct | HostCallback |
| struct | HostCallback< Member > |
Concepts | |
| concept | PluginType |
Typedefs | |
| using | PluginFactory = std::unique_ptr<Plugin> (*)(Runtime&) |
| using | InterfaceLookup = void* (IPluginContext::*)(const char* version) const |
Functions | |
| template<PluginType T> | |
| PluginModule | MakePluginModule () |
| MenuItem | ChoiceItem (std::string label, std::vector< std::string > choices, std::function< void(int slot, int index)> commit, std::optional< ChoiceIndex > bind, int index, EnabledCondition enabled, ChoiceApply apply) |
| KHook::Action | ToKHookAction (HookAction action) |
| template<class Ret> | |
| KHook::Return< Ret > | ToKHook (HookResult< Ret > result) |
| KHook::Return< void > | ToKHook (HookResult< void > result) |
| template<class Hook> | |
| Subscription | ToSubscription (std::unique_ptr< Hook > hook) |
| static std::string_view | ToLanguageCode (std::string_view steamLanguage) |
| Subscription | HostSubscription (IPluginEvents &events, uint64_t token) |
| template<class T> | |
| static Status | Resolve (T *&field, const IPluginContext &host, InterfaceLookup lookup, const char *version) |
| static Result< std::unique_ptr< UnsafeServices > > | OpenUnsafe (IPluginContext &host) |
| static Status | ResolveSchema (const IPluginContext &host) |
Variables | |
| static constexpr std::array | SteamLanguages |
| using VoltMod::Internal::InterfaceLookup = void* (IPluginContext::*)(const char* version) const |
Definition at line 61 of file Plugin.cpp.
| using VoltMod::Internal::PluginFactory = std::unique_ptr<Plugin> (*)(Runtime&) |
Definition at line 21 of file PluginModule.hpp.
| MenuItem VoltMod::Internal::ChoiceItem | ( | std::string | label, |
| std::vector< std::string > | choices, | ||
| std::function< void(int slot, int index)> | commit, | ||
| std::optional< ChoiceIndex > | bind, | ||
| int | index, | ||
| EnabledCondition | enabled, | ||
| ChoiceApply | apply ) |
ChoiceRow's row with its values reduced to indices; build rows with ChoiceRow instead.
Definition at line 178 of file MenuBuilder.cpp.
References VoltMod::AfterStep, VoltMod::Choice, VoltMod::DescribeRow(), VoltMod::MenuRow::Steppable, VoltMod::MenuRow::Value, and VoltMod::WhenEnabled().
Referenced by VoltMod::ChoiceRow< T >::ToItem().
|
inline |
Unsubscribes host event token when dropped; events must outlive it.
Definition at line 40 of file HostCallback.hpp.
References VoltMod::IPluginEvents::Unsubscribe().
Referenced by VoltMod::WatchCommands(), and VoltMod::WatchPresses().
| PluginModule VoltMod::Internal::MakePluginModule | ( | ) |
Definition at line 68 of file PluginModule.hpp.
References MakePluginModule(), and VoltMod::Internal::PluginModule::PluginModule().
Referenced by MakePluginModule().
|
static |
Resolve the engine interfaces and bind the host's gamedata. Fails when an interface is missing; a gamedata failure is kept in GameData, and the services that need it say so.
Definition at line 76 of file Plugin.cpp.
References VoltMod::Error::Engine(), VoltMod::IPluginContext::EngineInterface(), VoltMod::IPluginContext::GameData(), Resolve(), and VoltMod::IPluginContext::ServerInterface().
|
static |
Definition at line 64 of file Plugin.cpp.
References VoltMod::Error::NotReady(), and VoltMod::T.
Referenced by OpenUnsafe().
|
static |
Fill this module's generated offsets from the running server before any accessor runs.
Definition at line 123 of file Plugin.cpp.
References VoltMod::IPluginContext::FindSchemaField(), VoltMod::Schema::GeneratedLayout(), and VoltMod::Schema::ResolveLayout().
| KHook::Return< Ret > VoltMod::Internal::ToKHook | ( | HookResult< Ret > | result | ) |
KHook ignores the default value carried by an Allow result.
Definition at line 36 of file Hook.hpp.
References VoltMod::HookResult< Ret >::Action(), and ToKHookAction().
|
inline |
Definition at line 41 of file Hook.hpp.
References VoltMod::HookResult< Ret >::Action(), and ToKHookAction().
|
inline |
Definition at line 21 of file Hook.hpp.
References VoltMod::Block, and VoltMod::Replace.
|
static |
Definition at line 24 of file ClientLanguage.cpp.
References SteamLanguages.
Referenced by VoltMod::Internal::ClientLanguage::ClientLanguage().
| Subscription VoltMod::Internal::ToSubscription | ( | std::unique_ptr< Hook > | hook | ) |
Return a subscription that removes the hook when destroyed.
Definition at line 123 of file Hook.hpp.
Referenced by VoltMod::HookFunction(), VoltMod::HookInterface(), VoltMod::HookTable(), and VoltMod::HookVirtual().
|
staticconstexpr |
Steam's language names; a code no plugin translates falls back to the server language.
Definition at line 16 of file ClientLanguage.cpp.
Referenced by ToLanguageCode().