public static void Load() { old = new OldPerms(); if (PropertiesFile.Read(Paths.ServerPropsFile, ref old, LineProcessor)) { Server.SettingsUpdate(); } if (old.saveZS) { ZSConfig.SaveSettings(); } ZSConfig.LoadSettings(); Database.Backend = ServerConfig.UseMySQL ? MySQLBackend.Instance : SQLiteBackend.Instance; #pragma warning disable 0618 Server.DefaultColor = ServerConfig.DefaultColor; Server.moneys = ServerConfig.Currency; #pragma warning restore 0618 if (!Directory.Exists(ServerConfig.BackupDirectory)) { ServerConfig.BackupDirectory = Path.Combine(Utils.FolderPath, "levels/backups"); } Save(); }
public static void Load(string givenPath, bool skipsalt = false) { RandomNumberGenerator prng = RandomNumberGenerator.Create(); StringBuilder sb = new StringBuilder(); byte[] oneChar = new byte[1]; while (sb.Length < 16) { prng.GetBytes(oneChar); if (Char.IsLetterOrDigit((char)oneChar[0])) { sb.Append((char)oneChar[0]); } } Server.salt = sb.ToString(); if (PropertiesFile.Read(givenPath, LineProcessor)) { Server.s.SettingsUpdate(); } if (!Directory.Exists(Server.backupLocation)) { Server.backupLocation = Application.StartupPath + "/levels/backups"; } Server.updateTimer.Interval = Server.PositionInterval; Save(givenPath); }
public static void Load() { old = new OldPerms(); if (PropertiesFile.Read(Paths.ServerPropsFile, ref old, LineProcessor)) { Server.SettingsUpdate(); } CountdownGame.Config.Load(); ZSGame.Config.Load(); LSGame.Config.Load(); CTFGame.Config.Load(); TWGame.Config.Load(); Database.Backend = Server.Config.UseMySQL ? MySQLBackend.Instance : SQLiteBackend.Instance; #pragma warning disable 0618 Server.DefaultColor = Server.Config.DefaultColor; Server.moneys = Server.Config.Currency; #pragma warning restore 0618 if (!Directory.Exists(Server.Config.BackupDirectory)) { Server.Config.BackupDirectory = "levels/backups"; } Save(); Server.SetMainLevel(Server.Config.MainLevel); }
public static void Load() { aliases = new List <Alias>(); if (!File.Exists(file)) { Save(); return; } PropertiesFile.Read(file, LineProcessor, ':'); }
public static void InitAll() { Group temp = null; PropertiesFile.Read(Paths.RankPropsFile, ref temp, ParseProperty, '=', false); if (temp != null) { AddGroup(ref temp); } }
public static void InitAll() { List <string> lines = CP437Reader.ReadAllLines(filename); Group grp = null; PropertiesFile.Read(filename, ref grp, ParseProperty, '=', false); if (grp != null) { AddGroup(ref grp); } }
public static void Load() { aliases.Clear(); coreAliases.Clear(); if (!File.Exists(file)) { Save(); return; } PropertiesFile.Read(file, LineProcessor, ':'); }
void LoadAutoloadCommands() { if (File.Exists("text/autoload.txt")) { PropertiesFile.Read("text/autoload.txt", AutoLoadLineProcessor); GC.Collect(); GC.WaitForPendingFinalizers(); } else { Log("autoload.txt does not exist"); } }
public void LoadConfig() { if (cfg == null) { cfg = ConfigElement.GetAll(typeof(DiscordConfig)); } PropertiesFile.Read(ConfigFile, LineProcessor); SaveConfig(); if (config.DiscordPrefix != "") { config.DiscordPrefix += " "; // add space after prefix, trim removes it } }
public static void InitAll() { Group temp = null; if (cfg == null) { cfg = ConfigElement.GetAll(typeof(Group)); } PropertiesFile.Read(Paths.RankPropsFile, ref temp, ParseProperty, '=', false); if (temp != null) { AddGroup(ref temp); } }
public static void LoadList() { if (!File.Exists("plugins/Parties/parties.txt")) { return; } Team tmp = new Team(); lock (ioLock) { Teams.Clear(); PropertiesFile.Read("plugins/Parties/parties.txt", ref tmp, LineProcessor, '='); if (tmp.Name != null) { Add(tmp); } } }
public static void Load() { if (!File.Exists("text/awardsList.txt")) { using (CP437Writer w = new CP437Writer("text/awardsList.txt")) { w.WriteLine("#This is a full list of awards. The server will load these and they can be awarded as you please"); w.WriteLine("#Format is:"); w.WriteLine("# AwardName : Description of award goes after the colon"); w.WriteLine(); w.WriteLine("Gotta start somewhere : Built your first house"); w.WriteLine("Climbing the ladder : Earned a rank advancement"); w.WriteLine("Do you live here? : Joined the server a huge bunch of times"); } } AwardsList = new List <Award>(); PropertiesFile.Read("text/awardsList.txt", AwardsListLineProcessor, ':'); PlayerAwards = new List <PlayerAward>(); PropertiesFile.Read("text/playerAwards.txt", PlayerAwardsLineProcessor, ':'); }
public static void LoadDisabledList() { supportedCount = 0; foreach (CpeExtension e in All) { e.Enabled = true; } PropertiesFile.Read(Paths.CPEDisabledFile, ParseLine, '='); // file is out of sync with actual list if (supportedCount == All.Length) { return; } try { SaveDisabledList(); } catch (Exception ex) { Logger.LogError("Error saving CPE disabled list", ex); } }
public static void Load(string givenPath, bool skipSalt = false) { if (!skipSalt) { GenerateSalt(); } oldPerms = new OldPerms(); if (PropertiesFile.Read(givenPath, ref oldPerms, LineProcessor)) { Server.s.SettingsUpdate(); } Database.Backend = Server.useMySQL ? MySQLBackend.Instance : SQLiteBackend.Instance; if (!Directory.Exists(Server.backupLocation)) { Server.backupLocation = Application.StartupPath + "/levels/backups"; } Server.updateTimer.Interval = Server.PositionInterval; Save(givenPath); }
public static void Load() { old = new OldPerms(); if (PropertiesFile.Read(Paths.ServerPropsFile, ref old, LineProcessor)) { Server.SettingsUpdate(); } CountdownGame.Config.Load(); ZSGame.Config.Load(); LSGame.Config.Load(); CTFGame.Config.Load(); TWGame.Config.Load(); Database.Backend = Server.Config.UseMySQL ? MySQLBackend.Instance : SQLiteBackend.Instance; if (!Directory.Exists(Server.Config.BackupDirectory)) { Server.Config.BackupDirectory = "levels/backups"; } Save(); Server.SetMainLevel(Server.Config.MainLevel); }
/// <summary> Loads updater properties from given file </summary> /// <param name="givenPath">File path relative to server to load properties from</param> public static void Load(string givenPath) { PropertiesFile.Read(givenPath, LineProcessor); }
public static bool ParseFile(ConfigElement[] elements, string path, object instance) { return(PropertiesFile.Read(path, (k, v) => Parse(elements, instance, k, v))); }
public static bool Load(string path, LevelConfig config) { return(PropertiesFile.Read(path, ref config, LineProcessor)); }