Table of Contents

Interface IConfigService

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

Provides typed access to the open.mp server config (config.json / runtime values).

public interface IConfigService

Methods

GetBool(string)

Gets a boolean config value.

bool? GetBool(string key)

Parameters

key string

The config key.

Returns

bool?

The value, or null if the key is missing or has a non-boolean type.

GetFloat(string)

Gets a floating-point config value.

float? GetFloat(string key)

Parameters

key string

The config key.

Returns

float?

The value, or null if the key is missing or has a non-float type.

GetInt(string)

Gets an integer config value.

int? GetInt(string key)

Parameters

key string

The config key.

Returns

int?

The value, or null if the key is missing or has a non-integer type.

GetOptions()

Retrieves a read-only collection of available configuration options and their associated types.

IReadOnlyDictionary<string, ConfigOptionType> GetOptions()

Returns

IReadOnlyDictionary<string, ConfigOptionType>

An IReadOnlyDictionary<TKey, TValue> containing the names and types of all available configuration options.

GetString(string)

Gets a string config value.

string? GetString(string key)

Parameters

key string

The config key.

Returns

string

The value, or null if the key is missing or has a non-string type.

GetStrings(string)

Gets a string-array config value.

string?[] GetStrings(string key)

Parameters

key string

The config key.

Returns

string[]

The value array; an empty array if the key is missing.

GetValueType(string)

Gets the type of the value stored under the given key.

ConfigOptionType GetValueType(string key)

Parameters

key string

The config key.

Returns

ConfigOptionType

The value type.