Exemplo n.º 1
0
 public static void Reload()
 {
     Settings.Load();
     Translation.Load();
     Permissions.Reload();
     Plugins.Reload();
     Commands.Reload();
     Implementation.Reload();
 }
Exemplo n.º 2
0
 protected override void Load()
 {
     Instance       = this;
     CosmeticsStore = new XMLFileAsset <PlayersCosmeticsStore>(Path.Combine(Directory, $"{Name}.cosmetics.xml"));
     CosmeticsStore.Load();
     UnturnedPermissions.OnJoinRequested += OnJoinRequested;
     SaveManager.onPreSave += OnPreSave;
     Logger.Log($"Advanced Cosmetics v{Assembly.GetName().Version} has been loaded");
     Logger.Log("Do you want more cool plugins? Join now: https://discord.gg/4FF2548 !");
 }
Exemplo n.º 3
0
        public void DefaultItems()
        {
            IAsset <DefaultValues> defaultValues = null;
            string text = Path.Combine(DShop.Instance.Directory, string.Format("{0}.defaultvalues.xml", DShop.Instance.Name));

            try
            {
                defaultValues = new XMLFileAsset <DefaultValues>(text, null, null);
                defaultValues.Load();
                if (ObjectListConfigVersion < defaultValues.Instance.FileVersion)
                {
                    ObjectListConfigVersion = defaultValues.Instance.FileVersion;
                    Dictionary <ushort, ShopObject> items    = DShop.Instance.Database.GetAllItems(ItemType.Item);
                    Dictionary <ushort, ShopObject> vehicles = DShop.Instance.Database.GetAllItems(ItemType.Vehicle);
                    Logger.Log("Adding new Default items to database!");
                    // Start adding items to the database from the defaults file that aren't present in the database.
                    foreach (ShopItem item in defaultValues.Instance.Items)
                    {
                        if (!items.ContainsKey(item.ItemID))
                        {
                            // Get generate the asset name for the database.
                            item.AssetName();
                            DShop.Instance.Database.AddItem(ItemType.Item, item as ShopObject);
                        }
                    }
                    foreach (ShopVehicle vehicle in defaultValues.Instance.Vehicles)
                    {
                        if (!vehicles.ContainsKey(vehicle.ItemID))
                        {
                            // Get generate the asset name for the database.
                            vehicle.AssetName();
                            DShop.Instance.Database.AddItem(ItemType.Vehicle, vehicle as ShopObject);
                        }
                    }
                    Logger.Log("Finished!");
                }
                //defaultValues.Save();
            }
            catch
            {
                Logger.LogWarning("Error parsing the defaults file, skipping loading shop defaults!");
                return;
            }
        }
Exemplo n.º 4
0
 public void Reload()
 {
     Translation.Load();
     Settings.Load();
 }
Exemplo n.º 5
0
 private void Awake()
 {
     _whitelistAsset = new XMLFileAsset <WhitelistXml>(
         Path.Combine(Path.Combine(Environment.PluginsDirectory, ZebraPlugin.Self.Name), "AviZebra.whitelist.xml"));
     _whitelistAsset.Load();
 }