SwiftlyS2

IConVar

Interface IConVar

Namespace: SwiftlyS2.Shared.Convars

Assembly: SwiftlyS2.CS2.dll

public interface IConVar

Properties

DefaultValueAsString

The default value of the convar in string.

Thrown when the string value can't be parsed.

string DefaultValueAsString { get; set; }
Property Value

Flags

The flags of the convar.

ConvarFlags Flags { get; set; }
Property Value

HasDefaultValue

Whether the convar has a default value.

bool HasDefaultValue { get; }
Property Value

HasMaxValue

Whether the convar has a max value.

bool HasMaxValue { get; }
Property Value

HasMinValue

Whether the convar has a min value.

bool HasMinValue { get; }
Property Value

HelpText

The help text of the convar.

string HelpText { get; }
Property Value

MaxValueAsString

The max value of the convar in string.

Thrown when the string value can't be parsed.

string MaxValueAsString { get; set; }
Property Value

MinValueAsString

The min value of the convar in string.

Thrown when the string value can't be parsed.

string MinValueAsString { get; set; }
Property Value

Name

The convar name.

string Name { get; }
Property Value

ValueAsString

The string value of the convar. When setting, if the convar can be replicated, it will automatically replicate to all clients. Also, setting value with this method will internally put it into a set queue, Which means that for some special case ( e.g. setting sv_enablebunnyhopping inside a hook ) it won't work, in such cases you should use the SetInternal method instead.

Thrown when the string value can't be parsed.

string ValueAsString { get; set; }
Property Value

Methods

QueryClient(int, Action<string>)

Query the value of the convar from specified client.

void QueryClient(int clientId, Action<string> callback)
Parameters

ReplicateToClientAsString(int, string)

Replicate the value of the convar to specified client.

void ReplicateToClientAsString(int clientId, string value)
Parameters
  • clientId int — The client id to replicate to.
  • value string — The value to replicate.

SetInternalAsString(string)

Internally set the value of the convar. Won't replicate the change to clients.

void SetInternalAsString(string value)
Parameters
  • value string — The value to set.

TryGetDefaultValueAsString(out string)

Try to get the default value of the convar.

bool TryGetDefaultValueAsString(out string defaultValue)
Parameters
  • defaultValue string — The default value of the convar.
Returns
  • bool — True if the default value is found, false otherwise.

TryGetMaxValueAsString(out string)

Try to get the max value of the convar.

bool TryGetMaxValueAsString(out string maxValue)
Parameters
  • maxValue string — The max value of the convar.
Returns
  • bool — True if the max value is found, false otherwise.

TryGetMinValueAsString(out string)

Try to get the min value of the convar.

bool TryGetMinValueAsString(out string minValue)
Parameters
  • minValue string — The min value of the convar.
Returns
  • bool — True if the min value is found, false otherwise.

On this page