/// <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); } }
/// <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> //[ClientPacketHandler((RealmServerOpCode.MSG_RAID_READY_CHECK)] public static void RaidReadyCheck(IRealmClient client, RealmPacketIn packet) { var chr = client.ActiveCharacter; var member = chr.GroupMember; if (member == null) { return; } var group = member.Group as RaidGroup; if (group == null) { return; } if (packet.RemainingLength == 0) // request for ready check { if (!group.CheckPrivs(member, GroupPrivs.Assistant)) { return; } group.SendReadyCheckRequest(member); } else // answer to ready check { //byte status = packet.ReadByte(); ReadyCheckStatus status = (ReadyCheckStatus)packet.ReadByte(); group.SendReadyCheckResponse(member, status); } }
/// <summary> /// Sends the response of a member to the original ready check requester. /// </summary> /// <param name="member">the responding member</param> /// <param name="status">their ready status</param> public void SendReadyCheckResponse(GroupMember member, ReadyCheckStatus status) { using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_RAID_READY_CHECK_CONFIRM)) { packet.Write(EntityId.GetPlayerId(member.Id)); packet.WriteByte((byte)status); Character checkRequester = World.GetCharacter(m_readyCheckRequester.Id); if (checkRequester != null) { checkRequester.Client.Send(packet, addEnd: false); } } }
/// <summary> /// Sends the response of a member to the original ready check requester. /// </summary> /// <param name="member">the responding member</param> /// <param name="status">their ready status</param> public void SendReadyCheckResponse(GroupMember member, ReadyCheckStatus status) { using (var packet = new RealmPacketOut(RealmServerOpCode.MSG_RAID_READY_CHECK_CONFIRM)) { packet.Write(EntityId.GetPlayerId(member.Id)); packet.WriteByte((byte)status); Character checkRequester = World.GetCharacter(m_readyCheckRequester.Id); if (checkRequester != null) checkRequester.Client.Send(packet); } }