29 std::same_as<T, bool> || std::same_as<T, int> || std::same_as<T, float> || std::same_as<T, std::string>;
53 : _cvar(std::exchange(other._cvar,
nullptr)), _previous(std::move(other._previous))
86 void SendTo(
int slot,
const T& value)
const;
95 std::string_view
Name()
const {
return _name; }
97 explicit operator bool() const noexcept {
return _storage !=
nullptr; }
103 void SetRaw(
const T& value)
108 CVValue_t* _storage =
nullptr;
126 template <ConVarValue T>
142 void SetByConsole(std::string_view name, std::string_view value);
151 bool SendToClient(
int slot, std::string_view name, std::string_view value);
153 NetMessageInfo_t* SetConVarMessage();
156 void StopRoutingChanges();
159 bool _routingChanges =
false;
160 NetMessageInfo_t* _setConVarMsg =
nullptr;
ConVarRawScope(const ConVarRawScope &)=delete
ConVarRawScope(ConVar< T > &cvar, const T &value)
ConVarRawScope & operator=(ConVarRawScope &&)=delete
ConVarRawScope(ConVarRawScope &&other) noexcept
ConVarRawScope & operator=(const ConVarRawScope &)=delete
ConVarRawScope< T > RawScope(const T &value)
std::string_view Name() const
friend class ConVarRawScope< T >
Status Set(const T &value)
void SendTo(int slot, const T &value) const
void SetByConsole(std::string_view name, std::string_view value)
Assign a convar over the console, quoting the value.
Result< ConVar< T > > Find(std::string_view name)
Status ExecuteFile(std::string_view path)
ConVars(Interfaces &interfaces)
ConVars(const ConVars &)=delete
Event< const ConVarChange & > Changed
ConVars & operator=(const ConVars &)=delete
void ExecuteServerCommand(std::string_view command)
A multicast signal with a fixed handler signature: the one way to subscribe in VoltMod.
std::string ConVarText< std::string >(const std::string &value)
std::string ConVarText(const T &value)
std::string ConVarText< int >(const int &value)
std::expected< void, Error > Status
std::expected< T, Error > Result
std::string ConVarText< float >(const float &value)
std::string ConVarText< bool >(const bool &value)
std::string_view OldValue
std::string_view NewValue
Centralized holder for all SDK interface pointers.