Exemple #1
0
        public static void HandleBattleFieldStatusRequest(IRealmClient client, RealmPacketIn packet)
        {
            Character activeCharacter = client.ActiveCharacter;

            if (!activeCharacter.Battlegrounds.IsEnqueuedForBattleground)
            {
                return;
            }
            BattlegroundRelation[] relations = activeCharacter.Battlegrounds.Relations;
            int length = activeCharacter.Battlegrounds.Relations.Length;

            for (int index = 0; index < length; ++index)
            {
                BattlegroundRelation relation = relations[index];
                if (relation != null)
                {
                    if (relation.IsEnqueued)
                    {
                        BattlegroundHandler.SendStatusEnqueued(activeCharacter, index, relation,
                                                               relation.Queue.ParentQueue);
                    }
                    else if (activeCharacter.Map is Battleground &&
                             relation.BattlegroundId == ((Battleground)activeCharacter.Map).Template.Id)
                    {
                        BattlegroundHandler.SendStatusActive(activeCharacter, (Battleground)activeCharacter.Map,
                                                             index);
                    }
                }
            }
        }
Exemple #2
0
        public static void PvPLogDataRequest(IRealmClient client, RealmPacketIn packet)
        {
            Character activeCharacter = client.ActiveCharacter;

            if (!activeCharacter.IsInBattleground)
            {
                return;
            }
            BattlegroundTeam team = activeCharacter.Battlegrounds.Team;

            if (team == null)
            {
                return;
            }
            BattlegroundHandler.SendPvpData((IPacketReceiver)client, team.Side, team.Battleground);
        }
Exemple #3
0
        public static void HandleBattlefieldList(IRealmClient client, RealmPacketIn packet)
        {
            BattlegroundId bgid = (BattlegroundId)packet.ReadUInt32();

            packet.ReadBoolean();
            int num = (int)packet.ReadByte();
            BattlegroundTemplate template        = BattlegroundMgr.GetTemplate(bgid);
            Character            activeCharacter = client.ActiveCharacter;

            if (template == null)
            {
                return;
            }
            GlobalBattlegroundQueue queue = template.GetQueue(activeCharacter.Level);

            if (queue == null)
            {
                return;
            }
            BattlegroundHandler.SendBattlefieldList(activeCharacter, queue);
        }
Exemple #4
0
 /// <summary>
 /// Make sure that <see cref="P:WCell.RealmServer.Battlegrounds.BattlegroundInfo.Invitation" /> is set.
 /// </summary>
 public static void SendStatusInvited(Character chr)
 {
     BattlegroundHandler.SendStatusInvited(chr, BattlegroundMgr.InvitationTimeoutMillis);
 }