VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::CommandNames Class Reference

#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 OwnerName (std::string_view name) const
void RemoveAll (OwnerId owner)

Detailed Description

Which plugin owns each console command name, so two plugins cannot register the same one.

Definition at line 11 of file CommandNames.hpp.

Member Typedef Documentation

◆ OwnerId

using VoltMod::CommandNames::OwnerId = const void*

The opaque pointer the host identifies a plugin by.

Definition at line 15 of file CommandNames.hpp.

Member Function Documentation

◆ OwnerName()

std::string_view VoltMod::CommandNames::OwnerName ( 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.

◆ Register()

bool VoltMod::CommandNames::Register ( OwnerId owner,
std::string_view ownerName,
std::string_view name )

False when another owner already has name. ownerName is what OwnerName answers with.

Definition at line 8 of file CommandNames.cpp.

◆ RemoveAll()

void VoltMod::CommandNames::RemoveAll ( OwnerId owner)

Remove every name owner registered. A plugin has no other way to give one back.

Definition at line 39 of file CommandNames.cpp.

◆ Reserve()

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.


The documentation for this class was generated from the following files: