コード例 #1
0
ファイル: BattlegroundMgr.cs プロジェクト: uvbs/Asda2-Server
        public static void SetCreator(BattlegroundId id, string typeName)
        {
            Type type = ServerApp <WCell.RealmServer.RealmServer> .GetType(typeName);

            BattlegroundTemplate template = BattlegroundMgr.GetTemplate(id);

            if (type == (Type)null || template == null)
            {
                object obj1;
                object obj2;
                if (type == (Type)null)
                {
                    obj1 = (object)"type";
                    obj2 = (object)string.Format("({0}) - Please correct it in the Battleground-config file: {1}",
                                                 (object)typeName, (object)InstanceConfigBase <BattlegroundConfig, BattlegroundId> .Filename);
                }
                else
                {
                    obj1 = (object)"Template";
                    obj2 = (object)"<not in DB>";
                }

                BattlegroundMgr.log.Warn("Battleground {0} has invalid {1} {2}", (object)id, obj1, obj2);
            }
            else
            {
                IProducer producer = AccessorMgr.GetOrCreateDefaultProducer(type);
                template.Creator = (BattlegroundCreator)(() => (Battleground)producer.Produce());
            }
        }
コード例 #2
0
ファイル: BattlegroundMgr.cs プロジェクト: uvbs/Asda2-Server
 public static void InitializeBGs()
 {
     BattlegroundMgr.BattlemasterListReader =
         new MappedDBCReader <BattlemasterList, BattlemasterConverter>(
             RealmServerConfiguration.GetDBCFile("BattlemasterList.dbc"));
     BattlegroundMgr.PVPDifficultyReader =
         new MappedDBCReader <PvPDifficultyEntry, PvPDifficultyConverter>(
             RealmServerConfiguration.GetDBCFile("PvpDifficulty.dbc"));
     ContentMgr.Load <BattlegroundTemplate>();
     BattlegroundMgr.DeserterSpell = SpellHandler.Get(BattlegroundMgr.DeserterSpellId);
     BattlegroundMgr.Loaded        = true;
     BattlegroundConfig.LoadSettings();
     BattlegroundMgr.EnsureBattlemasterRelations();
 }
コード例 #3
0
ファイル: BattlegroundMgr.cs プロジェクト: uvbs/Asda2-Server
 /// <summary>Enqueues players in a battleground queue.</summary>
 /// <param name="chr">the character who enqueued</param>
 /// <param name="bgId">the type of battleground</param>
 /// <param name="instanceId">the instance id of the battleground</param>
 /// <param name="asGroup">whether or not to enqueue the character or his/her group</param>
 internal static void EnqueuePlayers(Character chr, BattlegroundId bgId, uint instanceId, bool asGroup)
 {
     if (!chr.Battlegrounds.HasAvailableQueueSlots)
     {
         BattlegroundHandler.SendBattlegroundError((IPacketReceiver)chr, BattlegroundJoinError.Max3Battles);
     }
     else
     {
         if (chr.Battlegrounds.IsEnqueuedFor(bgId))
         {
             return;
         }
         BattlegroundTemplate template = BattlegroundMgr.GetTemplate(bgId);
         if (template == null)
         {
             return;
         }
         template.TryEnqueue(chr, asGroup, instanceId);
     }
 }
コード例 #4
0
        public void FinalizeDataHolder()
        {
            NPCEntry entry = NPCMgr.GetEntry(this.BattleMasterId);

            if (entry == null)
            {
                ContentMgr.OnInvalidDBData("Invalid BattleMaster in: " + (object)this);
            }
            else
            {
                BattlegroundTemplate template = BattlegroundMgr.GetTemplate(this.BattlegroundId);
                if (template == null)
                {
                    ContentMgr.OnInvalidDBData("Invalid Battleground in: " + (object)this);
                }
                else
                {
                    entry.BattlegroundTemplate = template;
                }
            }
        }
コード例 #5
0
        public void FinalizeDataHolder()
        {
            var bm = NPCMgr.GetEntry(BattleMasterId);

            if (bm == null)
            {
                ContentMgr.OnInvalidDBData("Invalid BattleMaster in: " + this);
            }
            else
            {
                var bg = BattlegroundMgr.GetTemplate(BattlegroundId);
                if (bg == null)
                {
                    ContentMgr.OnInvalidDBData("Invalid Battleground in: " + this);
                }
                else
                {
                    bm.BattlegroundTemplate = bg;
                }
            }
        }
コード例 #6
0
 protected override void InitSetting(InstanceConfigEntry <BattlegroundId> configEntry)
 {
     BattlegroundMgr.SetCreator(configEntry.Name, configEntry.TypeName.Trim());
 }
コード例 #7
0
ファイル: BattlegroundMgr.cs プロジェクト: uvbs/Asda2-Server
 /// <summary>
 /// Gets the <see cref="T:WCell.RealmServer.Battlegrounds.BattlegroundQueue" /> for a specific instance of the given Battleground for
 /// the given Character.
 /// </summary>
 /// <param name="bgid"></param>
 /// <returns></returns>
 public static BattlegroundQueue GetInstanceQueue(BattlegroundId bgid, uint instanceId, Unit unit)
 {
     return(BattlegroundMgr.GetInstanceQueue(bgid, instanceId, unit.Level));
 }
コード例 #8
0
ファイル: BattlegroundMgr.cs プロジェクト: uvbs/Asda2-Server
 /// <summary>
 /// Gets the global <see cref="T:WCell.RealmServer.Battlegrounds.BattlegroundQueue" /> for the given Battleground for
 /// the given Character.
 /// </summary>
 /// <param name="bgid"></param>
 /// <returns></returns>
 public static GlobalBattlegroundQueue GetGlobalQueue(BattlegroundId bgid, Unit unit)
 {
     return(BattlegroundMgr.GetGlobalQueue(bgid, unit.Level));
 }
コード例 #9
0
ファイル: BattlegroundMgr.cs プロジェクト: uvbs/Asda2-Server
 public static void SetCreator(BattlegroundId id, BattlegroundCreator creator)
 {
     BattlegroundMgr.GetTemplate(id).Creator = creator;
 }
コード例 #10
0
 public GlobalBattlegroundQueue(BattlegroundId bgid)
     : this(BattlegroundMgr.GetTemplate(bgid))
 {
 }