|
VoltMod
C++23 framework for CS2 server plugins
|
Classes | |
| class | ClientLanguage |
| struct | HostCallback |
| struct | HostCallback< Member > |
| class | HostPlayerLanguages |
| class | InstalledHook |
| class | PluginModule |
| struct | SteamLanguage |
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 | CodeFor (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 | CheckSchema (const IPluginContext &host) |
Variables | |
| static constexpr std::array | SteamLanguages |
| using VoltMod::Internal::InterfaceLookup = typedef void* (IPluginContext::*)(const char* version) const |
Definition at line 60 of file Plugin.cpp.
| using VoltMod::Internal::PluginFactory = typedef std::unique_ptr<Plugin> (*)(Runtime&) |
Definition at line 21 of file PluginModule.hpp.
|
static |
The host's one schema check covers this plugin only when both baked the same layout.
Definition at line 120 of file Plugin.cpp.
References VoltMod::Schema::GeneratedLayoutStamp(), VoltMod::Error::Invalid(), VoltMod::IPluginContext::SchemaLayoutStamp(), and VoltMod::IPluginContext::SchemaVerified().
| 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::ChoiceState::Choices, VoltMod::MenuItem::Describe, VoltMod::DescribeRow(), VoltMod::ReadFile(), and VoltMod::WhenEnabled().
Referenced by VoltMod::ChoiceRow< T >::ToItem().
|
static |
Definition at line 24 of file ClientLanguage.cpp.
References VoltMod::ReadFile(), and SteamLanguages.
Referenced by VoltMod::Internal::ClientLanguage::ClientLanguage().
|
inline |
Unsubscribes host event token when dropped; events must outlive it.
Definition at line 40 of file HostCallback.hpp.
References VoltMod::ReadFile().
Referenced by VoltMod::ListenForCommands(), and VoltMod::ListenForPresses().
| PluginModule VoltMod::Internal::MakePluginModule | ( | ) |
Definition at line 68 of file PluginModule.hpp.
References VoltMod::ReadFile().
|
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 75 of file Plugin.cpp.
References VoltMod::Error::Engine(), VoltMod::IPluginContext::EngineInterface(), VoltMod::IPluginContext::GameData(), VoltMod::ReadFile(), Resolve(), and VoltMod::IPluginContext::ServerInterface().
|
static |
Definition at line 63 of file Plugin.cpp.
References VoltMod::Error::NotReady(), VoltMod::ReadFile(), and VoltMod::T.
Referenced by OpenUnsafe().
| 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::ReadFile(), and ToKHookAction().
|
inline |
Definition at line 41 of file Hook.hpp.
References VoltMod::ReadFile(), and ToKHookAction().
|
inline |
Definition at line 21 of file Hook.hpp.
References VoltMod::Block, VoltMod::ReadFile(), and VoltMod::Replace.
| 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.
References VoltMod::ReadFile().
Referenced by VoltMod::HookFunction(), VoltMod::HookInterface(), 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 CodeFor().