Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        void SaveChanges()
        {
            SaveProperties();
            SaveRanks();
            SaveCommands();
            SaveBlocks();
            try { SaveLavaSettings(); }
            catch { Logger.Log(LogType.Warning, "Error saving Lava Survival settings!"); }
            try { ZSConfig.SaveSettings(); }
            catch { Logger.Log(LogType.Warning, "Error saving Zombie Survival settings!"); }

            SrvProperties.Load(); // loads when saving?
            CommandPerms.Load();
        }
Exemplo n.º 3
0
        static void SetMaxMove(Player p, ZSGame game, string[] args)
        {
            if (args.Length == 2)
            {
                Player.Message(p, "Maxmium move distance is currently &a" + ZSConfig.MaxMoveDistance + " %Sunits apart.");
                return;
            }

            byte distance = 0;

            if (!CommandParser.GetByte(p, args[2], "Maxmimum move distance", ref distance))
            {
                return;
            }

            ZSConfig.MaxMoveDistance = distance;
            Player.Message(p, "Maximum move distance set to &a" + distance + " %Sunits apart.");
            ZSConfig.SaveSettings();
        }
Exemplo n.º 4
0
        static void SetHitbox(Player p, ZSGame game, string[] args)
        {
            if (args.Length == 2)
            {
                Player.Message(p, "Hitbox detection is currently &a" + ZSConfig.HitboxPrecision + " %Sunits apart.");
                return;
            }

            byte precision = 0;

            if (!CommandParser.GetByte(p, args[2], "Hitbox detection", ref precision))
            {
                return;
            }

            ZSConfig.HitboxPrecision = precision;
            Player.Message(p, "Hitbox detection set to &a" + precision + " %Sunits apart.");
            ZSConfig.SaveSettings();
        }