예제 #1
0
        private void OnReload(ReloadEventArgs args)
        {
            Economy.Economy.Products = QueryShop.GetProducts();
            args.Player.SendInfoMessage($"[Economy] Pomyslnie zaladowano {Economy.Economy.Products.Count} produktow.");

            Change.Config = ChangeConfig.Read("powelder/recipes.json");
            if (!File.Exists("powelder/recipes.json"))
            {
                Change.Config.Write("powelder/recipes.json");
            }
            Change.Recipes = new Dictionary <int, Recipe>();
            for (int i = 0; i < Change.Config.Recipes.Count(); i++)
            {
                Change.Recipes.Add(i, Change.Config.Recipes[i]);
            }
        }
예제 #2
0
        private void PostInitialize(EventArgs args)
        {
            IsReload = true;
            Economy.Economy.Products = QueryShop.GetProducts();
            TSPlayer.Server.SendInfoMessage("[Economy Shop] Pomyslnie zaladowano {0} produktow.", global::SurvivalCore.Economy.Economy.Products.Count);
            Goals.ProgressLoad();
            IsReload = false;
            Thread thread = new Thread(OneSecondThread)
            {
                IsBackground = true
            };

            thread.Start();
            Thread thread2 = new Thread(EventThreadRun)
            {
                IsBackground = true
            };

            thread2.Start();
            Thread thread3 = new Thread(SaveThread)
            {
                IsBackground = true
            };

            thread3.Start();
            Thread thread4 = new Thread(PingThread)
            {
                IsBackground = true
            };

            thread4.Start();

            new Thread(GiveOutMoneyThread)
            {
                IsBackground = true
            }.Start(10);

            System.Timers.Timer task = new System.Timers.Timer();
            task.Elapsed += BuffBoostTask;
            task.Interval = 3000;
            task.Enabled  = true;
        }