diff options
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index de42bf8..427832d 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -727,6 +727,21 @@ namespace OpenSim.Framework | |||
727 | return client.Send(url, 6000); | 727 | return client.Send(url, 6000); |
728 | } | 728 | } |
729 | 729 | ||
730 | /// <summary> | ||
731 | /// Converts a byte array in big endian order into an ulong. | ||
732 | /// </summary> | ||
733 | /// <param name="bytes"> | ||
734 | /// The array of bytes | ||
735 | /// </param> | ||
736 | /// <returns> | ||
737 | /// The extracted ulong | ||
738 | /// </returns> | ||
739 | public static ulong BytesToUInt64Big(byte[] bytes) { | ||
740 | if(bytes.Length < 8) return 0; | ||
741 | return ((ulong)bytes[0] << 56) | ((ulong)bytes[1] << 48) | ((ulong)bytes[2] << 40) | ((ulong)bytes[3] << 32) | | ||
742 | ((ulong)bytes[4] << 24) | ((ulong)bytes[5] << 16) | ((ulong)bytes[6] << 8) | (ulong)bytes[7]; | ||
743 | } | ||
744 | |||
730 | // used for RemoteParcelRequest (for "About Landmark") | 745 | // used for RemoteParcelRequest (for "About Landmark") |
731 | public static UUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { | 746 | public static UUID BuildFakeParcelID(ulong regionHandle, uint x, uint y) { |
732 | byte[] bytes = { | 747 | byte[] bytes = { |