C# Class fCraft.Config

Show file Open project: fragmer/fCraft Class Usage Examples

Public Properties

Property Type Description
IsPublic bool
MOTD string
MaxPlayers int
Salt int
Salt long
ServerName string
ServerURL string
VerifyNames bool
classes ClassList
errors string
logger Logger

Public Methods

Method Description
Config ( World _world, ClassList _classes, Logger _logger ) : System
GetBasePriority ( ) : System.Diagnostics.ProcessPriorityClass
GetBool ( string key ) : bool
GetInt ( string key ) : int
GetString ( string key ) : string
Init ( string configFileName ) : bool
Load ( string configFileName ) : bool
LoadDefaults ( ) : void
LoadDefaultsAdvanced ( ) : void
LoadDefaultsGeneral ( ) : void
LoadDefaultsLogging ( ) : void
LoadDefaultsSavingAndBackup ( ) : void
LoadDefaultsSecurity ( ) : void
Log ( string format, LogType type ) : void
ParseLogOptions ( XElement el, bool &list ) : void
ResetClasses ( ) : void
Save ( string configFileName ) : bool
SetValue ( string key, string value ) : bool

Private Methods

Method Description
ApplyConfig ( ) : void
DefineClass ( System.Xml.Linq.XElement el ) : bool
DefineDefaultClasses ( ) : System.Xml.Linq.XElement
ReadBool ( XElement doc, string fieldName, bool _default ) : bool
ReadInt ( XElement doc, string fieldName, int _default ) : int
ReadString ( XElement doc, string fieldName, string _default ) : string
ValidateBool ( string key, string value ) : bool
ValidateColor ( string key, string value ) : bool
ValidateEnum ( string key, string value ) : bool
ValidateInt ( string key, string value, int minRange, int maxRange ) : bool
ValidateString ( string key, string value, int minLength, int maxLength ) : bool

Method Details

Config() public method

public Config ( World _world, ClassList _classes, Logger _logger ) : System
_world World
_classes ClassList
_logger Logger
return System

GetBasePriority() public method

public GetBasePriority ( ) : System.Diagnostics.ProcessPriorityClass
return System.Diagnostics.ProcessPriorityClass

GetBool() public method

public GetBool ( string key ) : bool
key string
return bool

GetInt() public method

public GetInt ( string key ) : int
key string
return int

GetString() public method

public GetString ( string key ) : string
key string
return string

Init() public static method

public static Init ( string configFileName ) : bool
configFileName string
return bool

Load() public method

public Load ( string configFileName ) : bool
configFileName string
return bool

LoadDefaults() public method

public LoadDefaults ( ) : void
return void

LoadDefaultsAdvanced() public method

public LoadDefaultsAdvanced ( ) : void
return void

LoadDefaultsGeneral() public method

public LoadDefaultsGeneral ( ) : void
return void

LoadDefaultsLogging() public method

public LoadDefaultsLogging ( ) : void
return void

LoadDefaultsSavingAndBackup() public method

public LoadDefaultsSavingAndBackup ( ) : void
return void

LoadDefaultsSecurity() public method

public LoadDefaultsSecurity ( ) : void
return void

Log() public method

public Log ( string format, LogType type ) : void
format string
type LogType
return void

ParseLogOptions() public method

public ParseLogOptions ( XElement el, bool &list ) : void
el XElement
list bool
return void

ResetClasses() public method

public ResetClasses ( ) : void
return void

Save() public method

public Save ( string configFileName ) : bool
configFileName string
return bool

SetValue() public method

public SetValue ( string key, string value ) : bool
key string
value string
return bool

Property Details

IsPublic public static property

public static bool IsPublic
return bool

MOTD public static property

public static string MOTD
return string

MaxPlayers public static property

public static int MaxPlayers
return int

Salt public property

public int Salt
return int

Salt public static property

public static long Salt
return long

ServerName public static property

public static string ServerName
return string

ServerURL public static property

public static string ServerURL
return string

VerifyNames public static property

public static bool VerifyNames
return bool

classes public property

public ClassList classes
return ClassList

errors public property

public string errors
return string

logger public property

public Logger logger
return Logger