diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index f95f573bf8..7e3da18f5c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2658,7 +2658,7 @@ namespace OpenSim.Framework /// /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static byte[] StringToBytes256(string str) + public static byte[] StringToBytes256(ReadOnlySpan str) { return Utils.StringToBytes(str, 255); } @@ -2689,7 +2689,7 @@ namespace OpenSim.Framework /// /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static byte[] StringToBytes1024(string str) + public static byte[] StringToBytes1024(ReadOnlySpan str) { return Utils.StringToBytes(str, 1024); } @@ -2720,26 +2720,26 @@ namespace OpenSim.Framework /// /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static byte[] StringToBytes(string str, int MaxLength) + public static byte[] StringToBytes(ReadOnlySpan str, int MaxLength) { return Utils.StringToBytes(str, MaxLength); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static byte[] StringToBytesNoTerm(string str, int MaxLength) + public static byte[] StringToBytesNoTerm(ReadOnlySpan str, int MaxLength) { return Utils.StringToBytesNoTerm(str, MaxLength); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int osUTF8Getbytes(string srcstr, byte[] dstarray, int maxdstlen, bool NullTerm = true) + public static int osUTF8Getbytes(ReadOnlySpan srcstr, byte[] dstarray, int maxdstlen, bool NullTerm = true) { return osUTF8Getbytes(srcstr, dstarray, 0, maxdstlen, NullTerm); } - public static unsafe int osUTF8Getbytes(string srcstr, byte* dstarray, int maxdstlen, bool NullTerm = true) + public static unsafe int osUTF8Getbytes(ReadOnlySpan srcstr, byte* dstarray, int maxdstlen, bool NullTerm = true) { - if (string.IsNullOrEmpty(srcstr)) + if (srcstr.Length == 0) return 0; fixed (char* srcbase = srcstr) @@ -2748,9 +2748,9 @@ namespace OpenSim.Framework } } - public static unsafe int osUTF8Getbytes(string srcstr, byte[] dstarray, int pos, int maxdstlen, bool NullTerm = true) + public static unsafe int osUTF8Getbytes(ReadOnlySpan srcstr, byte[] dstarray, int pos, int maxdstlen, bool NullTerm = true) { - if (string.IsNullOrEmpty(srcstr)) + if (srcstr.Length == 0) return 0; if (pos + maxdstlen > dstarray.Length) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetHandlers.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetHandlers.cs index 21f999bec5..131ce0d2dd 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetHandlers.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetHandlers.cs @@ -424,9 +424,8 @@ namespace OpenSim.Region.ClientStack.Linden LLSDxmlEncode2.AddEndMapAndArray(sb); LLSDxmlEncode2.AddRawElem("FolderDataFolderID00000000-0000-0000-0000-000000000000NameParentID00000000-0000-0000-0000-000000000000Type-1",sb); - - osUTF8 osName = new osUTF8(Utils.StringToBytesNoTerm(item.Name, 255)); - osUTF8 osDesc = new osUTF8(Utils.StringToBytesNoTerm(item.Description, 255)); + osUTF8 osName = new osUTF8(item.Name, 255); + osUTF8 osDesc = new osUTF8(item.Description, 255); LLSDxmlEncode2.AddArray("ItemData", sb); LLSDxmlEncode2.AddMap(sb); diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 937236664f..388598e363 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -26,22 +26,12 @@ */ using System; -using System.Xml; -using System.Collections.Generic; -using System.Reflection; -using System.Threading; -using System.Timers; -using Timer = System.Timers.Timer; using OpenMetaverse; using OpenMetaverse.StructuredData; -using log4net; +//using log4net; using Nini.Config; using OpenSim.Framework; -using OpenSim.Framework.Client; -using OpenSim.Framework.Monitoring; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes.Types; -using OpenSim.Services.Interfaces; + namespace OpenSim.Region.Framework.Scenes { diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index 1c0bbefa4c..b987e5b35e 100755 Binary files a/bin/OpenMetaverse.Rendering.Meshmerizer.dll and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index a1d66f4c0a..0115602b4d 100755 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index f047f01421..04c04ca6f2 100755 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 1ef6e2cfcf..39133f8fed 100755 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ