protected override void Load()
 {
     base.Load();
     Instance = this;
     Logger.Log("");
     Logger.Log("Loading ServerSwitcher, made by Mr.Kwabs.", ConsoleColor.Yellow);
     if (Configuration.Instance.RocketRegionsSupport)
     {
         RegionFlag.RegisterFlag("EnterServerSwitch", typeof(EnterServerSwitchFlag));
     }
     U.Events.OnPlayerConnected += OnPlayerConnected;
     Logger.Log("");
     Logger.Log($"Server List ({Configuration.Instance.Servers.Count} Total): ", ConsoleColor.Cyan);
     Logger.Log("");
     foreach (Server Server in Configuration.Instance.Servers)
     {
         Logger.Log($"Name: {Server.Name}", ConsoleColor.Cyan);
         Logger.Log($"IP & Port: {Server.IP}:{Server.Port}", ConsoleColor.Cyan);
         Logger.Log($"Password: {Server.Password}", ConsoleColor.Cyan);
         Logger.Log($"Permission: serverswitcher.server.{Server.Permission}", ConsoleColor.Cyan);
         Logger.Log($"Delay: {Server.Delay}", ConsoleColor.Cyan);
         if (Configuration.Instance.RocketRegionsSupport)
         {
             Logger.Log($"Can be used in Rocket Region: {Server.CanBeUsedInRocketRegion}", ConsoleColor.Cyan);
         }
         Logger.Log("");
     }
     Logger.Log("Successfully loaded ServerSwitcher, made by Mr.Kwabs.", ConsoleColor.Yellow);
 }
Ejemplo n.º 2
0
        protected override void Load()
        {
            Logger.Log($"Regions v{VERSION}", ConsoleColor.Cyan);
            Instance = this;

            if (Configuration.Instance.NoEquipIgnoredItems == null)
            {
                Configuration.Instance.NoEquipIgnoredItems = new List <ushort>();
            }

            if (Configuration.Instance.NoEquipWeaponIgnoredItems == null)
            {
                Configuration.Instance.NoEquipWeaponIgnoredItems = new List <ushort>();
            }

            RegionType.RegisterRegionType("rectangle", typeof(RectangleType));
            RegionType.RegisterRegionType("circle", typeof(CircleType));

            RegionFlag.RegisterFlag("Godmode", typeof(GodmodeFlag));
            RegionFlag.RegisterFlag("NoEnter", typeof(NoEnterFlag));
            RegionFlag.RegisterFlag("NoLeave", typeof(NoLeaveFlag));
            RegionFlag.RegisterFlag("NoZombies", typeof(NoZombiesFlag));
            RegionFlag.RegisterFlag("NoPlace", typeof(NoPlaceFlag));
            RegionFlag.RegisterFlag("NoDestroy", typeof(NoDestroyFlag));
            RegionFlag.RegisterFlag("NoVehiclesUsage", typeof(NoVehiclesUsageFlag));
            RegionFlag.RegisterFlag("NoEquip", typeof(NoEquipFlag));
            RegionFlag.RegisterFlag("NoEquipWeapon", typeof(NoEquipWeaponFlag));
            RegionFlag.RegisterFlag("EnterMessage", typeof(EnterMessageFlag));
            RegionFlag.RegisterFlag("LeaveMessage", typeof(LeaveMessageFlag));
            RegionFlag.RegisterFlag("Teleport", typeof(TeleportFlag));
            RegionFlag.RegisterFlag("UnlimitedGenerator", typeof(UnlimitedGeneratorFlag));
            RegionFlag.RegisterFlag("EnterEffect", typeof(EnterEffectFlag));
            RegionFlag.RegisterFlag("LeaveEffect", typeof(LeaveEffectFlag));
            RegionFlag.RegisterFlag("EnterURL", typeof(EnterURLFlag));
            RegionFlag.RegisterFlag("LeaveURL", typeof(LeaveURLFlag));
            RegionFlag.RegisterFlag("VanishFlag", typeof(VanishFlag));
            RegionFlag.RegisterFlag("NoDecay", typeof(NoDecayFlag));
            RegionFlag.RegisterFlag("EnterAddGroup", typeof(EnterAddGroupFlag));
            RegionFlag.RegisterFlag("EnterRemoveGroup", typeof(EnterRemoveGroupFlag));
            RegionFlag.RegisterFlag("LeaveAddGroup", typeof(LeaveAddGroupFlag));
            RegionFlag.RegisterFlag("LeaveRemoveGroup", typeof(LeaveRemoveGroupFlag));
            RegionFlag.RegisterFlag("Decay", typeof(DecayFlag));
            RegionFlag.RegisterFlag("NoVehicleDamage", typeof(NoVehiclesDamageFlag));
            RegionFlag.RegisterFlag("NoVehiclesLockpick", typeof(NoVehiclesLockpickFlag));
            Configuration.Load();

            _defaultPermissionsProvider = R.Permissions;
            R.Permissions              = new RegionsPermissionsProvider(_defaultPermissionsProvider);
            R.Plugins.OnPluginsLoaded += OnPluginsLoaded;

            foreach (var untPlayer in Provider.clients.Select(p => UnturnedPlayer.FromCSteamID(p.playerID.steamID)))
            {
                OnPlayerConnect(untPlayer);
            }
        }