From 13e3ffada36529bd64909d272b4e25145c26e4c8 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 5 Oct 2008 02:25:53 +0000 Subject: [PATCH] Plumb in the DirPlacesReply packet --- OpenSim/Framework/IClientAPI.cs | 11 +++++++ .../ClientStack/LindenUDP/LLClientView.cs | 31 +++++++++++++++++++ .../Modules/World/NPC/NPCAvatar.cs | 4 +++ .../Examples/SimpleModule/MyNpcCharacter.cs | 4 +++ 4 files changed, 50 insertions(+) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 2ae66e46ba..c0d133e8e6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -312,6 +312,15 @@ namespace OpenSim.Framework public delegate void DirPlacesQuery(IClientAPI remoteClient, UUID queryID, string queryText, int queryFlags, int category, string simName, int queryStart); #endregion + public struct DirPlacesReplyData + { + public UUID parcelID; + public string name; + public bool forSale; + public bool auction; + public float dwell; + } + public interface IClientAPI { Vector3 StartPos { get; set; } @@ -764,6 +773,8 @@ namespace OpenSim.Framework void SendRegionHandle(UUID regoinID, ulong handle); void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y); void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt); + + void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data); void KillEndDone(); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5d7a1caf27..2cb33d0e7f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -6725,6 +6725,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP return string.Empty; } + public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data) + { + DirPlacesReplyPacket packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply); + + packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock(); + + packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; + packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); + + packet.QueryReplies = + new DirPlacesReplyPacket.QueryRepliesBlock[data.Length]; + + packet.AgentData.AgentID = AgentId; + + packet.QueryData[0].QueryID = queryID; + + int i = 0; + foreach (DirPlacesReplyData d in data) + { + packet.QueryReplies[i] = + new DirPlacesReplyPacket.QueryRepliesBlock(); + packet.QueryReplies[i].ParcelID = d.parcelID; + packet.QueryReplies[i].Name = Utils.StringToBytes(d.name); + packet.QueryReplies[i].ForSale = d.forSale; + packet.QueryReplies[i].Auction = d.auction; + packet.QueryReplies[i].Dwell = d.dwell; + } + + OutPacket(packet, ThrottleOutPacketType.Task); + } + public void KillEndDone() { KillPacket kp = new KillPacket(); diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index c1904346a2..99c953cabb 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -891,6 +891,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } + public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data) + { + } + public void KillEndDone() { } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 1566b2efee..6fbab0ac23 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -888,6 +888,10 @@ namespace OpenSim.Region.Examples.SimpleModule { } + public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data) + { + } + public void KillEndDone() { }