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..87eeb136b0 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,50 @@ 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; + 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 +800,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 2cd3306733..07a64371ae 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/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; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index af0a227756..57ff002409 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(); @@ -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(); @@ -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/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 251d6b37cc..fb7ad789dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -561,13 +561,13 @@ 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 osGetLinkInventoryKeys(LSL_Integer linkNumber, LSL_Integer type); + LSL_List osGetInventoryItemKeys(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); @@ -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 56a44219bc..2fb00ce47a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -1461,22 +1461,21 @@ 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)] - 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)] @@ -1604,6 +1603,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() { diff --git a/bin/ScriptSyntax.xml b/bin/ScriptSyntax.xml index 0461263f1d..0adf4a5888 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 @@ -7318,7 +7318,7 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d nametypestring -osGetLinkInventoryKey +osGetLinkInventoryItemKey returnkey arguments @@ -7326,7 +7326,7 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d nametypestring - osGetInventoryKeys + osGetInventoryItemKeys returnlist arguments @@ -7370,7 +7370,7 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d typetypeinteger - osGetLinkInventoryKeys + osGetLinkInventoryItemKeys returnlist arguments @@ -7583,6 +7583,16 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d returnfloat arguments + osGetSitTargetPos + + returnvector + arguments + + osGetSitTargetRot + + returnrotation + arguments + osGetSittingAvatarsCount returninteger 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