Table of Contents

Class ConfigManager

Namespace
Exiled.Loader
Assembly
Exiled.Loader.dll

Used to handle plugin configs.

public static class ConfigManager
Inheritance
ConfigManager
Inherited Members

Methods

Clear()

Clears the configs.

public static bool Clear()

Returns

bool

Returns a value indicating whether configs have been cleared successfully.

LoadConfig(IPlugin<IConfig>, Dictionary<string, object>)

Loads the config of a plugin using the distribution.

public static IConfig LoadConfig(this IPlugin<IConfig> plugin, Dictionary<string, object> rawConfigs = null)

Parameters

plugin IPlugin<IConfig>

The plugin which config will be loaded.

rawConfigs Dictionary<string, object>

The raw configs to detect if the plugin already has generated configs.

Returns

IConfig

The IConfig of the plugin.

LoadDefaultConfig(IPlugin<IConfig>, Dictionary<string, object>)

Loads the config of a plugin using the default distribution.

public static IConfig LoadDefaultConfig(this IPlugin<IConfig> plugin, Dictionary<string, object> rawConfigs)

Parameters

plugin IPlugin<IConfig>

The plugin which config will be loaded.

rawConfigs Dictionary<string, object>

The raw configs to detect if the plugin already has generated configs.

Returns

IConfig

The IConfig of the plugin.

LoadLabAPIConfig(Plugin)

Attempts to load a config for a LabAPI plugin.

public static void LoadLabAPIConfig(Plugin plugin)

Parameters

plugin Plugin

The LabAPI plugin.

Remarks

I love it when the modding framework people call the best has all plugin loading methods private and the config loading methods don't take custom directory paths.

LoadLabAPIProperties(Plugin)

Loads the properties of a LabAPI plugin.

public static bool LoadLabAPIProperties(Plugin plugin)

Parameters

plugin Plugin

The LabAPI plugin.

Returns

bool

Whether the properties were successfully retrieved.

LoadSeparatedConfig(IPlugin<IConfig>)

Loads the config of a plugin using the separated distribution.

public static IConfig LoadSeparatedConfig(this IPlugin<IConfig> plugin)

Parameters

plugin IPlugin<IConfig>

The plugin which its config will be loaded.

Returns

IConfig

The IConfig of the plugin.

LoadSorted(string)

Loads all the plugin configs.

public static SortedDictionary<string, IConfig> LoadSorted(string rawConfigs)

Parameters

rawConfigs string

The raw configs to be loaded.

Returns

SortedDictionary<string, IConfig>

Returns a dictionary of loaded configs.

Read()

Read all plugin configs.

public static string Read()

Returns

string

Returns the read configs.

Reload()

Reads, loads, and saves plugin configs.

public static bool Reload()

Returns

bool

Returns a value indicating if the reloading process has been completed successfully or not.

ReloadLabAPIConfigs()

Reloads all LabAPI configs.

public static void ReloadLabAPIConfigs()

ReloadRemoteAdmin()

Reloads RemoteAdmin configs.

public static void ReloadRemoteAdmin()

Save(SortedDictionary<string, IConfig>)

Saves plugin configs.

public static bool Save(SortedDictionary<string, IConfig> configs)

Parameters

configs SortedDictionary<string, IConfig>

The configs to be saved.

Returns

bool

Returns a value indicating whether the configs have been saved successfully.

SaveDefaultConfig(string)

Saves default distribution configs.

public static bool SaveDefaultConfig(string configs)

Parameters

configs string

The configs to be saved, already serialized in yaml format.

Returns

bool

Returns a value indicating whether the configs have been saved successfully.

SaveLabAPIConfig(Plugin)

Saves a config for a LabAPI plugin.

public static void SaveLabAPIConfig(Plugin plugin)

Parameters

plugin Plugin

The LabAPI plugin.

SaveSeparatedConfig(string, string)

Saves separated distribution plugin configs.

public static bool SaveSeparatedConfig(this string pluginPrefix, string configs)

Parameters

pluginPrefix string

The prefix of the plugin which its config is going to be saved.

configs string

The configs to be saved, already serialized in yaml format.

Returns

bool

Returns a value indicating whether the configs have been saved successfully.

ValidateConfig(IPlugin<IConfig>, IConfig)

Validates plugin config.

public static IConfig ValidateConfig(this IPlugin<IConfig> plugin, IConfig config)

Parameters

plugin IPlugin<IConfig>

Plugin which config is validated.

config IConfig

Validated config.

Returns

IConfig

Config after validation is passed.

ValidateType(object, object, PropertyInfo, ref int)

Performs a validation for property and all its properties in propertyInfo's type.

public static void ValidateType(object instance, object defaultInstance, PropertyInfo propertyInfo, ref int validated)

Parameters

instance object

Plugin which config is validated.

defaultInstance object

Validated config.

propertyInfo PropertyInfo

Property which will be validated.

validated int

Amount of successfully passed validations.