예제 #1
0
        /// <summary>
        /// Handles an incoming request or answer to raid ready check
        /// </summary>
        /// <param name="client">the Session the incoming packet belongs to</param>
        /// <param name="packet">the full packet</param>
        public static void RaidReadyCheck(IRealmClient client, RealmPacketIn packet)
        {
            GroupMember groupMember = client.ActiveCharacter.GroupMember;

            if (groupMember == null)
            {
                return;
            }
            RaidGroup group = groupMember.Group as RaidGroup;

            if (group == null)
            {
                return;
            }
            if (packet.RemainingLength == 0)
            {
                if (!group.CheckPrivs(groupMember, GroupPrivs.Assistant))
                {
                    return;
                }
                group.SendReadyCheckRequest(groupMember);
            }
            else
            {
                ReadyCheckStatus status = (ReadyCheckStatus)packet.ReadByte();
                group.SendReadyCheckResponse(groupMember, status);
            }
        }
예제 #2
0
        /// <summary>
        /// Handles an incoming request on changing Assistant flag of specified Character
        /// </summary>
        /// <param name="client">the Session the incoming packet belongs to</param>
        /// <param name="packet">the full packet</param>
        public static void ChangeAssistantFlagRequest(IRealmClient client, RealmPacketIn packet)
        {
            GroupMember groupMember = client.ActiveCharacter.GroupMember;

            if (groupMember == null)
            {
                return;
            }
            RaidGroup group = groupMember.Group as RaidGroup;

            if (group == null)
            {
                return;
            }
            EntityId    entityId = packet.ReadEntityId();
            GroupMember target   = group[entityId.Low];

            if (group.CheckAction(groupMember, target, target != null ? target.Name : string.Empty,
                                  GroupPrivs.Leader) != GroupResult.NoError)
            {
                return;
            }
            bool flag = packet.ReadBoolean();

            target.IsAssistant = flag;
            group.SendUpdate();
        }
예제 #3
0
        /// <summary>
        /// Handles an incoming request for changing the Main Tank or Main Assistant flag
        /// of specified Character
        /// </summary>
        /// <param name="client">the Session the incoming packet belongs to</param>
        /// <param name="packet">the full packet</param>
        public static void GroupPromoteFlagRequest(IRealmClient client, RealmPacketIn packet)
        {
            GroupMember groupMember = client.ActiveCharacter.GroupMember;

            if (groupMember == null)
            {
                return;
            }
            RaidGroup group = groupMember.Group as RaidGroup;

            if (group == null)
            {
                return;
            }
            byte num = packet.ReadByte();

            packet.ReadBoolean();
            EntityId    entityId = packet.ReadEntityId();
            GroupMember target   = group[entityId.Low];

            if (group.CheckAction(groupMember, target, target != null ? target.Name : string.Empty,
                                  GroupPrivs.Leader) != GroupResult.NoError)
            {
                return;
            }
            if (num != 0)
            {
                group.MainAssistant = target;
            }
            group.SendUpdate();
        }
예제 #4
0
        /// <summary>
        /// Handles an incoming request on moving Character from one subgroup to another
        /// </summary>
        /// <param name="client">the Session the incoming packet belongs to</param>
        /// <param name="packet">the full packet</param>
        public static void ChangeSubgroupRequest(IRealmClient client, RealmPacketIn packet)
        {
            GroupMember groupMember1 = client.ActiveCharacter.GroupMember;

            if (groupMember1 == null)
            {
                return;
            }
            RaidGroup group1 = groupMember1.Group as RaidGroup;

            if (group1 == null)
            {
                return;
            }
            string      targetName   = packet.ReadCString();
            byte        num          = packet.ReadByte();
            GroupMember groupMember2 = group1[targetName];

            if (group1.CheckAction(groupMember1, groupMember2, targetName, GroupPrivs.Assistant) != GroupResult.NoError)
            {
                return;
            }
            SubGroup group2 = group1.SubGroups.Get(num);

            if (group2 == null)
            {
                return;
            }
            if (!group1.MoveMember(groupMember2, group2))
            {
                SendResult(client, GroupResult.GroupIsFull);
            }
            else
            {
                group1.SendUpdate();
            }
        }