From b85a29d1b8d7e50361a3cbb5bfd2350ef11cbfea Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 6 Sep 2008 23:08:08 +0000 Subject: [PATCH] Mantis#2136. Thank you kindly, HomerHorwitz for a patch that: libomv corrected the endianess of some Helper methods, which broke the fake parcelID computation for "About Landmark". The attached patch fixes this. --- OpenSim/Framework/Util.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index d7dcf196a2..de42bf8d51 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -730,10 +730,10 @@ namespace OpenSim.Framework // used for RemoteParcelRequest (for "About Landmark") public static UUID 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 }; + (byte)regionHandle, (byte)(regionHandle >> 8), (byte)(regionHandle >> 16), (byte)(regionHandle >> 24), + (byte)(regionHandle >> 32), (byte)(regionHandle >> 40), (byte)(regionHandle >> 48), (byte)(regionHandle << 56), + (byte)x, (byte)(x >> 8), (byte)(x >> 16), (byte)(x >> 24), + (byte)y, (byte)(y >> 8), (byte)(y >> 16), (byte)(y >> 24) }; return new UUID(bytes, 0); } @@ -741,9 +741,7 @@ namespace OpenSim.Framework 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]); + y = Helpers.BytesToUInt(bytes, 12); } } }