From 3465447e17d073e8f59d38edc82b80384e15d5ce Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Fri, 6 Feb 2009 09:58:23 +0000 Subject: more eventqueue endian madness --- .../Modules/Framework/EventQueue/EventQueueHelper.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Framework/EventQueue') diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs index 337d73d..546d9d1 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs @@ -55,15 +55,11 @@ namespace OpenSim.Region.Environment private static byte[] uintToByteArray(uint uIntValue) { - // Reverse endianness of a uint - return new byte[] - { - (byte)((uIntValue >> 24) % 256), - (byte)((uIntValue >> 16) % 256), - (byte)((uIntValue >> 8) % 256), - (byte)(uIntValue % 256) + byte[] resultbytes = Utils.UIntToBytes(uIntValue); + if (BitConverter.IsLittleEndian) + Array.Reverse(resultbytes); - }; + return resultbytes; } public static OSD buildEvent(string eventName, OSD eventBody) @@ -359,7 +355,7 @@ namespace OpenSim.Region.Environment parcelDataMap.Add("AABBMin", AABBMin); parcelDataMap.Add("Area", OSD.FromInteger(parcelPropertiesPacket.ParcelData.Area)); - parcelDataMap.Add("AuctionID", OSD.FromBinary(parcelPropertiesPacket.ParcelData.AuctionID)); + parcelDataMap.Add("AuctionID", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.AuctionID))); parcelDataMap.Add("AuthBuyerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.AuthBuyerID)); parcelDataMap.Add("Bitmap", OSD.FromBinary(parcelPropertiesPacket.ParcelData.Bitmap)); parcelDataMap.Add("Category", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Category)); -- cgit v1.1