From 2cb2bff9b2ab68c325b0142da0b37730be9a12a3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 30 Dec 2010 00:31:59 +0100 Subject: [PATCH] Implement SendPlacesReply --- .../Client/MXP/ClientStack/MXPClientView.cs | 4 ++ .../VWoHTTP/ClientStack/VWHClientView.cs | 4 ++ OpenSim/Framework/IClientAPI.cs | 19 +++++++ .../ClientStack/LindenUDP/LLClientView.cs | 54 +++++++++++++++++++ .../Examples/SimpleModule/MyNpcCharacter.cs | 4 ++ .../Server/IRCClientView.cs | 4 ++ .../OptionalModules/World/NPC/NPCAvatar.cs | 4 ++ OpenSim/Tests/Common/Mock/TestClient.cs | 4 ++ 8 files changed, 97 insertions(+) diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 1f6dc5f71a..302f7aeb59 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -1735,5 +1735,9 @@ namespace OpenSim.Client.MXP.ClientStack public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index 8a49c6297a..ba6456b571 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -1229,5 +1229,9 @@ namespace OpenSim.Client.VWoHTTP.ClientStack public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index ea081e2ef5..3f7709296d 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -587,6 +587,23 @@ namespace OpenSim.Framework } } + public class PlacesReplyData + { + public UUID OwnerID; + public string Name; + public string Desc; + public int ActualArea; + public int BillableArea; + public byte Flags; + public uint GlobalX; + public uint GlobalY; + public uint GlobalZ; + public string SimName; + public UUID SnapshotID; + public uint Dwell; + public int Price; + } + /// /// Specifies the fields that have been changed when sending a prim or /// avatar update @@ -1321,5 +1338,7 @@ namespace OpenSim.Framework void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId); void StopFlying(ISceneEntity presence); + + void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data); } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 59132464d9..e416d057b9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -12088,7 +12088,61 @@ namespace OpenSim.Region.ClientStack.LindenUDP //ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, // AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); + } + public void SendPlacesReply(UUID queryID, UUID transactionID, + PlacesReplyData[] data) + { + PlacesReplyPacket reply = null; + PlacesReplyPacket.QueryDataBlock[] dataBlocks = + new PlacesReplyPacket.QueryDataBlock[0]; + + for (int i = 0 ; i < data.Length ; i++) + { + PlacesReplyPacket.QueryDataBlock block = + new PlacesReplyPacket.QueryDataBlock(); + + block.OwnerID = data[i].OwnerID; + block.Name = Util.StringToBytes256(data[i].Name); + block.Desc = Util.StringToBytes1024(data[i].Desc); + block.ActualArea = data[i].ActualArea; + block.BillableArea = data[i].BillableArea; + block.Flags = data[i].Flags; + block.GlobalX = data[i].GlobalX; + block.GlobalY = data[i].GlobalY; + block.GlobalZ = data[i].GlobalZ; + block.SimName = Util.StringToBytes256(data[i].SimName); + block.SnapshotID = data[i].SnapshotID; + block.Dwell = data[i].Dwell; + block.Price = data[i].Price; + + if (reply != null && reply.Length + block.Length > 1400) + { + OutPacket(reply, ThrottleOutPacketType.Task); + + reply = null; + dataBlocks = new PlacesReplyPacket.QueryDataBlock[0]; + } + + if (reply == null) + { + reply = (PlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.PlacesReply); + reply.AgentData = new PlacesReplyPacket.AgentDataBlock(); + reply.AgentData.AgentID = AgentId; + reply.AgentData.QueryID = queryID; + + reply.TransactionData = new PlacesReplyPacket.TransactionDataBlock(); + reply.TransactionData.TransactionID = transactionID; + + reply.QueryData = dataBlocks; + } + + Array.Resize(ref dataBlocks, dataBlocks.Length + 1); + dataBlocks[dataBlocks.Length - 1] = block; + reply.QueryData = dataBlocks; + } + if (reply != null) + OutPacket(reply, ThrottleOutPacketType.Task); } } } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index a6e2c03552..5151bf0271 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -1170,5 +1170,9 @@ namespace OpenSim.Region.Examples.SimpleModule public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 75f64418cc..e2574e7ac1 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -1692,5 +1692,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 51949b4b3b..1ce3791232 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -1175,5 +1175,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } } diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 69a152f6ab..147571bfa4 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -1229,5 +1229,9 @@ namespace OpenSim.Tests.Common.Mock public void StopFlying(ISceneEntity presence) { } + + public void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data) + { + } } }