From d9cc908471922a1239bb8a757e07084072852982 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 16 Aug 2008 19:20:14 +0000 Subject: Mantis#1965. Thank you kindly, HomerHorwitz for a patch that: Places touched: - Added two events for in-packets to LLCLientView: RegionHandleRequest and ParcelInfoRequest - Added sending of two out-packets to LLCLientView: RegionIDAndHandleReply and ParcelInfoReply. - Scene handles the RegionHandleRequest, LandManagementModule the ParcelInfoRequest - Added inter-region request for LandData by RegionHandle and local position. This was implemented as XML-RPC request. The returned LandData isn't complete, it only contains the data necessary for answering the ParcelInfoRequest - Added new CAPS (0009) for RemoteParcelRequest and some methods for LandData handling to LandManagementModule - Added methods for fake parcelID creation and parsing to Util - Fixed missing implementation of interface methods. - Added new file: OpenSim/Framework/Communications/Capabilities/LLSDRemoteParcelResponse.cs NOTE: This is part of the patch, too. Due to the many places touched, I would consider this patch as experimental. --- OpenSim/Framework/Util.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Framework/Util.cs') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index d72e03e..bc35fa6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -716,5 +716,24 @@ namespace OpenSim.Framework XmlRpcRequest client = new XmlRpcRequest(methodName, args); return client.Send(url, 6000); } + + // used for RemoteParcelRequest (for "About Landmark") + public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { + byte[] bytes = { + (byte)(regionHandle >> 56), (byte)(regionHandle >> 48), (byte)(regionHandle >> 40), (byte)(regionHandle >> 32), + (byte)(regionHandle >> 24), (byte)(regionHandle >> 16), (byte)(regionHandle >> 8), (byte)regionHandle, + (byte)(x >> 24), (byte)(x >> 16), (byte)(x >> 8), (byte)x, + (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y }; + return new LLUUID(bytes, 0); + } + + public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) { + byte[] bytes = parcelID.GetBytes(); + regionHandle = Helpers.BytesToUInt64(bytes); + x = Helpers.BytesToUInt(bytes, 8); + // grrr. I'd like to use that code in the next line, but libsl has an off-by-one bug here and returns 0. + //uint y = Helpers.BytesToUInt(bytes, 12); + y = (uint)((bytes[12] << 24) | (bytes[13] << 16) | (bytes[14] << 8) | bytes[15]); + } } } -- cgit v1.1