From d58f9f0f5d196e739b4b289b42bb9e488ecfc155 Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Sat, 24 Feb 2024 03:16:27 +0000 Subject: [PATCH 1/9] osGetSitTarget Signed-off-by: UbitUmarov --- .../Shared/Api/Implementation/OSSL_Api.cs | 10 ++++++++++ .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 12 ++++++++++++ bin/ScriptSyntax.xml | 12 +++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 76a859875c..001cacd591 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -5899,6 +5899,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return 0; } + public LSL_Vector osGetSitTargetPos() + { + return m_host.SitTargetPosition; + } + + public LSL_Rotation osGetSitTargetRot() + { + return m_host.SitTargetOrientation; + } + public void osSetSitActiveRange(LSL_Float v) { float fv = (float)v.value; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 56a44219bc..0b5afb59ad 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1568,6 +1568,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osIsNotValidNumber(v); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public vector osGetSitTargetPos() + { + return m_OSSL_Functions.osGetSitTargetPos(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public rotation osGetSitTargetRot() + { + return m_OSSL_Functions.osGetSitTargetRot(); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void osSetSitActiveRange(LSL_Float v) { diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 0461263f1d..0c2f7e57b4 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -1,4 +1,4 @@ -fc2639fd-5d16-66bf-d8ab-2e4d754c816d +3c8d15ee-d2ba-11ee-ae64-406c8fbbb495 llsd-lsl-syntax-version2 controls @@ -7583,6 +7583,16 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d returnfloat arguments + osGetSitTargetPos + + returnvector + arguments + + osGetSitTargetRot + + returnrotation + arguments + osGetSittingAvatarsCount returninteger From 97b03f76c795c1b70f51377d032ece7504bceff2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 29 Feb 2024 20:40:42 +0000 Subject: [PATCH 2/9] fix the last patch --- .../Shared/Api/Interface/IOSSL_Api.cs | 2 ++ .../Shared/Api/Runtime/OSSL_Stub.cs | 24 +++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 251d6b37cc..66ae67d916 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -585,6 +585,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osSetLinkSitActiveRange(LSL_Integer linkNumber, LSL_Float v); LSL_Float osGetSitActiveRange(); LSL_Float osGetLinkSitActiveRange(LSL_Integer linkNumber); + vector osGetSitTargetPos(); + rotation osGetSitTargetRot(); void osSetStandTarget(vector v); void osSetLinkStandTarget(LSL_Integer linkNumber, vector v); vector osGetStandTarget(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 0b5afb59ad..c04286d6e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1568,18 +1568,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osIsNotValidNumber(v); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public vector osGetSitTargetPos() - { - return m_OSSL_Functions.osGetSitTargetPos(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public rotation osGetSitTargetRot() - { - return m_OSSL_Functions.osGetSitTargetRot(); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public void osSetSitActiveRange(LSL_Float v) { @@ -1616,6 +1604,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osSetLinkStandTarget(linkNumber, v); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public vector osGetSitTargetPos() + { + return m_OSSL_Functions.osGetSitTargetPos(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public rotation osGetSitTargetRot() + { + return m_OSSL_Functions.osGetSitTargetRot(); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public vector osGetStandTarget() { From 52c287d8dcbc8fa6e15753b6f16aa31ce294323f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 4 Mar 2024 23:48:13 +0000 Subject: [PATCH 3/9] manits 9118: fix clear of animesh flag on *GetPrimitiveParams --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6dac7da75b..1f7443a27c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -11205,7 +11205,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (Shape.AnimeshEnabled) stype |= ScriptBaseClass.PRIM_SCULPT_FLAG_ANIMESH; else - stype &= ScriptBaseClass.PRIM_SCULPT_FLAG_ANIMESH; + stype &= ~ScriptBaseClass.PRIM_SCULPT_FLAG_ANIMESH; res.Add(new LSL_Integer(stype)); break; From c618c4a6c453c4403e0bb32f58532fde6c3cb5ca Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 5 Mar 2024 18:51:42 +0000 Subject: [PATCH 4/9] rename the new osGetInventoryKeys as osgetinventoryitemkeys and osgetlinkinventorykey as osgetinventoryitemkey for coerence and to make clear that key means the item key within prim inventory and not its asset key as in ll funtion --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 4 ++-- OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 4 ++-- bin/ScriptSyntax.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 001cacd591..81e6cb73b8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -5541,7 +5541,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return (item == null) ? LSL_String.Empty : item.Description; } - public LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name) + public LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name) { SceneObjectPart part = GetSingleLinkPart(linkNumber); if(part == null) @@ -5561,7 +5561,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return LSL_String.NullKey; } - public LSL_List osGetInventoryKeys(LSL_Integer type) + public LSL_List osGetInventoryItemKeys(LSL_Integer type) { LSL_List ret = new(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 66ae67d916..076a9f6107 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -561,12 +561,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_Integer osApproxEquals(rotation ra, rotation rb, LSL_Float margin); LSL_Key osGetInventoryLastOwner(LSL_String itemNameOrId); LSL_Key osGetInventoryItemKey(LSL_String name); - LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name); + LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name); LSL_String osGetInventoryName(LSL_Key itemId); LSL_String osGetLinkInventoryName(LSL_Integer linkNumber, LSL_Key itemId); LSL_String osGetInventoryDesc(LSL_String itemNameOrId); LSL_String osGetLinkInventoryDesc(LSL_Integer linkNumber, LSL_String itemNameorid); - LSL_List osGetInventoryKeys(LSL_Integer type); + LSL_List osGetInventoryItemKeys(LSL_Integer type); LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type); LSL_List osGetInventoryNames(LSL_Integer type); LSL_List osGetLinkInventoryNames(LSL_Integer linkNumber, LSL_Integer type); diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 0c2f7e57b4..94170c9d44 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -7318,7 +7318,7 @@ nametypestring -osGetLinkInventoryKey +osGetLinkInventoryItemKey returnkey arguments @@ -7326,7 +7326,7 @@ nametypestring - osGetInventoryKeys + osGetInventoryItemKeys returnlist arguments From f770fc8a0e5bcc2b83559109c7f6957cfefaff45 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 5 Mar 2024 18:52:48 +0000 Subject: [PATCH 5/9] missing file --- .../Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index c04286d6e3..fc816eb9fc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1461,16 +1461,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public LSL_Key osGetLinkInventoryKey(LSL_Integer linkNumber, LSL_String name) + public LSL_Key osGetLinkInventoryItemKey(LSL_Integer linkNumber, LSL_String name) { - return m_OSSL_Functions.osGetLinkInventoryKey(linkNumber, name); - + return m_OSSL_Functions.osGetLinkInventoryItemKey(linkNumber, name); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public LSL_List osGetInventoryKeys(LSL_Integer type) + public LSL_List osGetInventoryItemKeys(LSL_Integer type) { - return m_OSSL_Functions.osGetInventoryKeys(type); + return m_OSSL_Functions.osGetInventoryItemKeys(type); } [MethodImpl(MethodImplOptions.AggressiveInlining)] From 6afa7d564b3e1e2405b14975f915379771ebd524 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 5 Mar 2024 19:04:36 +0000 Subject: [PATCH 6/9] same for osGetLinkInventoryItemKeys --- .../Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 2 +- bin/ScriptSyntax.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 81e6cb73b8..ecef4ac1b2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -5579,7 +5579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ret; } - public LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type) + public LSL_List osGetLinkInventoryItemKeys(LSL_Integer linkNumber, LSL_Integer type) { LSL_List ret = new(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 076a9f6107..fb7ad789dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -567,7 +567,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_String osGetInventoryDesc(LSL_String itemNameOrId); LSL_String osGetLinkInventoryDesc(LSL_Integer linkNumber, LSL_String itemNameorid); LSL_List osGetInventoryItemKeys(LSL_Integer type); - LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type); + LSL_List osGetLinkInventoryItemKeys(LSL_Integer linkNumber, LSL_Integer type); LSL_List osGetInventoryNames(LSL_Integer type); LSL_List osGetLinkInventoryNames(LSL_Integer linkNumber, LSL_Integer type); void osRemoveLinkInventory(LSL_Integer linkNumber, LSL_String name); diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 94170c9d44..0adf4a5888 100644 --- a/bin/ScriptSyntax.xml +++ b/bin/ScriptSyntax.xml @@ -7370,7 +7370,7 @@ typetypeinteger - osGetLinkInventoryKeys + osGetLinkInventoryItemKeys returnlist arguments From 0d73a817ccc56df9f23c525d2086ef30c1d81b8c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 5 Mar 2024 20:21:41 +0000 Subject: [PATCH 7/9] oops --- OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index fc816eb9fc..2fb00ce47a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1473,9 +1473,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public LSL_List osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type) + public LSL_List osGetLinkInventoryItemKeys(LSL_Integer linkNumber, LSL_Integer type) { - return m_OSSL_Functions.osGetLinkInventoryKeys(linkNumber, type); + return m_OSSL_Functions.osGetLinkInventoryItemKeys(linkNumber, type); } [MethodImpl(MethodImplOptions.AggressiveInlining)] From 6905f1a71af60d03d4a9ef3cc38556fa42ba6645 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 10 Mar 2024 16:56:12 +0000 Subject: [PATCH 8/9] cosmetics --- .../Framework/Servers/BaseOpenSimServer.cs | 7 +- OpenSim/Framework/Servers/ServerBase.cs | 76 +++++++++---------- OpenSim/Framework/Util.cs | 3 +- prebuild.xml | 4 +- 4 files changed, 39 insertions(+), 51 deletions(-) diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 1309351e2b..1ae12a24bd 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -180,11 +180,8 @@ namespace OpenSim.Framework.Servers m_log.Info("[STARTUP]: Beginning startup processing"); m_log.Info("[STARTUP]: version: " + m_version); - m_log.InfoFormat("[STARTUP]: Operating system version: {0}, .NET platform {1}, Runtime {2}", - Environment.OSVersion, Util.RuntimePlatformStr, Environment.Version.ToString()); - m_log.InfoFormat("[STARTUP]: Processor Architecture: {0}({1} {2}bit)", - RuntimeInformation.ProcessArchitecture.ToString(), - BitConverter.IsLittleEndian ?"le":"be", Environment.Is64BitProcess ? "64" : "32"); + m_log.Info($"[STARTUP]: Operating system version: {Environment.OSVersion}, .NET platform {Util.RuntimePlatformStr}, Runtime {Environment.Version}"); + m_log.Info($"[STARTUP]: Processor Architecture: {RuntimeInformation.ProcessArchitecture}({(BitConverter.IsLittleEndian ? "le" : "be")} {(Environment.Is64BitProcess ? "64" : "32")}bit)"); try { StartupSpecific(); diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 9eb653e900..79f9abc099 100755 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -82,9 +82,7 @@ namespace OpenSim.Framework.Servers protected void CreatePIDFile(string path) { if (File.Exists(path)) - m_log.ErrorFormat( - "[SERVER BASE]: Previous pid file {0} still exists on startup. Possibly previously unclean shutdown.", - path); + m_log.Error($"[SERVER BASE]: Previous pid file {path} still exists on startup. Possibly previously unclean shutdown."); try { @@ -108,7 +106,7 @@ namespace OpenSim.Framework.Servers protected void RemovePIDFile() { - if (m_pidFile != String.Empty) + if (!string.IsNullOrEmpty(m_pidFile)) { try { @@ -116,7 +114,7 @@ namespace OpenSim.Framework.Servers } catch (Exception e) { - m_log.Error(string.Format("[SERVER BASE]: Error whilst removing {0} ", m_pidFile), e); + m_log.Error($"[SERVER BASE]: Error whilst removing {m_pidFile}", e); } m_pidFile = String.Empty; @@ -131,16 +129,15 @@ namespace OpenSim.Framework.Servers { // FIXME: This should be done down in ServerBase but we need to sort out and refactor the log4net // XmlConfigurator calls first accross servers. - m_log.InfoFormat("[SERVER BASE]: Starting in {0}", m_startupDirectory); + m_log.Info($"[SERVER BASE]: Starting in {m_startupDirectory}"); - m_log.InfoFormat("[SERVER BASE]: OpenSimulator version: {0}", m_version); + m_log.Info($"[SERVER BASE]: OpenSimulator version: {m_version}"); // clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and // the clr version number doesn't match the project version number under Mono. //m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine); - m_log.InfoFormat( - "[SERVER BASE]: Operating system version: {0}, .NET platform {1}, {2}-bit", - Environment.OSVersion, Util.RuntimePlatformStr, Environment.Is64BitProcess ? "64" : "32"); + m_log.Info( + $"[SERVER BASE]: Operating system version: {Environment.OSVersion}, .NET platform {Util.RuntimePlatformStr}, {(Environment.Is64BitProcess ? "64" : "32")}-bit"); } public void RegisterCommonAppenders(IConfig startupConfig) @@ -298,11 +295,11 @@ namespace OpenSim.Framework.Servers + " 3 = full stack trace, including common threads\n", HandleDebugThreadpoolLevel); -// m_console.Commands.AddCommand( -// "Debug", false, "show threadpool calls active", -// "show threadpool calls active", -// "Show details about threadpool calls that are still active (currently waiting or in progress)", -// HandleShowThreadpoolCallsActive); + //m_console.Commands.AddCommand( + // "Debug", false, "show threadpool calls active", + // "show threadpool calls active", + // "Show details about threadpool calls that are still active (currently waiting or in progress)", + // HandleShowThreadpoolCallsActive); m_console.Commands.AddCommand( "Debug", false, "show threadpool calls complete", @@ -334,7 +331,7 @@ namespace OpenSim.Framework.Servers public void RegisterCommonComponents(IConfigSource configSource) { -// IConfig networkConfig = configSource.Configs["Network"]; + //IConfig networkConfig = configSource.Configs["Network"]; m_serverStatsCollector = new ServerStatsCollector(); m_serverStatsCollector.Initialise(configSource); @@ -417,9 +414,7 @@ namespace OpenSim.Framework.Servers return; } - int newThreads; - - if (!ConsoleUtil.TryParseConsoleInt(m_console, args[5], out newThreads)) + if (!ConsoleUtil.TryParseConsoleInt(m_console, args[5], out int newThreads)) return; string poolType = args[3]; @@ -469,10 +464,8 @@ namespace OpenSim.Framework.Servers } else { - int minWorkerThreads, maxWorkerThreads, minIocpThreads, maxIocpThreads; - - ThreadPool.GetMinThreads(out minWorkerThreads, out minIocpThreads); - ThreadPool.GetMaxThreads(out maxWorkerThreads, out maxIocpThreads); + ThreadPool.GetMinThreads(out int minWorkerThreads, out int minIocpThreads); + ThreadPool.GetMaxThreads(out int maxWorkerThreads, out int maxIocpThreads); Notice("Min worker threads now {0}", minWorkerThreads); Notice("Min IOCP threads now {0}", minIocpThreads); @@ -756,48 +749,48 @@ namespace OpenSim.Framework.Servers /// protected void EnhanceVersionInformation() { + const string manualVersionFileName = ".version"; string buildVersion = string.Empty; - string manualVersionFileName = ".version"; - - string gitDir = "../.git/"; - string gitRefPointerPath = gitDir + "HEAD"; - if (File.Exists(manualVersionFileName)) { using (StreamReader CommitFile = File.OpenText(manualVersionFileName)) buildVersion = CommitFile.ReadLine(); - m_version += buildVersion ?? ""; + if (!string.IsNullOrEmpty(buildVersion)) + m_version += buildVersion[..7]; + return; } - else if (File.Exists(gitRefPointerPath)) + + string gitDir = Path.Combine("..", ".git"); + string gitRefPointerPath = Path.Combine(gitDir, "HEAD"); + if (File.Exists(gitRefPointerPath)) { -// m_log.DebugFormat("[SERVER BASE]: Found {0}", gitRefPointerPath); + //m_log.DebugFormat("[SERVER BASE]: Found {0}", gitRefPointerPath); string rawPointer = ""; using (StreamReader pointerFile = File.OpenText(gitRefPointerPath)) rawPointer = pointerFile.ReadLine(); -// m_log.DebugFormat("[SERVER BASE]: rawPointer [{0}]", rawPointer); + //m_log.DebugFormat("[SERVER BASE]: rawPointer [{0}]", rawPointer); Match m = Regex.Match(rawPointer, "^ref: (.+)$"); if (m.Success) { -// m_log.DebugFormat("[SERVER BASE]: Matched [{0}]", m.Groups[1].Value); + //m_log.DebugFormat("[SERVER BASE]: Matched [{0}]", m.Groups[1].Value); string gitRef = m.Groups[1].Value; - string gitRefPath = gitDir + gitRef; + string gitRefPath = Path.Combine(gitDir, gitRef); if (File.Exists(gitRefPath)) { -// m_log.DebugFormat("[SERVER BASE]: Found gitRefPath [{0}]", gitRefPath); - + //m_log.DebugFormat("[SERVER BASE]: Found gitRefPath [{0}]", gitRefPath); using (StreamReader refFile = File.OpenText(gitRefPath)) - { - string gitHash = refFile.ReadLine(); - m_version += gitHash.Substring(0, 7); - } + buildVersion = refFile.ReadLine(); + + if (!string.IsNullOrEmpty(buildVersion)) + m_version += buildVersion[..7]; } } } @@ -805,8 +798,7 @@ namespace OpenSim.Framework.Servers public string GetVersionText() { - return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})", - m_version, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax); + return $"Version: {m_version} (SIM-{VersionInfo.SimulationServiceVersionSupportedMin}/{VersionInfo.SimulationServiceVersionSupportedMax})"; } /// diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 62fd51a994..aa5755661c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1476,8 +1476,7 @@ namespace OpenSim.Framework using MemoryStream memoryStream = new(buffer); using CryptoStream cryptoStream = new(memoryStream, decryptor, CryptoStreamMode.Read); using StreamReader streamReader = new(cryptoStream); - - //string ret = streamReader.ReadToEnd(); + return streamReader.ReadToEnd(); } diff --git a/prebuild.xml b/prebuild.xml index 83231af184..f324aea385 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -10,7 +10,7 @@ true 4 false - CA1416,SYSLIB0011,SYSLIB0014 + CA1416,SYSLIB0011,SYSLIB0014,SYSLIB0039 bin true true @@ -28,7 +28,7 @@ true 4 false - CA1416,SYSLIB0011,SYSLIB0014 + CA1416,SYSLIB0011,SYSLIB0014,SYSLIB0039 bin false true From b70b5c07e3d0e32f28122be2b5e3d9d5c1f4b6a0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 11 Mar 2024 00:18:05 +0000 Subject: [PATCH 9/9] revert to append all contents of .version file on the full version, if present and not empty --- OpenSim/Framework/Servers/ServerBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index 79f9abc099..87eeb136b0 100755 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -758,8 +758,10 @@ namespace OpenSim.Framework.Servers buildVersion = CommitFile.ReadLine(); if (!string.IsNullOrEmpty(buildVersion)) - m_version += buildVersion[..7]; - return; + { + m_version += buildVersion; + return; + } } string gitDir = Path.Combine("..", ".git");