|
VoltMod
C++23 framework for CS2 server plugins
|
#include <CommandNames.hpp>
Public Types | |
| using | OwnerId = const void * |
Public Member Functions | |
| bool | Register (OwnerId owner, std::string_view ownerName, std::string_view name) |
| void | Reserve (std::string_view name) |
| std::string_view | OwnerOf (std::string_view name) const |
| void | RemoveAll (OwnerId owner) |
Which plugin owns each console command name, so two plugins cannot register the same one.
Definition at line 11 of file CommandNames.hpp.
The opaque pointer the host identifies a plugin by.
Definition at line 15 of file CommandNames.hpp.
| std::string_view VoltMod::CommandNames::OwnerOf | ( | std::string_view | name | ) | const |
The owner's name, "the host" for the host's own, empty while name is free.
Definition at line 33 of file CommandNames.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::PluginContext::IsCommandRegistered(), and VoltMod::PluginContext::RegisterCommand().
| bool VoltMod::CommandNames::Register | ( | OwnerId | owner, |
| std::string_view | ownerName, | ||
| std::string_view | name | ||
| ) |
False when another owner already has name. ownerName is what OwnerOf answers with.
Definition at line 8 of file CommandNames.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::PluginContext::RegisterCommand().
Remove every name owner registered. A plugin has no other way to give one back.
Definition at line 39 of file CommandNames.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::PluginContext::RemoveAll().
| void VoltMod::CommandNames::Reserve | ( | std::string_view | name | ) |
Keep name for the host's own console commands.
Definition at line 25 of file CommandNames.cpp.
Referenced by VoltMod::PluginRegistry::RegisterHostCommand().