From b112109d2cd11742d0f81600409d26c3f37f1edb Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Mon, 26 Jan 2009 20:06:31 +0000 Subject: [PATCH] swap endianness of parcel flags in event queue message --- .../Framework/EventQueue/EventQueueHelper.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs index e9303af775..b6a6ac1315 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueue/EventQueueHelper.cs @@ -53,6 +53,19 @@ 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) + + }; + } + public static OSD buildEvent(string eventName, OSD eventBody) { OSDMap llsdEvent = new OSDMap(2); @@ -363,7 +376,7 @@ namespace OpenSim.Region.Environment parcelDataMap.Add("OtherPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherPrims)); parcelDataMap.Add("OwnerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.OwnerID)); parcelDataMap.Add("OwnerPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OwnerPrims)); - parcelDataMap.Add("ParcelFlags", OSD.FromBinary(parcelPropertiesPacket.ParcelData.ParcelFlags)); + parcelDataMap.Add("ParcelFlags", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.ParcelFlags))); parcelDataMap.Add("ParcelPrimBonus", OSD.FromReal(parcelPropertiesPacket.ParcelData.ParcelPrimBonus)); parcelDataMap.Add("PassHours", OSD.FromReal(parcelPropertiesPacket.ParcelData.PassHours)); parcelDataMap.Add("PassPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PassPrice));