Ejemplo n.º 1
0
            public override void Process(CmdTrigger <RealmServerCmdArgs> trigger)
            {
                if (Asda2LootMgr.Loaded)
                {
                    trigger.Reply("Loot has already been loaded. Clearing and reloading");
                    Asda2LootMgr.ClearLootData();
                }

                ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((Action)(() =>
                {
                    trigger.Reply("Loading Loot...");
                    Asda2LootMgr.LoadAll();
                    trigger.Reply("Done.");
                }));
            }
Ejemplo n.º 2
0
            public virtual void LoadAll(CmdTrigger <RealmServerCmdArgs> trigger, bool force)
            {
                DateTime now = DateTime.Now;

                try
                {
                    if (ItemMgr.Loaded)
                    {
                        trigger.Reply("Item definitions have already been loaded.");
                    }
                    else
                    {
                        trigger.Reply("Loading Items...");
                        ItemMgr.LoadAll();
                        trigger.Reply("Done.");
                    }
                }
                catch (Exception ex)
                {
                    this.FailNotify(trigger, ex);
                }

                try
                {
                    if (NPCMgr.Loaded)
                    {
                        trigger.Reply("NPC definitions have already been loaded.");
                    }
                    else
                    {
                        trigger.Reply("Loading NPCs...");
                        NPCMgr.LoadNPCDefs(force);
                        trigger.Reply("Done.");
                    }
                }
                catch (Exception ex)
                {
                    this.FailNotify(trigger, ex);
                }

                try
                {
                    if (GOMgr.Loaded)
                    {
                        trigger.Reply("GO definitions have already been loaded.");
                    }
                    else
                    {
                        trigger.Reply("Loading GOs...");
                        GOMgr.LoadAll();
                        trigger.Reply("Done.");
                    }
                }
                catch (Exception ex)
                {
                    this.FailNotify(trigger, ex);
                }

                try
                {
                    if (QuestMgr.Loaded)
                    {
                        trigger.Reply("Quest definitions have already been loaded.");
                    }
                    else
                    {
                        trigger.Reply("Loading Quests...");
                        QuestMgr.LoadAll();
                        trigger.Reply("Done.");
                    }
                }
                catch (Exception ex)
                {
                    this.FailNotify(trigger, ex);
                }

                try
                {
                    if (Asda2LootMgr.Loaded)
                    {
                        trigger.Reply("Loot has already been loaded.");
                    }
                    else
                    {
                        trigger.Reply("Loading Loot...");
                        Asda2LootMgr.LoadAll();
                        trigger.Reply("Done.");
                    }
                }
                catch (Exception ex)
                {
                    this.FailNotify(trigger, ex);
                }

                trigger.Reply("All done - Loading took: " + (object)(DateTime.Now - now));
                GC.Collect(2, GCCollectionMode.Optimized);
                if (!Map.AutoSpawnMaps)
                {
                    return;
                }
                MapCommand.MapSpawnCommand.SpawnAllMaps(trigger);
            }