/// <summary>Process an incoming packet and raise the appropriate events</summary> /// <param name="sender">The sender</param> /// <param name="e">The EventArgs object containing the packet data</param> private void TerminateFriendshipHandler(object sender, PacketReceivedEventArgs e) { Packet packet = e.Packet; TerminateFriendshipPacket itsOver = (TerminateFriendshipPacket)packet; string name = String.Empty; if (FriendList.ContainsKey(itsOver.ExBlock.OtherID)) { name = FriendList[itsOver.ExBlock.OtherID].Name; FriendList.Remove(itsOver.ExBlock.OtherID); } if (m_FriendshipTerminated != null) { OnFriendshipTerminated(new FriendshipTerminatedEventArgs(itsOver.ExBlock.OtherID, name)); } }
/// <summary> /// Terminate a friendship with an avatar /// </summary> /// <param name="agentID">System ID of the avatar you are terminating the friendship with</param> public void TerminateFriendship(UUID agentID) { if (FriendList.ContainsKey(agentID)) { TerminateFriendshipPacket request = new TerminateFriendshipPacket(); request.AgentData.AgentID = Client.Self.AgentID; request.AgentData.SessionID = Client.Self.SessionID; request.ExBlock.OtherID = agentID; Client.Network.SendPacket(request); if (FriendList.ContainsKey(agentID)) { FriendList.Remove(agentID); } } }
public Packet ItsOver(Packet packet, IPEndPoint sim) { if (form.getEnabled()) { TerminateFriendshipPacket tp = (TerminateFriendshipPacket)packet; //UUIDNameRequest = 65771, //UUIDNameReply = 65772, currentBastard = tp.ExBlock.OtherID; UUIDNameRequestPacket nr = new UUIDNameRequestPacket(); UUIDNameRequestPacket.UUIDNameBlockBlock[] temp = new UUIDNameRequestPacket.UUIDNameBlockBlock[1]; temp[0] = new UUIDNameRequestPacket.UUIDNameBlockBlock(); temp[0].ID = currentBastard; nr.UUIDNameBlock = temp; proxy.InjectPacket(nr, Direction.Outgoing); } return(packet); }
/// <summary> /// Fired when another friend terminates friendship. We need to remove them from /// our cached list. /// </summary> /// <param name="packet"></param> /// <param name="simulator"></param> private void TerminateFriendshipHandler(Packet packet, Simulator simulator) { TerminateFriendshipPacket itsOver = (TerminateFriendshipPacket)packet; string name = String.Empty; lock (FriendList) { if (FriendList.ContainsKey(itsOver.ExBlock.OtherID)) { name = FriendList[itsOver.ExBlock.OtherID].Name; FriendList.Remove(itsOver.ExBlock.OtherID); } } if (OnFriendshipTerminated != null) { OnFriendshipTerminated(itsOver.ExBlock.OtherID, name); } }
/// <summary> /// Terminate a friendship with an avatar /// </summary> /// <param name="agentID">System ID of the avatar you are terminating the friendship with</param> public void TerminateFriendship(UUID agentID) { if (FriendList.ContainsKey(agentID)) { TerminateFriendshipPacket request = new TerminateFriendshipPacket(); request.AgentData.AgentID = Client.Self.AgentID; request.AgentData.SessionID = Client.Self.SessionID; request.ExBlock.OtherID = agentID; Client.Network.SendPacket(request); if (FriendList.ContainsKey(agentID)) FriendList.Remove(agentID); } }
/// <summary> /// Revokes friendship from the specified user /// </summary> public void RemoveFriend(LLUUID targetID) { TerminateFriendshipPacket p = new TerminateFriendshipPacket(); p.AgentData.AgentID = Client.Network.AgentID; p.AgentData.SessionID = Client.Network.SessionID; p.ExBlock.OtherID = targetID; Client.Network.SendPacket(p); }