Merge branch 'opensim:master' into master

This commit is contained in:
AdilElFarissi
2024-03-19 21:50:59 +00:00
committed by GitHub
9 changed files with 92 additions and 69 deletions

View File

@@ -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();

View File

@@ -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
/// </summary>
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})";
}
/// <summary>

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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();

View File

@@ -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()
{

View File

@@ -1,4 +1,4 @@
fc2639fd-5d16-66bf-d8ab-2e4d754c816d
3c8d15ee-d2ba-11ee-ae64-406c8fbbb495
<llsd><map><key>llsd-lsl-syntax-version</key><integer>2</integer>
<key>controls</key>
<map>
@@ -7318,7 +7318,7 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d
<map><key>name</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osGetLinkInventoryKey</key>
<key>osGetLinkInventoryItemKey</key>
<map>
<key>return</key><string>key</string>
<key>arguments</key><array>
@@ -7326,7 +7326,7 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d
<map><key>name</key><map><key>type</key><string>string</string></map></map>
</array>
</map>
<key>osGetInventoryKeys</key>
<key>osGetInventoryItemKeys</key>
<map>
<key>return</key><string>list</string>
<key>arguments</key><array>
@@ -7370,7 +7370,7 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d
<map><key>type</key><map><key>type</key><string>integer</string></map></map>
</array>
</map>
<key>osGetLinkInventoryKeys</key>
<key>osGetLinkInventoryItemKeys</key>
<map>
<key>return</key><string>list</string>
<key>arguments</key><array>
@@ -7583,6 +7583,16 @@ fc2639fd-5d16-66bf-d8ab-2e4d754c816d
<key>return</key><string>float</string>
<key>arguments</key><undef/>
</map>
<key>osGetSitTargetPos</key>
<map>
<key>return</key><string>vector</string>
<key>arguments</key><undef/>
</map>
<key>osGetSitTargetRot</key>
<map>
<key>return</key><string>rotation</string>
<key>arguments</key><undef/>
</map>
<key>osGetSittingAvatarsCount</key>
<map>
<key>return</key><string>integer</string>

View File

@@ -10,7 +10,7 @@
<AllowUnsafe>true</AllowUnsafe>
<WarningLevel>4</WarningLevel>
<WarningsAsErrors>false</WarningsAsErrors>
<SuppressWarnings>CA1416,SYSLIB0011,SYSLIB0014</SuppressWarnings>
<SuppressWarnings>CA1416,SYSLIB0011,SYSLIB0014,SYSLIB0039</SuppressWarnings>
<OutputPath>bin</OutputPath>
<DebugInformation>true</DebugInformation>
<IncrementalBuild>true</IncrementalBuild>
@@ -28,7 +28,7 @@
<AllowUnsafe>true</AllowUnsafe>
<WarningLevel>4</WarningLevel>
<WarningsAsErrors>false</WarningsAsErrors>
<SuppressWarnings>CA1416,SYSLIB0011,SYSLIB0014</SuppressWarnings>
<SuppressWarnings>CA1416,SYSLIB0011,SYSLIB0014,SYSLIB0039</SuppressWarnings>
<OutputPath>bin</OutputPath>
<DebugInformation>false</DebugInformation>
<IncrementalBuild>true</IncrementalBuild>