Table of Contents

Class ServerConfigFile

Namespace
Shard.Server.Modules
Assembly
Shard.Server.Modules.dll

Loads and saves ServerConfig as human-editable JSON. Missing files are created with defaults; an existing file is parsed then rewritten so newly added fields appear and formatting stays canonical. A malformed file is NOT overwritten, the error propagates so the operator can fix it.

public static class ServerConfigFile
Inheritance
ServerConfigFile
Inherited Members

Fields

DefaultPath

public const string DefaultPath = "config.json"

Field Value

string

Methods

LoadOrCreate(string)

Load the config at path, creating it with defaults if absent.

public static ServerConfig LoadOrCreate(string path)

Parameters

path string

Returns

ServerConfig

Save(string, ServerConfig)

public static void Save(string path, ServerConfig config)

Parameters

path string
config ServerConfig