aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs19
1 files changed, 19 insertions, 0 deletions
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
716 XmlRpcRequest client = new XmlRpcRequest(methodName, args); 716 XmlRpcRequest client = new XmlRpcRequest(methodName, args);
717 return client.Send(url, 6000); 717 return client.Send(url, 6000);
718 } 718 }
719
720 // used for RemoteParcelRequest (for "About Landmark")
721 public static LLUUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) {
722 byte[] bytes = {
723 (byte)(regionHandle >> 56), (byte)(regionHandle >> 48), (byte)(regionHandle >> 40), (byte)(regionHandle >> 32),
724 (byte)(regionHandle >> 24), (byte)(regionHandle >> 16), (byte)(regionHandle >> 8), (byte)regionHandle,
725 (byte)(x >> 24), (byte)(x >> 16), (byte)(x >> 8), (byte)x,
726 (byte)(y >> 24), (byte)(y >> 16), (byte)(y >> 8), (byte)y };
727 return new LLUUID(bytes, 0);
728 }
729
730 public static void ParseFakeParcelID(LLUUID parcelID, out ulong regionHandle, out uint x, out uint y) {
731 byte[] bytes = parcelID.GetBytes();
732 regionHandle = Helpers.BytesToUInt64(bytes);
733 x = Helpers.BytesToUInt(bytes, 8);
734 // grrr. I'd like to use that code in the next line, but libsl has an off-by-one bug here and returns 0.
735 //uint y = Helpers.BytesToUInt(bytes, 12);
736 y = (uint)((bytes[12] << 24) | (bytes[13] << 16) | (bytes[14] << 8) | bytes[15]);
737 }
719 } 738 }
720} 739}