From 1463691cb6d022efbb2a0c5742a032f03a940cee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 Aug 2010 00:48:12 +0100 Subject: In EventQueueHelper.uintToByteArray, fetch big end-ian bytes directly from libomv rather than little endian then swapping This avoids a problem with failing to swap on big-endian machines. This addresses http://opensimulator.org/mantis/view.php?id=4849 Thanks to Valy- for pointing this out and submitting a suggestion patch --- .../CoreModules/Framework/EventQueue/EventQueueHelper.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs index efa60bb..53a2a7d 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs @@ -54,12 +54,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue } private static byte[] uintToByteArray(uint uIntValue) - { - byte[] resultbytes = Utils.UIntToBytes(uIntValue); - if (BitConverter.IsLittleEndian) - Array.Reverse(resultbytes); - - return resultbytes; + { + byte[] result = new byte[4]; + Utils.UIntToBytesBig(uIntValue, result, 0); + return result; } public static OSD buildEvent(string eventName, OSD eventBody) -- cgit v1.1