From 1ee10d919aae59e8b97b7f24dff14a16cb50e8df Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sun, 19 Oct 2008 16:49:10 +0000 Subject: Added calling cards. Fixes Mantis#2409 and part of #1515. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 412f969..19983dc 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1009,6 +1009,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event MapItemRequest OnMapItemRequest; + public event OfferCallingCard OnOfferCallingCard; + public event AcceptCallingCard OnAcceptCallingCard; + public event DeclineCallingCard OnDeclineCallingCard; + // voire si c'est necessaire public void ActivateGesture(UUID assetId, UUID gestureId) { @@ -6447,6 +6451,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP parcelSetOtherCleanTimePacket.ParcelData.OtherCleanTime); } break; + + case PacketType.OfferCallingCard: + OfferCallingCardPacket offerCallingCardPacket = (OfferCallingCardPacket)Pack; + if (OnOfferCallingCard != null) + { + OnOfferCallingCard(this, + offerCallingCardPacket.AgentBlock.DestID, + offerCallingCardPacket.AgentBlock.TransactionID); + } + break; + + case PacketType.AcceptCallingCard: + AcceptCallingCardPacket acceptCallingCardPacket = (AcceptCallingCardPacket)Pack; + // according to http://wiki.secondlife.com/wiki/AcceptCallingCard FolderData should + // contain exactly one entry + if (OnAcceptCallingCard != null && acceptCallingCardPacket.FolderData.Length > 0) + { + OnAcceptCallingCard(this, + acceptCallingCardPacket.TransactionBlock.TransactionID, + acceptCallingCardPacket.FolderData[0].FolderID); + } + break; + + case PacketType.DeclineCallingCard: + DeclineCallingCardPacket declineCallingCardPacket = (DeclineCallingCardPacket)Pack; + if (OnDeclineCallingCard != null) + { + OnDeclineCallingCard(this, + declineCallingCardPacket.TransactionBlock.TransactionID); + } + break; + default: m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); break; @@ -7161,6 +7197,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP } + public void SendOfferCallingCard(UUID srcID, UUID transactionID) + { + // a bit special, as this uses AgentID to store the source instead + // of the destination. The destination (the receiver) goes into destID + OfferCallingCardPacket p = (OfferCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.OfferCallingCard); + p.AgentData.AgentID = srcID; + p.AgentData.SessionID = UUID.Zero; + p.AgentBlock.DestID = AgentId; + p.AgentBlock.TransactionID = transactionID; + OutPacket(p, ThrottleOutPacketType.Task); + } + + public void SendAcceptCallingCard(UUID transactionID) + { + AcceptCallingCardPacket p = (AcceptCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.AcceptCallingCard); + p.AgentData.AgentID = AgentId; + p.AgentData.SessionID = UUID.Zero; + p.FolderData = new AcceptCallingCardPacket.FolderDataBlock[1]; + p.FolderData[0] = new AcceptCallingCardPacket.FolderDataBlock(); + p.FolderData[0].FolderID = UUID.Zero; + OutPacket(p, ThrottleOutPacketType.Task); + } + + public void SendDeclineCallingCard(UUID transactionID) + { + DeclineCallingCardPacket p = (DeclineCallingCardPacket)PacketPool.Instance.GetPacket(PacketType.DeclineCallingCard); + p.AgentData.AgentID = AgentId; + p.AgentData.SessionID = UUID.Zero; + p.TransactionBlock.TransactionID = transactionID; + OutPacket(p, ThrottleOutPacketType.Task); + } + public void KillEndDone() { KillPacket kp = new KillPacket(); -- cgit v1.1