diff --git a/Source/OpenSim.ApplicationPlugins.LoadRegions/OpenSim.ApplicationPlugins.LoadRegions.csproj b/Source/OpenSim.ApplicationPlugins.LoadRegions/OpenSim.ApplicationPlugins.LoadRegions.csproj
index 1cfea52ecde..fb895db4721 100644
--- a/Source/OpenSim.ApplicationPlugins.LoadRegions/OpenSim.ApplicationPlugins.LoadRegions.csproj
+++ b/Source/OpenSim.ApplicationPlugins.LoadRegions/OpenSim.ApplicationPlugins.LoadRegions.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/Source/OpenSim.ApplicationPlugins.RegionModulesController/OpenSim.ApplicationPlugins.RegionModulesController.csproj b/Source/OpenSim.ApplicationPlugins.RegionModulesController/OpenSim.ApplicationPlugins.RegionModulesController.csproj
index 8df2ee77b83..0c333ea9e0e 100644
--- a/Source/OpenSim.ApplicationPlugins.RegionModulesController/OpenSim.ApplicationPlugins.RegionModulesController.csproj
+++ b/Source/OpenSim.ApplicationPlugins.RegionModulesController/OpenSim.ApplicationPlugins.RegionModulesController.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/Source/OpenSim.ApplicationPlugins.RemoteController/OpenSim.ApplicationPlugins.RemoteController.csproj b/Source/OpenSim.ApplicationPlugins.RemoteController/OpenSim.ApplicationPlugins.RemoteController.csproj
index e432ff8bd4e..770eacf7a43 100644
--- a/Source/OpenSim.ApplicationPlugins.RemoteController/OpenSim.ApplicationPlugins.RemoteController.csproj
+++ b/Source/OpenSim.ApplicationPlugins.RemoteController/OpenSim.ApplicationPlugins.RemoteController.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/Source/OpenSim.Capabilities/Caps.cs b/Source/OpenSim.Capabilities/Caps.cs
index 7d5182db799..b38c53a2e09 100644
--- a/Source/OpenSim.Capabilities/Caps.cs
+++ b/Source/OpenSim.Capabilities/Caps.cs
@@ -25,13 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Collections.Generic;
using System.Collections.Concurrent;
-using System.Reflection;
-using System.Threading;
-using log4net;
+using Microsoft.Extensions.Logging;
using OpenMetaverse;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
@@ -49,26 +45,29 @@ namespace OpenSim.Framework.Capabilities
public class Caps : IDisposable
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly ILogger _logger;
- private readonly string m_httpListenerHostName;
- private readonly uint m_httpListenPort;
+ private string m_httpListenerHostName;
+ private uint m_httpListenPort;
///
/// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester.
///
- private readonly string m_capsObjectPath;
- public string CapsObjectPath { get { return m_capsObjectPath; } }
+ private string m_capsObjectPath;
- private readonly CapsHandlers m_capsHandlers;
- private readonly ConcurrentDictionary m_pollServiceHandlers = new ();
- private readonly Dictionary m_externalCapsHandlers = new ();
+ private CapsHandlers m_capsHandlers;
+
+ private ConcurrentDictionary m_pollServiceHandlers = new();
+ private Dictionary m_externalCapsHandlers = new();
- private readonly IHttpServer m_httpListener;
- private readonly UUID m_agentID;
- private readonly string m_regionName;
+ private IHttpServer m_httpListener;
+ private UUID m_agentID;
+ private string m_regionName;
private ManualResetEvent m_capsActive = new(false);
+ public string CapsObjectPath { get { return m_capsObjectPath; } }
+
+
public UUID AgentID
{
get { return m_agentID; }
@@ -127,8 +126,19 @@ public enum CapsFlags:uint
public CapsFlags Flags { get; set;}
- public Caps(IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
- UUID agent, string regionName)
+ // Construct using DI or Resolve on container
+ public Caps(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ public void Initialize(
+ IHttpServer httpServer,
+ string httpListen,
+ uint httpPort,
+ string capsPath,
+ UUID agent,
+ string regionName)
{
m_capsObjectPath = capsPath;
m_httpListener = httpServer;
@@ -195,11 +205,12 @@ public void RegisterPollHandler(string capName, PollServiceEventArgs pollService
// "[CAPS]: Registering handler with name {0}, url {1} for {2}",
// capName, pollServiceHandler.Url, m_agentID, m_regionName);
- if(!m_pollServiceHandlers.TryAdd(capName, pollServiceHandler))
+ if (m_pollServiceHandlers.TryAdd(capName, pollServiceHandler) is false)
{
- m_log.ErrorFormat(
- "[CAPS]: Handler with name {0} already registered (ulr {1}, agent {2}, region {3}",
- capName, pollServiceHandler.Url, m_agentID, m_regionName);
+ _logger.LogError(
+ $"[CAPS]: Handler with name {capName} already registered " +
+ $"(ulr {pollServiceHandler.Url}, agent {m_agentID}, region {m_regionName}");
+
return;
}
diff --git a/Source/OpenSim.Capabilities/OpenSim.Capabilities.csproj b/Source/OpenSim.Capabilities/OpenSim.Capabilities.csproj
index 4ff34f99f62..dc493c8b614 100644
--- a/Source/OpenSim.Capabilities/OpenSim.Capabilities.csproj
+++ b/Source/OpenSim.Capabilities/OpenSim.Capabilities.csproj
@@ -25,7 +25,5 @@
-
-
diff --git a/Source/OpenSim.Data.Model/OpenSim.Data.Model.csproj b/Source/OpenSim.Data.Model/OpenSim.Data.Model.csproj
index e362cf2c6c8..d874ada36cb 100644
--- a/Source/OpenSim.Data.Model/OpenSim.Data.Model.csproj
+++ b/Source/OpenSim.Data.Model/OpenSim.Data.Model.csproj
@@ -8,20 +8,20 @@
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
-
+
+
diff --git a/Source/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData.csproj b/Source/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData.csproj
deleted file mode 100644
index 68365bb14e5..00000000000
--- a/Source/OpenSim.Data.MySQL.MoneyData/OpenSim.Data.MySQL.MoneyData.csproj
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
- Local
- net8.0
- OpenSim.Data.MySQL.MoneyData
- OpenSim
- OpenSim.Data.MySQL.MoneyData
-
-
-
-
-
-
-
- ..\..\bin\OpenMetaverse.dll
- False
-
-
- ..\..\bin\OpenMetaverseTypes.dll
- False
-
-
- ..\..\bin\XMLRPC.dll
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Source/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs b/Source/OpenSim.Data.MySQL/MySQLMoneyManager.cs
similarity index 99%
rename from Source/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs
rename to Source/OpenSim.Data.MySQL/MySQLMoneyManager.cs
index bf9d252826c..74ff3d6fa5e 100644
--- a/Source/OpenSim.Data.MySQL.MoneyData/MySQLMoneyManager.cs
+++ b/Source/OpenSim.Data.MySQL/MySQLMoneyManager.cs
@@ -33,7 +33,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
-namespace OpenSim.Data.MySQL.MoneyData
+namespace OpenSim.Data.MySQL
{
public class MySQLMoneyManager : IMoneyManager
{
@@ -1345,7 +1345,7 @@ public bool setTotalSale(string userUUID, string objectUUID, int type, int count
//
// transactions
//
- public bool addTransaction(TransactionData transaction)
+ public bool addTransaction(MoneyTransactionData transaction)
{
bool bRet = false;
string sql = string.Empty;
@@ -1462,9 +1462,9 @@ public bool ValidateTransfer(string secureCode, UUID transactionID)
}
- public TransactionData FetchTransaction(UUID transactionID)
+ public MoneyTransactionData FetchTransaction(UUID transactionID)
{
- TransactionData transactionData = new TransactionData();
+ MoneyTransactionData transactionData = new MoneyTransactionData();
transactionData.TransUUID = transactionID;
string sql = string.Empty;
@@ -1514,9 +1514,9 @@ public TransactionData FetchTransaction(UUID transactionID)
}
- public TransactionData[] FetchTransaction(string userID, int startTime, int endTime, uint index, uint retNum)
+ public MoneyTransactionData[] FetchTransaction(string userID, int startTime, int endTime, uint index, uint retNum)
{
- List rows = new List();
+ List rows = new List();
string sql = string.Empty;
sql = "SELECT * FROM " + Table_of_Transactions + " WHERE time>=?start AND time<=?end ";
@@ -1537,7 +1537,7 @@ public TransactionData[] FetchTransaction(string userID, int startTime, int endT
{
try
{
- TransactionData transactionData = new TransactionData();
+ MoneyTransactionData transactionData = new MoneyTransactionData();
string uuid = (string)r["UUID"];
UUID transUUID;
UUID.TryParse(uuid, out transUUID);
diff --git a/Source/OpenSim.Data.MySQL.MoneyData/MySQLSuperManager.cs b/Source/OpenSim.Data.MySQL/MySQLSuperManager.cs
similarity index 98%
rename from Source/OpenSim.Data.MySQL.MoneyData/MySQLSuperManager.cs
rename to Source/OpenSim.Data.MySQL/MySQLSuperManager.cs
index 7bcf6fdf6a6..8fb053bcfe5 100644
--- a/Source/OpenSim.Data.MySQL.MoneyData/MySQLSuperManager.cs
+++ b/Source/OpenSim.Data.MySQL/MySQLSuperManager.cs
@@ -26,7 +26,7 @@
*/
using System.Threading;
-namespace OpenSim.Data.MySQL.MoneyData
+namespace OpenSim.Data.MySQL
{
// This bit of code is from OpenSim.Data.MySQLSuperManager
public class MySQLSuperManager
diff --git a/Source/OpenSim.Data.MySQL.MoneyData/IMoneyManager.cs b/Source/OpenSim.Data/IMoneyManager.cs
similarity index 90%
rename from Source/OpenSim.Data.MySQL.MoneyData/IMoneyManager.cs
rename to Source/OpenSim.Data/IMoneyManager.cs
index d66a3e7c569..fcc98661702 100644
--- a/Source/OpenSim.Data.MySQL.MoneyData/IMoneyManager.cs
+++ b/Source/OpenSim.Data/IMoneyManager.cs
@@ -27,7 +27,7 @@
using OpenMetaverse;
-namespace OpenSim.Data.MySQL.MoneyData
+namespace OpenSim.Data
{
public interface IMoneyManager
{
@@ -43,13 +43,13 @@ public interface IMoneyManager
bool giveMoney(UUID transactionID, string receiverID, int amount);
- bool addTransaction(TransactionData transaction);
+ bool addTransaction(MoneyTransactionData transaction);
bool updateTransactionStatus(UUID transactionID, int status, string description);
- TransactionData FetchTransaction(UUID transactionID);
+ MoneyTransactionData FetchTransaction(UUID transactionID);
- TransactionData[] FetchTransaction(string userID, int startTime, int endTime, uint index, uint retNum);
+ MoneyTransactionData[] FetchTransaction(string userID, int startTime, int endTime, uint index, uint retNum);
int getTransactionNum(string userID, int startTime, int endTime);
diff --git a/Source/OpenSim.Data/Migration.cs b/Source/OpenSim.Data/Migration.cs
index e54bf55a7b7..0537e886182 100644
--- a/Source/OpenSim.Data/Migration.cs
+++ b/Source/OpenSim.Data/Migration.cs
@@ -25,14 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Data;
+using Microsoft.Extensions.Logging;
using System.Data.Common;
-using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
-using log4net;
+
namespace OpenSim.Data
{
@@ -69,8 +66,6 @@ namespace OpenSim.Data
///
public class Migration
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
protected string _type;
protected DbConnection _conn;
protected Assembly _assem;
@@ -78,21 +73,28 @@ public class Migration
private Regex _match_old;
private Regex _match_new;
+ protected readonly ILogger _logger;
+
/// Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint.
/// Currently this is only used in the tests. A Migration instance created this way must be then
/// initialized with Initialize(). Regular creation should be through the parameterized constructors.
///
- public Migration()
+ public Migration(ILogger logger)
{
+ _logger = logger;
}
- public Migration(DbConnection conn, Assembly assem, string subtype, string type)
+ public Migration(ILogger logger, DbConnection conn, Assembly assem, string subtype, string type)
{
+ _logger = logger;
+
Initialize(conn, assem, type, subtype);
}
- public Migration(DbConnection conn, Assembly assem, string type)
+ public Migration(ILogger logger, DbConnection conn, Assembly assem, string type)
{
+ _logger = logger;
+
Initialize(conn, assem, type, "");
}
@@ -183,8 +185,8 @@ public void Update()
return;
// to prevent people from killing long migrations.
- m_log.InfoFormat("[MIGRATIONS]: Upgrading {0} to latest revision {1}.", _type, migrations.Keys[migrations.Count - 1]);
- m_log.Info("[MIGRATIONS]: NOTE - this may take a while, don't interrupt this process!");
+ _logger.LogInformation($"[MIGRATIONS]: Upgrading {_type} to latest revision {migrations.Keys[migrations.Count - 1]}");
+ _logger.LogInformation($"[MIGRATIONS]: NOTE - this may take a while, don't interrupt this process!");
foreach (KeyValuePair kvp in migrations)
{
@@ -203,8 +205,8 @@ public void Update()
}
catch (Exception e)
{
- m_log.DebugFormat("[MIGRATIONS]: Cmd was {0}", e.Message.Replace("\n", " "));
- m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. If you're running OpenSim for the first time then you can probably safely ignore this, since certain migration commands attempt to fetch data out of old tables. However, if you're using an existing database and you see database related errors while running OpenSim then you will need to fix these problems manually. Continuing.");
+ _logger.LogDebug($"[MIGRATIONS]: Cmd was {e.Message.Replace("\n", " ")}");
+ _logger.LogDebug("[MIGRATIONS]: An error has occurred in the migration. If you're running OpenSim for the first time then you can probably safely ignore this, since certain migration commands attempt to fetch data out of old tables. However, if you're using an existing database and you see database related errors while running OpenSim then you will need to fix these problems manually. Continuing.");
ExecuteScript("ROLLBACK;");
}
@@ -263,14 +265,14 @@ protected virtual int FindVersion(DbConnection conn, string type)
private void InsertVersion(string type, int version)
{
- m_log.InfoFormat("[MIGRATIONS]: Creating {0} at version {1}", type, version);
- ExecuteScript("insert into migrations(name, version) values('" + type + "', " + version + ")");
+ _logger.LogInformation($"[MIGRATIONS]: Creating {type} at version {version}");
+ ExecuteScript($"insert into migrations(name, version) values('{type}', {version})");
}
private void UpdateVersion(string type, int version)
{
- m_log.InfoFormat("[MIGRATIONS]: Updating {0} to version {1}", type, version);
- ExecuteScript("update migrations set version=" + version + " where name='" + type + "'");
+ _logger.LogInformation($"[MIGRATIONS]: Updating {type} to version {version}");
+ ExecuteScript($"update migrations set version={version} where name='{type}'");
}
private delegate void FlushProc();
@@ -367,7 +369,7 @@ private SortedList GetMigrationsAfter(int after)
if (!int.TryParse(sLine.Substring(9).Trim(), out nVersion))
{
- m_log.ErrorFormat("[MIGRATIONS]: invalid version marker at {0}: line {1}. Migration failed!", sFile, nLineNo);
+ _logger.LogError($"[MIGRATIONS]: invalid version marker at {sFile}: line {nLineNo}. Migration failed!");
break;
}
}
@@ -407,7 +409,9 @@ private SortedList GetMigrationsAfter(int after)
}
if (migrations.Count < 1)
- m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after);
+ {
+ _logger.LogDebug($"[MIGRATIONS]: {_type} data tables already up to date at revision {after}");
+ }
return migrations;
}
diff --git a/Source/OpenSim.Data.MySQL.MoneyData/TransactionData.cs b/Source/OpenSim.Data/MoneyTransactionData.cs
similarity index 97%
rename from Source/OpenSim.Data.MySQL.MoneyData/TransactionData.cs
rename to Source/OpenSim.Data/MoneyTransactionData.cs
index 4a37d217be4..1bf64d900a9 100644
--- a/Source/OpenSim.Data.MySQL.MoneyData/TransactionData.cs
+++ b/Source/OpenSim.Data/MoneyTransactionData.cs
@@ -27,9 +27,9 @@
using OpenMetaverse;
-namespace OpenSim.Data.MySQL.MoneyData
+namespace OpenSim.Data
{
- public class TransactionData
+ public class MoneyTransactionData
{
UUID m_uuid;
string m_sender = string.Empty;
@@ -50,7 +50,7 @@ public class TransactionData
string m_description = string.Empty;
/*
- public TransactionData(string uuid, string sender, string receiver,
+ public MoneyTransactionData(string uuid, string sender, string receiver,
int amount, int time, int status, string description)
{
this.m_uuid = uuid;
diff --git a/Source/OpenSim.Data/OpenSim.Data.csproj b/Source/OpenSim.Data/OpenSim.Data.csproj
index eb4bdda92f4..ba7813b2bb6 100644
--- a/Source/OpenSim.Data/OpenSim.Data.csproj
+++ b/Source/OpenSim.Data/OpenSim.Data.csproj
@@ -32,9 +32,7 @@
-
-
diff --git a/Source/OpenSim.Framework.AssetLoader.Filesystem/AssetLoaderFileSystem.cs b/Source/OpenSim.Framework.AssetLoader.Filesystem/AssetLoaderFileSystem.cs
index 317ca8866b8..6fbd09d5fdf 100644
--- a/Source/OpenSim.Framework.AssetLoader.Filesystem/AssetLoaderFileSystem.cs
+++ b/Source/OpenSim.Framework.AssetLoader.Filesystem/AssetLoaderFileSystem.cs
@@ -25,15 +25,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
using System.Xml;
-using log4net;
-using Nini.Config;
+
using OpenMetaverse;
+using Microsoft.Extensions.Logging;
+
+
///
/// Loads assets from the filesystem location. Not yet a plugin, though it should be.
///
@@ -43,10 +41,14 @@ public class AssetLoaderFileSystem : IAssetLoader
{
private static readonly UUID LIBRARY_OWNER_ID = new UUID("11111111-1111-0000-0000-000100bba000");
private static readonly string LIBRARY_OWNER_IDstr = "11111111-1111-0000-0000-000100bba000";
+ private readonly ILogger _logger;
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ public AssetLoaderFileSystem(ILogger logger)
+ {
+ _logger = logger;
+ }
- protected static AssetBase CreateAsset(string assetIdStr, string name, string path, sbyte type)
+ protected AssetBase CreateAsset(string assetIdStr, string name, string path, sbyte type)
{
AssetBase asset = new AssetBase(new UUID(assetIdStr), name, type, LIBRARY_OWNER_IDstr);
@@ -59,13 +61,13 @@ protected static AssetBase CreateAsset(string assetIdStr, string name, string pa
else
{
asset.Data = Array.Empty();
- m_log.InfoFormat("[ASSETS]: Instantiated: [{0}]", name);
+ _logger.LogInformation($"[ASSETS]: Instantiated: [{name}");
}
return asset;
}
- protected static void LoadAsset(AssetBase info, string path)
+ protected void LoadAsset(AssetBase info, string path)
{
// bool image =
// (info.Type == (sbyte)AssetType.Texture ||
@@ -75,7 +77,8 @@ protected static void LoadAsset(AssetBase info, string path)
FileInfo fInfo = new FileInfo(path);
long numBytes = fInfo.Length;
- if (fInfo.Exists)
+
+ if (fInfo.Exists)
{
FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read);
byte[] idata = new byte[numBytes];
@@ -87,39 +90,40 @@ protected static void LoadAsset(AssetBase info, string path)
//info.loaded=true;
}
else
- {
- m_log.ErrorFormat("[ASSETS]: file: [{0}] not found !", path);
+ {
+ _logger.LogError($"[ASSETS]: file: [{path}] not found !");
}
}
public void ForEachDefaultXmlAsset(string assetSetFilename, Action action)
{
List assets = new List();
+
if (File.Exists(assetSetFilename))
{
string assetSetPath = "ERROR";
string assetRootPath = "";
try
{
- XmlConfigSource source = new XmlConfigSource(assetSetFilename);
- assetRootPath = Path.GetFullPath(source.SavePath);
- assetRootPath = Path.GetDirectoryName(assetRootPath);
+ //XmlConfigSource source = new XmlConfigSource(assetSetFilename);
+ //assetRootPath = Path.GetFullPath(source.SavePath);
+ //assetRootPath = Path.GetDirectoryName(assetRootPath);
- for (int i = 0; i < source.Configs.Count; i++)
- {
- assetSetPath = source.Configs[i].GetString("file", String.Empty);
+ //for (int i = 0; i < source.Configs.Count; i++)
+ //{
+ // assetSetPath = source.Configs[i].GetString("file", String.Empty);
- LoadXmlAssetSet(Path.Combine(assetRootPath, assetSetPath), assets);
- }
+ // LoadXmlAssetSet(Path.Combine(assetRootPath, assetSetPath), assets);
+ //}
}
catch (XmlException e)
{
- m_log.ErrorFormat("[ASSETS]: Error loading {0} : {1}", assetSetPath, e.Message);
+ _logger.LogError(e, $"[ASSETS]: Error loading {assetSetPath}");
}
}
else
{
- m_log.ErrorFormat("[ASSETS]: Asset set control file {0} does not exist! No assets loaded.", assetSetFilename);
+ _logger.LogError($"[ASSETS]: Asset set control file {assetSetFilename} does not exist! No assets loaded.");
}
assets.ForEach(action);
@@ -130,7 +134,7 @@ public void ForEachDefaultXmlAsset(string assetSetFilename, Action ac
///
///
///
- protected static void LoadXmlAssetSet(string assetSetPath, List assets)
+ protected void LoadXmlAssetSet(string assetSetPath, List assets)
{
//m_log.InfoFormat("[ASSETS]: Loading asset set {0}", assetSetPath);
@@ -138,34 +142,34 @@ protected static void LoadXmlAssetSet(string assetSetPath, List asset
{
try
{
- XmlConfigSource source = new XmlConfigSource(assetSetPath);
- String dir = Path.GetDirectoryName(assetSetPath);
-
- for (int i = 0; i < source.Configs.Count; i++)
- {
- string assetIdStr = source.Configs[i].GetString("assetID", UUID.Random().ToString());
- string name = source.Configs[i].GetString("name", String.Empty);
- sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0);
-
- string assetPath = source.Configs[i].GetString("fileName", String.Empty);
- AssetBase newAsset;
- if (string.IsNullOrEmpty(assetPath))
- newAsset = CreateAsset(assetIdStr, name, null, type);
- else
- newAsset = CreateAsset(assetIdStr, name, Path.Combine(dir, assetPath), type);
-
- newAsset.Type = type;
- assets.Add(newAsset);
- }
+ //XmlConfigSource source = new XmlConfigSource(assetSetPath);
+ //String dir = Path.GetDirectoryName(assetSetPath);
+
+ //for (int i = 0; i < source.Configs.Count; i++)
+ //{
+ // string assetIdStr = source.Configs[i].GetString("assetID", UUID.Random().ToString());
+ // string name = source.Configs[i].GetString("name", String.Empty);
+ // sbyte type = (sbyte)source.Configs[i].GetInt("assetType", 0);
+
+ // string assetPath = source.Configs[i].GetString("fileName", String.Empty);
+ // AssetBase newAsset;
+ // if (string.IsNullOrEmpty(assetPath))
+ // newAsset = CreateAsset(assetIdStr, name, null, type);
+ // else
+ // newAsset = CreateAsset(assetIdStr, name, Path.Combine(dir, assetPath), type);
+
+ // newAsset.Type = type;
+ // assets.Add(newAsset);
+ //}
}
catch (XmlException e)
{
- m_log.ErrorFormat("[ASSETS]: Error loading {0} : {1}", assetSetPath, e.Message);
+ _logger.LogError(e, $"[ASSETS]: Error loading {assetSetPath}");
}
}
else
{
- m_log.ErrorFormat("[ASSETS]: Asset set file {0} does not exist!", assetSetPath);
+ _logger.LogError($"[ASSETS]: Asset set file {assetSetPath} does not exist!");
}
}
}
diff --git a/Source/OpenSim.Framework.AssetLoader.Filesystem/OpenSim.Framework.AssetLoader.Filesystem.csproj b/Source/OpenSim.Framework.AssetLoader.Filesystem/OpenSim.Framework.AssetLoader.Filesystem.csproj
index 2cef38dda3e..efabec5729e 100644
--- a/Source/OpenSim.Framework.AssetLoader.Filesystem/OpenSim.Framework.AssetLoader.Filesystem.csproj
+++ b/Source/OpenSim.Framework.AssetLoader.Filesystem/OpenSim.Framework.AssetLoader.Filesystem.csproj
@@ -21,7 +21,5 @@
-
-
\ No newline at end of file
diff --git a/Source/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj b/Source/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
index 596b39b64f4..e893af3bcef 100644
--- a/Source/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
+++ b/Source/OpenSim.Framework.Console/OpenSim.Framework.Console.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/Source/OpenSim.Framework.Console/OpenSimAppender.cs b/Source/OpenSim.Framework.Console/OpenSimAppender.cs
deleted file mode 100644
index c2e650cab53..00000000000
--- a/Source/OpenSim.Framework.Console/OpenSimAppender.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the OpenSimulator Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using log4net.Appender;
-using log4net.Core;
-
-namespace OpenSim.Framework.Console
-{
- ///
- /// Writes log information out onto the console
- ///
- public class OpenSimAppender : AnsiColorTerminalAppender
- {
- private ConsoleBase m_console = null;
-
- public ConsoleBase Console
- {
- get { return m_console; }
- set { m_console = value; }
- }
-
- override protected void Append(LoggingEvent le)
- {
- //if (m_console != null)
- // m_console.LockOutput();
-
- string loggingMessage = RenderLoggingEvent(le);
-
- try
- {
- if (m_console != null)
- {
- ConsoleLevel level;
-
- if (le.Level == Level.Error)
- level = "error";
- else if (le.Level == Level.Warn)
- level = "warn";
- else
- level = "normal";
-
- m_console.Output(loggingMessage, level);
- }
- else
- {
- if (!loggingMessage.EndsWith("\n"))
- System.Console.WriteLine(loggingMessage);
- else
- System.Console.Write(loggingMessage);
- }
- }
- catch (Exception e)
- {
- System.Console.WriteLine("Couldn't write out log message: {0}", e.ToString());
- }
- /*
- finally
- {
- if (m_console != null)
- m_console.UnlockOutput();
- }
- */
- }
- }
-}
diff --git a/Source/OpenSim.Framework.Monitoring/ChecksManager.cs b/Source/OpenSim.Framework.Monitoring/ChecksManager.cs
index f7190998a0c..5b0dcf26398 100755
--- a/Source/OpenSim.Framework.Monitoring/ChecksManager.cs
+++ b/Source/OpenSim.Framework.Monitoring/ChecksManager.cs
@@ -25,12 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using log4net;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework.Monitoring
{
@@ -39,8 +34,6 @@ namespace OpenSim.Framework.Monitoring
///
public static class ChecksManager
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
// Subcommand used to list other stats.
public const string ListSubCommand = "list";
@@ -223,8 +216,9 @@ public static void CheckChecks()
foreach (Check check in container.Values)
{
if (!check.CheckIt())
- m_log.WarnFormat(
- "[CHECKS MANAGER]: Check {0}.{1}.{2} failed with message {3}", check.Category, check.Container, check.ShortName, check.LastFailureMessage);
+ {
+// logger.LogWarning($"[CHECKS MANAGER]: Check {check.Category}.{check.Container}.{check.ShortName} failed with message {check.LastFailureMessage}");
+ }
}
}
}
diff --git a/Source/OpenSim.Framework.Monitoring/JobEngine.cs b/Source/OpenSim.Framework.Monitoring/JobEngine.cs
index 3f71811d36a..9c703b80f98 100644
--- a/Source/OpenSim.Framework.Monitoring/JobEngine.cs
+++ b/Source/OpenSim.Framework.Monitoring/JobEngine.cs
@@ -25,19 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
+using Microsoft.Extensions.Logging;
using System.Collections.Concurrent;
using System.Reflection;
-using System.Threading;
-using log4net;
-using OpenSim.Framework;
namespace OpenSim.Framework.Monitoring
{
public class JobEngine
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public int LogLevel { get; set; }
private object JobLock = new object();
@@ -71,11 +66,14 @@ public class JobEngine
private int m_timeout = -1;
private int m_concurrency = 1;
-
private int m_numberThreads = 0;
+// private readonly ILogger m_logger;
+
public JobEngine(string name, string loggingName, int timeout = -1, int concurrency = 1)
{
+// m_logger = logger;
+
Name = name;
LoggingName = loggingName;
m_timeout = timeout;
@@ -104,7 +102,7 @@ public void Stop()
if (!IsRunning)
return;
- m_log.DebugFormat("[JobEngine] Stopping {0}", Name);
+// m_logger.LogDebug($"[JobEngine] Stopping {Name}");
IsRunning = false;
if(m_numberThreads > 0)
@@ -207,10 +205,7 @@ public bool QueueJob(Job job)
{
if (m_warnOverMaxQueue)
{
- m_log.WarnFormat(
- "[{0}]: Job queue at maximum capacity, not recording job from {1} in {2}",
- LoggingName, job.Name, Name);
-
+// m_logger.LogWarning($"[{LoggingName}]: Job queue at maximum capacity, not recording job from {job.Name} in {Name}");
m_warnOverMaxQueue = false;
}
return false;
@@ -240,8 +235,10 @@ private void ProcessRequests(object o)
break;
}
- if(LogLevel >= 1)
- m_log.DebugFormat("[{0}]: Processing job {1}",LoggingName,currentJob.Name);
+ if (LogLevel >= 1)
+ {
+// m_logger.LogDebug($"[{LoggingName}]: Processing job {currentJob.Name}");
+ }
try
{
@@ -249,18 +246,22 @@ private void ProcessRequests(object o)
}
catch(Exception e)
{
- m_log.ErrorFormat(
- "[{0}]: Job {1} failed, continuing. Exception {2}",LoggingName, currentJob.Name, e);
+// m_logger.LogError(e, $"[{LoggingName}]: Job {currentJob.Name} failed, continuing.");
}
- if(LogLevel >= 1)
- m_log.DebugFormat("[{0}]: Processed job {1}",LoggingName,currentJob.Name);
+ if (LogLevel >= 1)
+ {
+// m_logger.LogDebug($"[{LoggingName}]: Processed job {currentJob.Name}");
+ }
currentJob.Action = null;
currentJob = null;
}
+
lock (JobLock)
+ {
--m_numberThreads;
+ }
}
public class Job
diff --git a/Source/OpenSim.Framework.Monitoring/MemoryWatchdog.cs b/Source/OpenSim.Framework.Monitoring/MemoryWatchdog.cs
index f2e47f8b44c..56caec9fbf7 100644
--- a/Source/OpenSim.Framework.Monitoring/MemoryWatchdog.cs
+++ b/Source/OpenSim.Framework.Monitoring/MemoryWatchdog.cs
@@ -25,13 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using log4net;
-
namespace OpenSim.Framework.Monitoring
{
///
@@ -39,8 +32,6 @@ namespace OpenSim.Framework.Monitoring
///
public static class MemoryWatchdog
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Is this watchdog active?
///
diff --git a/Source/OpenSim.Framework.Monitoring/OpenSim.Framework.Monitoring.csproj b/Source/OpenSim.Framework.Monitoring/OpenSim.Framework.Monitoring.csproj
index 117e6305c6e..20bec9ca040 100644
--- a/Source/OpenSim.Framework.Monitoring/OpenSim.Framework.Monitoring.csproj
+++ b/Source/OpenSim.Framework.Monitoring/OpenSim.Framework.Monitoring.csproj
@@ -28,9 +28,7 @@
-
-
diff --git a/Source/OpenSim.Framework.Monitoring/StatsLogger.cs b/Source/OpenSim.Framework.Monitoring/StatsLogger.cs
index cfd6536030e..d6c9431f3c7 100755
--- a/Source/OpenSim.Framework.Monitoring/StatsLogger.cs
+++ b/Source/OpenSim.Framework.Monitoring/StatsLogger.cs
@@ -25,13 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Text;
+using Microsoft.Extensions.Logging;
using System.Timers;
-using log4net;
namespace OpenSim.Framework.Monitoring
{
@@ -40,11 +35,11 @@ namespace OpenSim.Framework.Monitoring
///
public static class StatsLogger
{
- private static readonly ILog m_statsLog = LogManager.GetLogger("special.StatsLogger");
+ private const string loggerCategory = "special.StatsLogger";
private static System.Timers.Timer m_loggingTimer;
private static int m_statsLogIntervalMs = 5000;
-
+
public static void RegisterConsoleCommands(ICommandConsole console)
{
console.Commands.AddCommand(
@@ -130,8 +125,8 @@ public static void Stop()
private static void Log(object sender, ElapsedEventArgs e)
{
- foreach (string line in GetReport())
- m_statsLog.Info(line);
+ foreach (string line in GetReport()) ;
+ //m_logger?.LogInformation(line);
m_loggingTimer.Start();
}
diff --git a/Source/OpenSim.Framework.Monitoring/Watchdog.cs b/Source/OpenSim.Framework.Monitoring/Watchdog.cs
index 7b9b92214bb..67512b4fca2 100644
--- a/Source/OpenSim.Framework.Monitoring/Watchdog.cs
+++ b/Source/OpenSim.Framework.Monitoring/Watchdog.cs
@@ -25,12 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using log4net;
-
namespace OpenSim.Framework.Monitoring
{
///
@@ -38,8 +32,6 @@ namespace OpenSim.Framework.Monitoring
///
public static class Watchdog
{
- private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
/// Timer interval in milliseconds for the watchdog timer
public const int WATCHDOG_INTERVAL_MS = 2500;
@@ -143,8 +135,6 @@ public static bool Enabled
get { return m_enabled; }
set
{
- // m_log.DebugFormat("[MEMORY WATCHDOG]: Setting MemoryWatchdog.Enabled to {0}", value);
-
if (value == m_enabled)
return;
@@ -209,13 +199,8 @@ public static void Stop()
///
/// Information about the thread.
/// Name of the thread.
- /// If true then creation of thread is logged.
- public static void AddThread(ThreadWatchdogInfo info, string name, bool log = true)
+ public static void AddThread(ThreadWatchdogInfo info, string name)
{
- if (log)
- m_log.DebugFormat(
- "[WATCHDOG]: Started tracking thread {0}, ID {1}", name, info.Thread.ManagedThreadId);
-
lock (m_threads)
m_threads.Add(info.Thread.ManagedThreadId, info);
}
@@ -231,35 +216,28 @@ public static void UpdateThread()
///
/// Stops watchdog tracking on the current thread
///
- /// If true then normal events in thread removal are not logged.
///
/// True if the thread was removed from the list of tracked
/// threads, otherwise false
///
- public static bool RemoveThread(bool log = true)
+ public static bool RemoveThread( )
{
- return RemoveThread(Thread.CurrentThread.ManagedThreadId, log);
+ return RemoveThread(Thread.CurrentThread.ManagedThreadId);
}
- private static bool RemoveThread(int threadID, bool log = true)
+ private static bool RemoveThread(int threadID)
{
lock (m_threads)
{
ThreadWatchdogInfo twi;
if (m_threads.TryGetValue(threadID, out twi))
{
- if (log)
- m_log.DebugFormat(
- "[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
-
twi.Cleanup();
m_threads.Remove(threadID);
return true;
}
else
{
- m_log.WarnFormat(
- "[WATCHDOG]: Requested to remove thread with ID {0} but this is not being monitored", threadID);
return false;
}
}
@@ -299,10 +277,6 @@ private static void UpdateThread(int threadID)
threadInfo.LastTick = Environment.TickCount & Int32.MaxValue;
threadInfo.IsTimedOut = false;
}
- else
- {
- m_log.WarnFormat("[WATCHDOG]: Asked to update thread {0} which is not being monitored", threadID);
- }
}
catch { }
}
@@ -344,11 +318,6 @@ private static void WatchdogTimerElapsed(object sender)
int now = Environment.TickCount & Int32.MaxValue;
int msElapsed = now - LastWatchdogThreadTick;
- if (msElapsed > WATCHDOG_INTERVAL_MS * 2)
- m_log.WarnFormat(
- "[WATCHDOG]: {0} ms since Watchdog last ran. Interval should be approximately {1} ms",
- msElapsed, WATCHDOG_INTERVAL_MS);
-
LastWatchdogThreadTick = Environment.TickCount & Int32.MaxValue;
Action callback = OnWatchdogTimeout;
diff --git a/Source/OpenSim.Framework.Monitoring/WorkManager.cs b/Source/OpenSim.Framework.Monitoring/WorkManager.cs
index c7198bf8562..598509e8ac8 100755
--- a/Source/OpenSim.Framework.Monitoring/WorkManager.cs
+++ b/Source/OpenSim.Framework.Monitoring/WorkManager.cs
@@ -25,10 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Runtime.CompilerServices;
-using System.Threading;
-using log4net;
namespace OpenSim.Framework.Monitoring
{
@@ -49,8 +46,6 @@ namespace OpenSim.Framework.Monitoring
///
public static class WorkManager
{
- private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
public static JobEngine JobEngine { get; private set; }
static WorkManager()
@@ -152,7 +147,7 @@ public static Thread StartThread(
AlarmMethod = alarmMethod
};
- Watchdog.AddThread(twi, name, log);
+ Watchdog.AddThread(twi, name);
thread.Start();
@@ -191,7 +186,7 @@ public static Thread StartThread(
AlarmMethod = null
};
- Watchdog.AddThread(twi, name, false);
+ Watchdog.AddThread(twi, name);
thread.Start();
@@ -205,7 +200,7 @@ public static Thread StartThread(
/// Code for the thread to execute.
/// Object to pass to the thread.
/// Name of the thread
- public static void RunInThread(WaitCallback callback, object obj, string name, bool log = false)
+ public static void RunInThread(WaitCallback callback, object obj, string name)
{
if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest)
{
@@ -221,21 +216,20 @@ public static void RunInThread(WaitCallback callback, object obj, string name, b
Culture.SetCurrentCulture();
callback(obj);
}
- catch (Exception e)
+ catch (Exception)
{
- m_log.Error(string.Format("[WATCHDOG]: Exception in thread {0}.", name), e);
}
finally
{
try
{
- Watchdog.RemoveThread(log: false);
+ Watchdog.RemoveThread( );
}
catch { }
}
});
- StartThread(ts, name, false, log);
+ StartThread(ts, name, false);
}
///
diff --git a/Source/OpenSim.Framework.Serialization/External/ExternalRepresentationUtils.cs b/Source/OpenSim.Framework.Serialization/External/ExternalRepresentationUtils.cs
index 7aa8b1ae1e6..937ab02180b 100644
--- a/Source/OpenSim.Framework.Serialization/External/ExternalRepresentationUtils.cs
+++ b/Source/OpenSim.Framework.Serialization/External/ExternalRepresentationUtils.cs
@@ -25,14 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.IO;
using System.Reflection;
-using System.Text;
using System.Xml;
-using log4net;
using OpenMetaverse;
using OpenSim.Services.Interfaces;
@@ -43,8 +38,6 @@ namespace OpenSim.Framework.Serialization.External
///
public class ExternalRepresentationUtils
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Populate a node with data read from xml using a dictinoary of processors
///
@@ -60,8 +53,8 @@ public static bool ExecuteReadProcessors(
processors,
xtr,
(o, nodeName, e) => {
- m_log.Debug(string.Format("[ExternalRepresentationUtils]: Error while parsing element {0} ",
- nodeName), e);
+ //m_log.Debug(string.Format("[ExternalRepresentationUtils]: Error while parsing element {0} ",
+ // nodeName), e);
});
}
@@ -110,13 +103,13 @@ public static bool ExecuteReadProcessors(
if (xtr.EOF)
{
- m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to unexpected end of XML");
+ //m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to unexpected end of XML");
break;
}
if (++numErrors == 10)
{
- m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to too many parsing errors");
+ //m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to too many parsing errors");
break;
}
@@ -132,7 +125,7 @@ public static bool ExecuteReadProcessors(
if (timer.Elapsed.TotalSeconds >= 60)
{
- m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to timeout");
+ //m_log.Debug("[ExternalRepresentationUtils]: Aborting ExecuteReadProcessors due to timeout");
errors = true;
break;
}
@@ -376,9 +369,9 @@ protected static void TransformXml(XmlReader reader, XmlWriter writer, string sc
break;
default:
- m_log.WarnFormat(
- "[HG ASSET MAPPER]: Unrecognized node {0} in asset XML transform in {1}",
- reader.NodeType, sceneName);
+ //m_log.WarnFormat(
+ // "[HG ASSET MAPPER]: Unrecognized node {0} in asset XML transform in {1}",
+ // reader.NodeType, sceneName);
break;
}
}
diff --git a/Source/OpenSim.Framework.Serialization/External/LandDataSerializer.cs b/Source/OpenSim.Framework.Serialization/External/LandDataSerializer.cs
index 8e5ddf8ed94..af7196930b1 100644
--- a/Source/OpenSim.Framework.Serialization/External/LandDataSerializer.cs
+++ b/Source/OpenSim.Framework.Serialization/External/LandDataSerializer.cs
@@ -25,12 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
using System.Text;
using System.Xml;
-using log4net;
+
using OpenMetaverse;
namespace OpenSim.Framework.Serialization.External
@@ -40,8 +37,6 @@ namespace OpenSim.Framework.Serialization.External
///
public class LandDataSerializer
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static Dictionary> m_ldProcessors
= new Dictionary>();
diff --git a/Source/OpenSim.Framework.Serialization/External/OspResolver.cs b/Source/OpenSim.Framework.Serialization/External/OspResolver.cs
index a1e9d554bf0..e17a24c2a2f 100644
--- a/Source/OpenSim.Framework.Serialization/External/OspResolver.cs
+++ b/Source/OpenSim.Framework.Serialization/External/OspResolver.cs
@@ -27,9 +27,7 @@
using System.Reflection;
using System.Text;
-using log4net;
using OpenMetaverse;
-using OpenSim.Framework;
using OpenSim.Services.Interfaces;
namespace OpenSim.Framework.Serialization
@@ -40,8 +38,6 @@ namespace OpenSim.Framework.Serialization
///
public class OspResolver
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public const string OSPA_PREFIX = "ospa:";
public const string OSPA_NAME_KEY = "n";
public const string OSPA_NAME_VALUE_SEPARATOR = " ";
@@ -59,7 +55,7 @@ public static string MakeOspa(UUID userId, IUserAccountService userService)
{
if (userService == null)
{
- m_log.Warn("[OSP RESOLVER]: UserService is null");
+ //m_log.Warn("[OSP RESOLVER]: UserService is null");
return userId.ToString();
}
@@ -70,7 +66,7 @@ public static string MakeOspa(UUID userId, IUserAccountService userService)
}
// else
// {
-// m_log.WarnFormat("[OSP RESOLVER]: No user account for {0}", userId);
+// //m_log.WarnFormat("[OSP RESOLVER]: No user account for {0}", userId);
// System.Console.WriteLine("[OSP RESOLVER]: No user account for {0}", userId);
// }
@@ -87,7 +83,7 @@ public static string MakeOspa(string firstName, string lastName)
string ospa
= OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName;
-// m_log.DebugFormat("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName);
+// //m_log.DebugFormat("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName);
// System.Console.WriteLine("[OSP RESOLVER]: Made OSPA {0} for {1} {2}", ospa, firstName, lastName);
return ospa;
@@ -110,11 +106,11 @@ public static UUID ResolveOspa(string ospa, IUserAccountService userService)
{
if (!ospa.StartsWith(OSPA_PREFIX))
{
-// m_log.DebugFormat("[OSP RESOLVER]: ResolveOspa() got unrecognized format [{0}]", ospa);
+// //m_log.DebugFormat("[OSP RESOLVER]: ResolveOspa() got unrecognized format [{0}]", ospa);
return UUID.Zero;
}
-// m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
+// //m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);
string ospaMeat = ospa.Substring(OSPA_PREFIX.Length);
string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY);
@@ -125,7 +121,7 @@ public static UUID ResolveOspa(string ospa, IUserAccountService userService)
if (tupleSeparatorIndex < 0)
{
- m_log.WarnFormat("[OSP RESOLVER]: Ignoring non-tuple component {0} in OSPA {1}", tuple, ospa);
+ //m_log.WarnFormat("[OSP RESOLVER]: Ignoring non-tuple component {0} in OSPA {1}", tuple, ospa);
continue;
}
@@ -167,7 +163,7 @@ protected static UUID ResolveOspaName(string name, IUserAccountService userServi
if (nameSeparatorIndex < 0)
{
- m_log.WarnFormat("[OSP RESOLVER]: Ignoring unseparated name {0}", name);
+ //m_log.WarnFormat("[OSP RESOLVER]: Ignoring unseparated name {0}", name);
return UUID.Zero;
}
@@ -177,7 +173,7 @@ protected static UUID ResolveOspaName(string name, IUserAccountService userServi
UserAccount account = userService.GetUserAccount(UUID.Zero, firstName, lastName);
if (account != null)
{
-// m_log.DebugFormat(
+// //m_log.DebugFormat(
// "[OSP RESOLVER]: Found user account with uuid {0} for {1} {2}",
// account.PrincipalID, firstName, lastName);
@@ -185,7 +181,7 @@ protected static UUID ResolveOspaName(string name, IUserAccountService userServi
}
// else
// {
-// m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name);
+// //m_log.DebugFormat("[OSP RESOLVER]: No resolved OSPA user account for {0}", name);
// }
// XXX: Disable temporary user profile creation for now as implementation is incomplete - justincc
@@ -195,7 +191,7 @@ protected static UUID ResolveOspaName(string name, IUserAccountService userServi
tempUserProfile.SurName = lastName;
tempUserProfile.ID = HashName(tempUserProfile.Name);
- m_log.DebugFormat(
+ //m_log.DebugFormat(
"[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID);
commsManager.UserService.AddTemporaryUserProfile(tempUserProfile);
diff --git a/Source/OpenSim.Framework.Serialization/External/RegionSettingsSerializer.cs b/Source/OpenSim.Framework.Serialization/External/RegionSettingsSerializer.cs
index 8341e04a567..81e6a2d51c7 100644
--- a/Source/OpenSim.Framework.Serialization/External/RegionSettingsSerializer.cs
+++ b/Source/OpenSim.Framework.Serialization/External/RegionSettingsSerializer.cs
@@ -25,13 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System.IO;
using System.Text;
using System.Xml;
using OpenMetaverse;
-using OpenSim.Framework;
-using log4net;
-using System.Reflection;
namespace OpenSim.Framework.Serialization.External
{
diff --git a/Source/OpenSim.Framework.Serialization/External/UserInventoryItemSerializer.cs b/Source/OpenSim.Framework.Serialization/External/UserInventoryItemSerializer.cs
index e8c811892a1..e15d20b60ab 100644
--- a/Source/OpenSim.Framework.Serialization/External/UserInventoryItemSerializer.cs
+++ b/Source/OpenSim.Framework.Serialization/External/UserInventoryItemSerializer.cs
@@ -25,16 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
using System.Text;
using System.Xml;
-
-using log4net;
using OpenMetaverse;
-using OpenSim.Framework;
using OpenSim.Services.Interfaces;
namespace OpenSim.Framework.Serialization.External
@@ -44,8 +37,6 @@ namespace OpenSim.Framework.Serialization.External
///
public class UserInventoryItemSerializer
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static Dictionary> m_InventoryItemXmlProcessors
= new Dictionary>();
diff --git a/Source/OpenSim.Framework.Serialization/OpenSim.Framework.Serialization.csproj b/Source/OpenSim.Framework.Serialization/OpenSim.Framework.Serialization.csproj
index 30f2ef90cc2..95b37600e14 100644
--- a/Source/OpenSim.Framework.Serialization/OpenSim.Framework.Serialization.csproj
+++ b/Source/OpenSim.Framework.Serialization/OpenSim.Framework.Serialization.csproj
@@ -25,7 +25,5 @@
-
-
diff --git a/Source/OpenSim.Framework.Serialization/TarArchiveReader.cs b/Source/OpenSim.Framework.Serialization/TarArchiveReader.cs
index 339a37ad11f..a018279bf31 100644
--- a/Source/OpenSim.Framework.Serialization/TarArchiveReader.cs
+++ b/Source/OpenSim.Framework.Serialization/TarArchiveReader.cs
@@ -25,11 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
-using System.Reflection;
using System.Text;
-using log4net;
namespace OpenSim.Framework.Serialization
{
@@ -38,8 +34,6 @@ namespace OpenSim.Framework.Serialization
///
public class TarArchiveReader
{
- //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public enum TarEntryType
{
TYPE_UNKNOWN = 0,
diff --git a/Source/OpenSim.Framework.Serialization/TarArchiveWriter.cs b/Source/OpenSim.Framework.Serialization/TarArchiveWriter.cs
index fbd88af791a..349d791cd96 100644
--- a/Source/OpenSim.Framework.Serialization/TarArchiveWriter.cs
+++ b/Source/OpenSim.Framework.Serialization/TarArchiveWriter.cs
@@ -25,12 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
using System.Text;
-using log4net;
namespace OpenSim.Framework.Serialization
{
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/BaseHttpServer.cs b/Source/OpenSim.Framework.Servers.HttpServer/BaseHttpServer.cs
index cbeb9b13674..4ff28780777 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/BaseHttpServer.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/BaseHttpServer.cs
@@ -1980,7 +1980,7 @@ public void Start(bool performPollResponsesAsync, bool runPool)
{
if (runPool)
{
- m_pollServiceManager ??= new PollServiceRequestManager(performPollResponsesAsync, 2, 25000);
+ m_pollServiceManager ??= new PollServiceRequestManager(m_logger, performPollResponsesAsync, 2, 25000);
m_pollServiceManager.Start();
}
}
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/BaseStreamHandlerBasicDOSProtector.cs b/Source/OpenSim.Framework.Servers.HttpServer/BaseStreamHandlerBasicDOSProtector.cs
index b3b80985411..3837086b9aa 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/BaseStreamHandlerBasicDOSProtector.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/BaseStreamHandlerBasicDOSProtector.cs
@@ -25,8 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework.Servers.HttpServer
{
@@ -42,13 +41,13 @@ public abstract class BaseStreamHandlerBasicDOSProtector : BaseRequestHandler, I
private readonly BasicDosProtectorOptions _options;
private readonly BasicDOSProtector _dosProtector;
- protected BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, BasicDosProtectorOptions options) : this(httpMethod, path, null, null, options) {}
+ protected BaseStreamHandlerBasicDOSProtector(ILogger logger, string httpMethod, string path, BasicDosProtectorOptions options) : this(logger, httpMethod, path, null, null, options) {}
- protected BaseStreamHandlerBasicDOSProtector(string httpMethod, string path, string name, string description, BasicDosProtectorOptions options)
+ protected BaseStreamHandlerBasicDOSProtector(ILogger logger, string httpMethod, string path, string name, string description, BasicDosProtectorOptions options)
: base(httpMethod, path, name, description)
{
_options = options;
- _dosProtector = new BasicDOSProtector(_options);
+ _dosProtector = new BasicDOSProtector(logger, _options);
}
public virtual byte[] Handle(
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/GenericHTTPBasicDOSProtector.cs b/Source/OpenSim.Framework.Servers.HttpServer/GenericHTTPBasicDOSProtector.cs
index 98d33e4537c..3e77c8a733e 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/GenericHTTPBasicDOSProtector.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/GenericHTTPBasicDOSProtector.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using Microsoft.Extensions.Logging;
using System.Collections;
namespace OpenSim.Framework.Servers.HttpServer
@@ -37,13 +38,13 @@ public class GenericHTTPDOSProtector
private readonly BasicDosProtectorOptions _options;
private readonly BasicDOSProtector _dosProtector;
- public GenericHTTPDOSProtector(GenericHTTPMethod normalMethod, GenericHTTPMethod throttledMethod, BasicDosProtectorOptions options)
+ public GenericHTTPDOSProtector(ILogger logger, GenericHTTPMethod normalMethod, GenericHTTPMethod throttledMethod, BasicDosProtectorOptions options)
{
_normalMethod = normalMethod;
_throttledMethod = throttledMethod;
_options = options;
- _dosProtector = new BasicDOSProtector(_options);
+ _dosProtector = new BasicDOSProtector(logger, _options);
}
public Hashtable Process(Hashtable request)
{
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/JsonRpcRequestManager.cs b/Source/OpenSim.Framework.Servers.HttpServer/JsonRpcRequestManager.cs
index 4bd3a82b923..6dde6e8adc4 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/JsonRpcRequestManager.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/JsonRpcRequestManager.cs
@@ -25,15 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Reflection;
-using System.Text;
-using System.IO;
using OpenMetaverse.StructuredData;
using OpenMetaverse;
-using log4net;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework.Servers.HttpServer
{
@@ -42,10 +36,11 @@ namespace OpenSim.Framework.Servers.HttpServer
///
public class JsonRpcRequestManager
{
- static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly ILogger _logger;
- public JsonRpcRequestManager()
+ public JsonRpcRequestManager(ILogger logger)
{
+ _logger = logger;
}
///
@@ -95,29 +90,26 @@ public bool JsonRpcRequest(ref object parameters, string method, string uri, str
}
catch (Exception e)
{
- m_log.Debug(string.Format("JsonRpc request '{0}' to {1} failed", method, uri), e);
+ _logger.LogDebug(e, string.Format("JsonRpc request '{0}' to {1} failed", method, uri));
return false;
}
OSD osdtmp;
if (!outerResponse.TryGetValue("_Result", out osdtmp) || (osdtmp is not OSDMap response))
{
- m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
- method, uri, OSDParser.SerializeJsonString(outerResponse));
+ _logger.LogDebug($"JsonRpc request '{method}' to {uri} returned an invalid response: {OSDParser.SerializeJsonString(outerResponse)}");
return false;
}
if (response.TryGetValue("error", out osdtmp))
{
- m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
- method, uri, OSDParser.SerializeJsonString(osdtmp));
+ _logger.LogDebug($"JsonRpc request '{method}' to {uri} returned an error: {OSDParser.SerializeJsonString(osdtmp)}");
return false;
}
if (!response.TryGetValue("result", out osdtmp) || (osdtmp is not OSDMap resultmap))
{
- m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
- method, uri, OSDParser.SerializeJsonString(response));
+ _logger.LogDebug($"JsonRpc request '{method}' to {uri} returned an invalid response: {OSDParser.SerializeJsonString(response)}");
return false;
}
@@ -159,27 +151,25 @@ public bool JsonRpcRequest(ref OSD data, string method, string uri, string jsonI
OSDMap outerresponse;
try
{
- outerresponse = WebUtil.PostToService(uri, request, 10000, true);
+ outerresponse = WebUtil.PostToService( uri, request, 10000, true);
}
catch (Exception e)
{
- m_log.Debug(string.Format("JsonRpc request '{0}' to {1} failed", method, uri), e);
+ _logger.LogDebug(e, $"JsonRpc request '{method}' to {uri} failed");
return false;
}
OSD osdtmp;
if (!outerresponse.TryGetValue("_Result", out osdtmp) || (osdtmp is not OSDMap response))
{
- m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an invalid response: {2}",
- method, uri, OSDParser.SerializeJsonString(outerresponse));
+ _logger.LogDebug($"JsonRpc request '{method}' to {uri} returned an invalid response: {OSDParser.SerializeJsonString(outerresponse)}");
return false;
}
if (response.TryGetValue("error", out osdtmp))
{
data = osdtmp;
- m_log.DebugFormat("JsonRpc request '{0}' to {1} returned an error: {2}",
- method, uri, OSDParser.SerializeJsonString(osdtmp));
+ _logger.LogDebug($"JsonRpc request '{method}' to {uri} returned an error: {OSDParser.SerializeJsonString(osdtmp)}");
return false;
}
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/OSHttpRequest.cs b/Source/OpenSim.Framework.Servers.HttpServer/OSHttpRequest.cs
index 49b728400a9..4360574de8d 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/OSHttpRequest.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/OSHttpRequest.cs
@@ -25,24 +25,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Collections.Generic;
using System.Collections.Specialized;
-using System.IO;
using System.Net;
-using System.Reflection;
using System.Text;
-using System.Web;
+
using OSHttpServer;
-using log4net;
namespace OpenSim.Framework.Servers.HttpServer
{
public class OSHttpRequest : IOSHttpRequest
{
- private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
protected IHttpRequest m_request = null;
protected IHttpClientContext m_context = null;
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/OpenSim.Framework.Servers.HttpServer.csproj b/Source/OpenSim.Framework.Servers.HttpServer/OpenSim.Framework.Servers.HttpServer.csproj
index bbedd7eeabd..959e2f82f9b 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/OpenSim.Framework.Servers.HttpServer.csproj
+++ b/Source/OpenSim.Framework.Servers.HttpServer/OpenSim.Framework.Servers.HttpServer.csproj
@@ -8,8 +8,6 @@
-
-
@@ -28,6 +26,5 @@
-
\ No newline at end of file
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/PollServiceHttpRequest.cs b/Source/OpenSim.Framework.Servers.HttpServer/PollServiceHttpRequest.cs
index cea86b1e5e4..de6797b8145 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/PollServiceHttpRequest.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/PollServiceHttpRequest.cs
@@ -25,22 +25,16 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Collections.Generic;
using System.Net;
-using System.Reflection;
using System.Text;
using OSHttpServer;
-using log4net;
using OpenMetaverse;
namespace OpenSim.Framework.Servers.HttpServer
{
public class PollServiceHttpRequest
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public readonly PollServiceEventArgs PollServiceArgs;
public readonly IHttpRequest Request;
public readonly int RequestTime;
@@ -198,14 +192,14 @@ internal void DoHTTPGruntWork(Hashtable responsedata)
}
catch (Exception ex)
{
- if(ex is System.Net.Sockets.SocketException)
- {
- // only mute connection reset by peer so we are not totally blind for now
- if(((System.Net.Sockets.SocketException)ex).SocketErrorCode != System.Net.Sockets.SocketError.ConnectionReset)
- m_log.Warn("[POLL SERVICE WORKER THREAD]: Error ", ex);
- }
- else
- m_log.Warn("[POLL SERVICE WORKER THREAD]: Error ", ex);
+ //if(ex is System.Net.Sockets.SocketException)
+ //{
+ // // only mute connection reset by peer so we are not totally blind for now
+ // if(((System.Net.Sockets.SocketException)ex).SocketErrorCode != System.Net.Sockets.SocketError.ConnectionReset)
+ // m_log.Warn("[POLL SERVICE WORKER THREAD]: Error ", ex);
+ //}
+ //else
+ // m_log.Warn("[POLL SERVICE WORKER THREAD]: Error ", ex);
}
PollServiceArgs.RequestsHandled++;
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/PollServiceRequestManager.cs b/Source/OpenSim.Framework.Servers.HttpServer/PollServiceRequestManager.cs
index beb8d88ac20..0aa9fd3602a 100755
--- a/Source/OpenSim.Framework.Servers.HttpServer/PollServiceRequestManager.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/PollServiceRequestManager.cs
@@ -25,31 +25,26 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Threading;
-using System.Reflection;
-using log4net;
using OpenSim.Framework.Monitoring;
-using Amib.Threading;
-using System.Collections.Generic;
using System.Collections.Concurrent;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework.Servers.HttpServer
{
public class PollServiceRequestManager
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private readonly ConcurrentQueue m_retryRequests = new();
private readonly int m_WorkerThreadCount = 0;
private ObjectJobEngine m_workerPool;
private Thread m_retrysThread;
private bool m_running = false;
+ private readonly ILogger m_logger;
- public PollServiceRequestManager(bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout)
+ public PollServiceRequestManager(ILogger logger, bool performResponsesAsync, uint pWorkerThreadCount, int pTimeout)
{
+ m_logger = logger;
m_WorkerThreadCount = (int)pWorkerThreadCount;
}
@@ -59,7 +54,7 @@ public void Start()
return;
m_running = true;
- m_workerPool = new ObjectJobEngine(PoolWorkerJob, "PollServiceWorker", 4000, m_WorkerThreadCount);
+ m_workerPool = new ObjectJobEngine(m_logger, PoolWorkerJob, "PollServiceWorker", 4000, m_WorkerThreadCount);
m_retrysThread = WorkManager.StartThread(
CheckRetries,
@@ -173,7 +168,7 @@ private void PoolWorkerJob(object o)
}
catch (Exception e)
{
- m_log.Error($"Exception in poll service thread: {e}");
+ m_logger.LogError(e, $"Exception in poll service thread");
}
}
}
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/RestSessionService.cs b/Source/OpenSim.Framework.Servers.HttpServer/RestSessionService.cs
index a7349979100..87bc5fb8846 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/RestSessionService.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/RestSessionService.cs
@@ -25,14 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
-using log4net;
namespace OpenSim.Framework.Servers.HttpServer
{
@@ -185,9 +182,6 @@ private void AsyncCallback(IAsyncResult result)
public class RestDeserialiseSecureHandler : BaseOutputStreamHandler, IStreamHandler
where TRequest : new()
{
- private static readonly ILog m_log
- = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private RestDeserialiseMethod m_method;
private CheckIdentityMethod m_smethod;
@@ -216,7 +210,6 @@ protected override void ProcessRequest(string path, Stream request, Stream respo
}
catch (Exception e)
{
- m_log.Error("[REST]: Deserialization problem. Ignoring request. " + e);
fail = true;
}
}
@@ -240,9 +233,6 @@ protected override void ProcessRequest(string path, Stream request, Stream respo
public class RestDeserialiseTrustedHandler : BaseOutputStreamHandler, IStreamHandler
where TRequest : new()
{
- private static readonly ILog m_log
- = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// The operation to perform once trust has been established.
///
@@ -276,7 +266,6 @@ protected override void ProcessRequest(string path, Stream request, Stream respo
}
catch (Exception e)
{
- m_log.Error("[REST]: Deserialization problem. Ignoring request. " + e);
fail = true;
}
}
diff --git a/Source/OpenSim.Framework.Servers.HttpServer/XmlRpcBasicDOSProtector.cs b/Source/OpenSim.Framework.Servers.HttpServer/XmlRpcBasicDOSProtector.cs
index 6b2c0ab801c..21c3305bd50 100644
--- a/Source/OpenSim.Framework.Servers.HttpServer/XmlRpcBasicDOSProtector.cs
+++ b/Source/OpenSim.Framework.Servers.HttpServer/XmlRpcBasicDOSProtector.cs
@@ -26,8 +26,8 @@
*/
using System.Net;
+using Microsoft.Extensions.Logging;
using Nwc.XmlRpc;
-using OpenSim.Framework;
namespace OpenSim.Framework.Servers.HttpServer
@@ -40,13 +40,13 @@ public class XmlRpcBasicDOSProtector
private readonly BasicDosProtectorOptions _options;
private readonly BasicDOSProtector _dosProtector;
- public XmlRpcBasicDOSProtector(XmlRpcMethod normalMethod, XmlRpcMethod throttledMethod,BasicDosProtectorOptions options)
+ public XmlRpcBasicDOSProtector(ILogger logger, XmlRpcMethod normalMethod, XmlRpcMethod throttledMethod,BasicDosProtectorOptions options)
{
_normalMethod = normalMethod;
_throttledMethod = throttledMethod;
_options = options;
- _dosProtector = new BasicDOSProtector(_options);
+ _dosProtector = new BasicDOSProtector(logger, _options);
}
public XmlRpcResponse Process(XmlRpcRequest request, IPEndPoint client)
diff --git a/Source/OpenSim.Framework.Servers/BaseOpenSimServer.cs b/Source/OpenSim.Framework.Servers/BaseOpenSimServer.cs
index 35910a14850..7ff2b9bdd82 100644
--- a/Source/OpenSim.Framework.Servers/BaseOpenSimServer.cs
+++ b/Source/OpenSim.Framework.Servers/BaseOpenSimServer.cs
@@ -25,23 +25,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
using System.Text;
-using System.Threading;
using System.Timers;
using System.Net;
using System.Net.Security;
+using Timer = System.Timers.Timer;
+using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
-using log4net;
+
using OpenMetaverse;
-using OpenSim.Framework;
+
using OpenSim.Framework.Monitoring;
using OpenSim.Framework.Servers.HttpServer;
-using Timer=System.Timers.Timer;
-using Nini.Config;
-using System.Runtime.InteropServices;
+
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
diff --git a/Source/OpenSim.Framework.Servers/OpenSim.Framework.Servers.csproj b/Source/OpenSim.Framework.Servers/OpenSim.Framework.Servers.csproj
index b654ad426c1..9f85ebe06b9 100644
--- a/Source/OpenSim.Framework.Servers/OpenSim.Framework.Servers.csproj
+++ b/Source/OpenSim.Framework.Servers/OpenSim.Framework.Servers.csproj
@@ -100,10 +100,8 @@
-
-
-
+
diff --git a/Source/OpenSim.Framework.Servers/ServerBase.cs b/Source/OpenSim.Framework.Servers/ServerBase.cs
index 6671b2bd23e..91a53720f0f 100755
--- a/Source/OpenSim.Framework.Servers/ServerBase.cs
+++ b/Source/OpenSim.Framework.Servers/ServerBase.cs
@@ -26,14 +26,9 @@
*/
using System.Diagnostics;
-using System.Reflection;
using System.Runtime;
using System.Text;
using System.Text.RegularExpressions;
-using log4net;
-using log4net.Appender;
-using log4net.Core;
-using log4net.Repository;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using OpenSim.Framework.Console;
@@ -55,10 +50,6 @@ public class ServerBase
protected ICommandConsole m_console;
public ICommandConsole Console { get => m_console; set => m_console = value; }
- protected OpenSimAppender m_consoleAppender;
- protected FileAppender m_logFileAppender;
- protected FileAppender m_statsLogFileAppender;
-
protected DateTime m_startuptime;
protected string m_startupDirectory = Environment.CurrentDirectory;
@@ -115,14 +106,6 @@ public void RegisterCommonCommands()
m_console.Commands.AddCommand(
"General", false, "show uptime", "show uptime", "Show server uptime", HandleShow);
- m_console.Commands.AddCommand(
- "General", false, "get log level", "get log level", "Get the current console logging level",
- (mod, cmd) => ShowLogLevel());
-
- m_console.Commands.AddCommand(
- "General", false, "set log level", "set log level ",
- "Set the console logging level for this session.", HandleSetLogLevel);
-
m_console.Commands.AddCommand(
"General", false, "config get",
"config get [] []",
@@ -484,45 +467,6 @@ private void HandleConfig(string module, string[] cmd)
}
}
- private void HandleSetLogLevel(string module, string[] cmd)
- {
- if (cmd.Length != 4)
- {
- Notice("Usage: set log level ");
- return;
- }
-
- if (null == m_consoleAppender)
- {
- Notice("No appender named Console found (see the log4net config file for this executable)!");
- return;
- }
-
- string rawLevel = cmd[3];
-
- ILoggerRepository repository = LogManager.GetRepository();
- Level consoleLevel = repository.LevelMap[rawLevel];
-
- if (consoleLevel != null)
- m_consoleAppender.Threshold = consoleLevel;
- else
- Notice(
- "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
- rawLevel);
-
- ShowLogLevel();
- }
-
- private void ShowLogLevel()
- {
- if (null == m_consoleAppender)
- {
- Notice("No appender named Console found (see the log4net config file for this executable)!");
- return;
- }
- Notice("Console log level is {0}", m_consoleAppender.Threshold);
- }
-
protected virtual void HandleScript(string module, string[] parms)
{
if (parms.Length != 2)
@@ -583,8 +527,6 @@ protected void ShowInfo()
{
Notice(GetVersionText());
Notice("Startup directory: " + m_startupDirectory);
- if (null != m_consoleAppender)
- Notice(String.Format("Console log level: {0}", m_consoleAppender.Threshold));
}
///
diff --git a/Source/OpenSim.Framework/AgentCircuitData.cs b/Source/OpenSim.Framework/AgentCircuitData.cs
index 7242993a455..411cbd9db55 100644
--- a/Source/OpenSim.Framework/AgentCircuitData.cs
+++ b/Source/OpenSim.Framework/AgentCircuitData.cs
@@ -25,10 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Reflection;
-using System.Collections.Generic;
-using log4net;
+using Microsoft.Extensions.Logging;
+
using OpenMetaverse;
using OpenMetaverse.StructuredData;
@@ -40,8 +38,6 @@ namespace OpenSim.Framework
///
public class AgentCircuitData
{
- private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Avatar Unique Agent Identifier
///
@@ -173,8 +169,16 @@ public string Viewer
public Dictionary ServiceURLs;
+ private readonly ILogger? m_logger = null;
+
public AgentCircuitData()
{
+ m_logger = null;
+ }
+
+ public AgentCircuitData(ILogger logger)
+ {
+ m_logger = logger;
}
///
@@ -255,7 +259,6 @@ public OSDMap PackAgentCircuitData(EntityTransferContext ctx)
args["serviceurls"] = urls;
}
-
return args;
}
@@ -338,7 +341,7 @@ public void UnpackAgentCircuitData(OSDMap args)
if(args.TryGetValue("far", out tmpOSD))
startfar = (float)tmpOSD.AsReal();
- //m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos);
+ // m_logger?.LogInformation($"[AGENTCIRCUITDATA]: agentid={AgentID}, child={child}, startpos={startpos}");
try
{
@@ -353,16 +356,16 @@ public void UnpackAgentCircuitData(OSDMap args)
if (args.TryGetValue("packed_appearance", out tmpOSD) && (tmpOSD is OSDMap))
{
Appearance.Unpack((OSDMap)tmpOSD);
-// m_log.InfoFormat("[AGENTCIRCUITDATA] unpacked appearance");
+ m_logger?.LogDebug($"[AGENTCIRCUITDATA] unpacked appearance");
}
else
{
- m_log.Warn("[AGENTCIRCUITDATA]: failed to find a valid packed_appearance");
+ m_logger?.LogWarning("[AGENTCIRCUITDATA]: failed to find a valid packed_appearance");
}
}
catch (Exception e)
{
- m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message);
+ m_logger?.LogError(e, $"[AGENTCIRCUITDATA] failed to unpack appearance;");
}
ServiceURLs = new Dictionary();
diff --git a/Source/OpenSim.Framework/AgentCircuitManager.cs b/Source/OpenSim.Framework/AgentCircuitManager.cs
index 837c56d760f..7a6b807c385 100644
--- a/Source/OpenSim.Framework/AgentCircuitManager.cs
+++ b/Source/OpenSim.Framework/AgentCircuitManager.cs
@@ -25,7 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System.Collections.Generic;
using System.Runtime.InteropServices;
using OpenMetaverse;
@@ -75,6 +74,7 @@ public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID age
}
}
}
+
return new AuthenticateResponse();
}
diff --git a/Source/OpenSim.Framework/AvatarAppearance.cs b/Source/OpenSim.Framework/AvatarAppearance.cs
index 848f47cb3c6..b6a07dc6c81 100644
--- a/Source/OpenSim.Framework/AvatarAppearance.cs
+++ b/Source/OpenSim.Framework/AvatarAppearance.cs
@@ -25,12 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Reflection;
-using System.Collections.Generic;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
-using log4net;
using System.Text;
namespace OpenSim.Framework
@@ -41,26 +37,27 @@ namespace OpenSim.Framework
public class AvatarAppearance
{
// SL box diferent to size
- const float AVBOXAJUST = 0.2f;
+ private const float AVBOXAJUST = 0.2f;
+
// constrains for ubitode physics
- const float AVBOXMINX = 0.2f;
- const float AVBOXMINY = 0.3f;
- const float AVBOXMINZ = 1.2f;
+ private const float AVBOXMINX = 0.2f;
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private const float AVBOXMINY = 0.3f;
+ private const float AVBOXMINZ = 1.2f;
// this is viewer capabilities and weared things dependent
// should be only used as initial default value ( V1 viewers )
public const int VISUALPARAM_COUNT = 218;
// regions and viewer compatibility
- public readonly static int TEXTURE_COUNT = 45;
+ public static readonly int TEXTURE_COUNT = 45;
+
public const int TEXTURE_COUNT_PV7 = 29;
public const int BAKES_COUNT_PV7 = 6;
public const int MAXWEARABLE_PV7 = 16;
public const int MAXWEARABLE_LEGACY = 15;
- public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20, 40, 41, 42, 43, 44 };
+ public static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20, 40, 41, 42, 43, 44 };
protected int m_serial = 0;
protected byte[] m_visualparams;
@@ -104,11 +101,7 @@ public float AvatarFeetOffset
public Primitive.TextureEntry Texture
{
get { return m_texture; }
- set
- {
-// m_log.DebugFormat("[AVATAR APPEARANCE]: Set TextureEntry to {0}", value);
- m_texture = value;
- }
+ set { m_texture = value; }
}
public AvatarWearable[] Wearables
@@ -133,29 +126,23 @@ public WearableCacheItem[] WearableCacheItems
public AvatarAppearance()
{
-// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
-
m_serial = 0;
SetDefaultWearables();
SetDefaultTexture();
SetDefaultParams();
-// SetHeight();
- SetSize(new Vector3(0.45f,0.6f,1.9f));
+ // SetHeight();
+ SetSize(new Vector3(0.45f, 0.6f, 1.9f));
m_attachments = new Dictionary>();
}
public AvatarAppearance(OSDMap map)
{
-// m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap");
-
Unpack(map);
-// SetHeight(); done in Unpack
+ // SetHeight(); done in Unpack
}
public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams)
{
-// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance");
-
m_serial = 0;
if (wearables != null)
@@ -173,14 +160,14 @@ public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textu
else
SetDefaultParams();
-// SetHeight();
- if(m_avatarHeight == 0)
- SetSize(new Vector3(0.45f,0.6f,1.9f));
+ // SetHeight();
+ if (m_avatarHeight == 0)
+ SetSize(new Vector3(0.45f, 0.6f, 1.9f));
m_attachments = new Dictionary>();
}
- public AvatarAppearance(AvatarAppearance appearance): this(appearance, true,true)
+ public AvatarAppearance(AvatarAppearance appearance) : this(appearance, true, true)
{
}
@@ -191,7 +178,7 @@ public AvatarAppearance(AvatarAppearance appearance, bool copyWearables)
public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool copyBaked)
{
-// m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
+ // //m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
if (appearance == null)
{
@@ -199,7 +186,7 @@ public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool co
SetDefaultWearables();
SetDefaultTexture();
SetDefaultParams();
-// SetHeight();
+ // SetHeight();
SetSize(new Vector3(0.45f, 0.6f, 1.9f));
AvatarPreferencesHoverZ = 0;
m_attachments = new Dictionary>();
@@ -218,17 +205,20 @@ public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool co
m_wearables[i] = new AvatarWearable();
AvatarWearable wearable = appearance.Wearables[i];
for (int j = 0; j < wearable.Count; j++)
- m_wearables[i].Add(wearable[j].ItemID, wearable[j].AssetID);
- }
+ m_wearables[i].Add(wearable[j].ItemID, wearable[j].AssetID);
+ }
}
else
+ {
ClearWearables();
+ }
m_texture = null;
+
if (appearance.Texture != null)
{
byte[] tbytes = appearance.Texture.GetBakesBytes();
- m_texture = new Primitive.TextureEntry(tbytes,0,tbytes.Length);
+ m_texture = new Primitive.TextureEntry(tbytes, 0, tbytes.Length);
if (copyBaked && appearance.m_cacheitems != null)
m_cacheitems = (WearableCacheItem[])appearance.m_cacheitems.Clone();
else
@@ -239,7 +229,7 @@ public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool co
if (appearance.VisualParams != null)
m_visualparams = (byte[])appearance.VisualParams.Clone();
-// m_avatarHeight = appearance.m_avatarHeight;
+ // m_avatarHeight = appearance.m_avatarHeight;
SetSize(appearance.AvatarSize);
// Copy the attachment, force append mode since that ensures consistency
@@ -250,14 +240,14 @@ public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool co
public void GetAssetsFrom(AvatarAppearance app)
{
- int len = m_wearables.Length;
- if(len > app.m_wearables.Length)
+ int len = m_wearables.Length;
+ if (len > app.m_wearables.Length)
len = app.m_wearables.Length;
for (int i = 0; i < len; i++)
{
- int count = m_wearables[i].Count;
- if(count > app.m_wearables[i].Count)
+ int count = m_wearables[i].Count;
+ if (count > app.m_wearables[i].Count)
count = app.m_wearables[i].Count;
for (int j = 0; j < count; j++)
@@ -289,8 +279,6 @@ protected void SetDefaultWearables()
///
public void ResetAppearance()
{
-// m_log.WarnFormat("[AVATAR APPEARANCE]: Reset appearance");
-
m_serial = 0;
SetDefaultTexture();
@@ -305,7 +293,7 @@ public void ResetAppearance()
protected void SetDefaultParams()
{
- m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 };
+ m_visualparams = new byte[] { 33, 61, 85, 23, 58, 127, 63, 85, 63, 42, 0, 85, 63, 36, 85, 95, 153, 63, 34, 0, 63, 109, 88, 132, 63, 136, 81, 85, 103, 136, 127, 0, 150, 150, 150, 127, 0, 0, 0, 0, 0, 127, 0, 0, 255, 127, 114, 127, 99, 63, 127, 140, 127, 127, 0, 0, 0, 191, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 216, 133, 0, 127, 0, 127, 170, 0, 0, 127, 127, 109, 85, 127, 127, 63, 85, 42, 150, 150, 150, 150, 150, 150, 150, 25, 150, 150, 150, 0, 127, 0, 0, 144, 85, 127, 132, 127, 85, 0, 127, 127, 127, 127, 127, 127, 59, 127, 85, 127, 127, 106, 47, 79, 127, 127, 204, 2, 141, 66, 0, 0, 127, 127, 0, 0, 0, 0, 127, 0, 159, 0, 0, 178, 127, 36, 85, 131, 127, 127, 127, 153, 95, 0, 140, 75, 27, 127, 127, 0, 150, 150, 198, 0, 0, 63, 30, 127, 165, 209, 198, 127, 127, 153, 204, 51, 51, 255, 255, 255, 204, 0, 255, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 0, 150, 150, 150, 150, 150, 0, 127, 127, 150, 150, 150, 150, 150, 150, 150, 150, 0, 0, 150, 51, 132, 150, 150, 150 };
}
///
@@ -341,6 +329,7 @@ public bool SetTextureEntries(Primitive.TextureEntry textureEntry)
//make sure textureEntry.DefaultTexture is the unused one(DEFAULT_AVATAR_TEXTURE).
Primitive.TextureEntry converted = new Primitive.TextureEntry(AppearanceManager.DEFAULT_AVATAR_TEXTURE);
+
for (uint i = 0; i < TEXTURE_COUNT; ++i)
{
newface = textureEntry.GetFace(i);
@@ -360,8 +349,12 @@ public bool SetTextureEntries(Primitive.TextureEntry textureEntry)
changed = true;
}
}
- if(changed)
+
+ if (changed)
+ {
m_texture = converted;
+ }
+
return changed;
}
@@ -391,15 +384,10 @@ public bool SetVisualParams(byte[] visualParams)
}
else
{
-
for (int i = 0; i < newsize; i++)
{
if (visualParams[i] != m_visualparams[i])
{
- // DEBUG ON
- // m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
- // i,m_visualparams[i],visualParams[i]);
- // DEBUG OFF
m_visualparams[i] = visualParams[i];
changed = true;
}
@@ -423,20 +411,20 @@ public void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualPara
///
public void SetHeight()
{
-/*
- // Start with shortest possible female avatar height
- m_avatarHeight = 1.14597f;
- // Add offset for male avatars
- if (m_visualparams[(int)VPElement.SHAPE_MALE] != 0)
- m_avatarHeight += 0.0848f;
- // Add offsets for visual params
- m_avatarHeight += 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f
- + 0.08117f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f
- + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f
- + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f
- + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f
- + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f;
-*/
+ /*
+ // Start with shortest possible female avatar height
+ m_avatarHeight = 1.14597f;
+ // Add offset for male avatars
+ if (m_visualparams[(int)VPElement.SHAPE_MALE] != 0)
+ m_avatarHeight += 0.0848f;
+ // Add offsets for visual params
+ m_avatarHeight += 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f
+ + 0.08117f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f
+ + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f
+ + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f
+ + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f
+ + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f;
+ */
}
public void SetSize(Vector3 avSize)
@@ -469,22 +457,23 @@ public void SetSize(Vector3 avSize)
public void SetWearable(int wearableId, AvatarWearable wearable)
{
-// DEBUG ON
-// m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
-// DEBUG OFF
if (wearableId >= m_wearables.Length)
{
int currentLength = m_wearables.Length;
Array.Resize(ref m_wearables, wearableId + 1);
- for (int i = currentLength ; i < m_wearables.Length ; i++)
+ for (int i = currentLength; i < m_wearables.Length; i++)
m_wearables[i] = new AvatarWearable();
}
+
m_wearables[wearableId].Clear();
+
for (int i = 0; i < wearable.Count; i++)
+ {
m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
+ }
}
-// DEBUG ON
+ // DEBUG ON
public override String ToString()
{
StringBuilder sb = new();
@@ -511,7 +500,6 @@ public override String ToString()
return sb.ToString();
}
-// DEBUG OFF
///
/// Get a list of the attachments.
@@ -535,7 +523,7 @@ public List GetAttachments()
internal void AppendAttachment(AvatarAttachment attach)
{
- //m_log.DebugFormat(
+ ////m_log.DebugFormat(
// "[AVATAR APPEARNCE]: Appending itemID={0}, assetID={1} at {2}",
// attach.ItemID, attach.AssetID, attach.AttachPoint);
@@ -556,7 +544,7 @@ internal void AppendAttachment(AvatarAttachment attach)
internal void ReplaceAttachment(AvatarAttachment attach)
{
- //m_log.DebugFormat(
+ ////m_log.DebugFormat(
// "[AVATAR APPEARANCE]: Replacing itemID={0}, assetID={1} at {2}",
// attach.ItemID, attach.AssetID, attach.AttachPoint);
@@ -584,10 +572,6 @@ internal void ReplaceAttachment(AvatarAttachment attach)
///
public bool SetAttachment(int attachpoint, UUID item, UUID asset)
{
- //m_log.DebugFormat(
- // "[AVATAR APPEARANCE]: Setting attachment at {0} with item ID {1}, asset ID {2}",
- // attachpoint, item, asset);
-
if (attachpoint == 0)
return false;
@@ -605,19 +589,14 @@ public bool SetAttachment(int attachpoint, UUID item, UUID asset)
AvatarAttachment existingAttachment = GetAttachmentForItem(item);
if (existingAttachment != null)
{
-// m_log.DebugFormat(
-// "[AVATAR APPEARANCE]: Found existing attachment for {0}, asset {1} at point {2}",
-// existingAttachment.ItemID, existingAttachment.AssetID, existingAttachment.AttachPoint);
-
if (!existingAttachment.AssetID.IsZero() && existingAttachment.AttachPoint == (attachpoint & 0x7F))
{
- m_log.Debug($"[AVATAR APPEARANCE]: Ignoring attach of an already attached item {item} at point {attachpoint}");
return false;
}
else
{
- // Remove it here so that the later append does not add a second attachment but we still update
- // the assetID
+ // Remove it here so that the later append does not add a second attachment
+ // but we still update the assetID
DetachAttachment(existingAttachment.ItemID);
}
}
@@ -631,7 +610,7 @@ public bool SetAttachment(int attachpoint, UUID item, UUID asset)
}
else
{
- ReplaceAttachment(new AvatarAttachment(attachpoint,item, asset));
+ ReplaceAttachment(new AvatarAttachment(attachpoint, item, asset));
}
}
@@ -649,7 +628,7 @@ public AvatarAttachment GetAttachmentForItem(UUID itemID)
{
foreach (KeyValuePair> kvp in m_attachments)
{
- int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID.Equals(itemID); });
+ int index = kvp.Value.FindIndex(delegate (AvatarAttachment a) { return a.ItemID.Equals(itemID); });
if (index >= 0)
return kvp.Value[index];
}
@@ -664,7 +643,7 @@ public int GetAttachpoint(UUID itemID)
{
foreach (KeyValuePair> kvp in m_attachments)
{
- int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID.Equals(itemID); });
+ int index = kvp.Value.FindIndex(delegate (AvatarAttachment a) { return a.ItemID.Equals(itemID); });
if (index >= 0)
return kvp.Key;
}
@@ -678,13 +657,9 @@ public bool DetachAttachment(UUID itemID)
{
foreach (KeyValuePair> kvp in m_attachments)
{
- int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID.Equals(itemID); });
+ int index = kvp.Value.FindIndex(delegate (AvatarAttachment a) { return a.ItemID.Equals(itemID); });
if (index >= 0)
{
- //m_log.DebugFormat(
- // "[AVATAR APPEARANCE]: Detaching attachment {0}, index {1}, point {2}",
- // m_attachments[kvp.Key][index].ItemID, index, m_attachments[kvp.Key][index].AttachPoint);
-
// Remove it from the list of attachments at that attach point
m_attachments[kvp.Key].RemoveAt(index);
@@ -731,7 +706,7 @@ public OSDMap Pack(EntityTransferContext ctx)
count = MAXWEARABLE_LEGACY;
else
{
- if(ctx.OutboundVersion >= 0.8)
+ if (ctx.OutboundVersion >= 0.8)
{
sendPV8 = true;
count = m_wearables.Length;
@@ -752,7 +727,7 @@ public OSDMap Pack(EntityTransferContext ctx)
}
}
- if(count > m_wearables.Length)
+ if (count > m_wearables.Length)
count = m_wearables.Length;
wears = new OSDArray(count);
@@ -811,7 +786,7 @@ public OSDMap PackForNotecard(bool NoHuds = true)
// old regions may not like missing/empty wears
OSDArray wears = new OSDArray(MAXWEARABLE_LEGACY);
- for (int i = 0; i< MAXWEARABLE_LEGACY; ++i)
+ for (int i = 0; i < MAXWEARABLE_LEGACY; ++i)
wears.Add(new OSDArray());
data["wearables"] = wears;
@@ -876,16 +851,13 @@ public void Unpack(OSDMap data)
SetDefaultParams();
m_attachments = new Dictionary>();
- if(data == null)
- {
- m_log.Warn("[AVATAR APPEARANCE]: data to unpack is null");
+ if (data == null)
return;
- }
OSD tmpOSD;
if (data.TryGetValue("serial", out tmpOSD))
m_serial = tmpOSD.AsInteger();
- if(data.TryGetValue("aphz", out tmpOSD))
+ if (data.TryGetValue("aphz", out tmpOSD))
AvatarPreferencesHoverZ = (float)tmpOSD.AsReal();
if (data.TryGetValue("height", out tmpOSD))
SetSize(new Vector3(0.45f, 0.6f, (float)tmpOSD.AsReal()));
@@ -906,7 +878,7 @@ public void Unpack(OSDMap data)
if (data.TryGetValue("wearables", out tmpOSD) && (tmpOSD is OSDArray))
{
OSDArray wears = (OSDArray)tmpOSD;
- if(wears.Count + wears8Count > 0)
+ if (wears.Count + wears8Count > 0)
{
m_wearables = new AvatarWearable[wears.Count + wears8Count];
@@ -976,7 +948,7 @@ public void Unpack(OSDMap data)
}
else
{
- m_log.Warn("[AVATAR APPEARANCE]: failed to unpack visual parameters");
+ //m_log.Warn("[AVATAR APPEARANCE]: failed to unpack visual parameters");
}
// Attachments
@@ -988,7 +960,7 @@ public void Unpack(OSDMap data)
AvatarAttachment att = new AvatarAttachment((OSDMap)attachs[i]);
AppendAttachment(att);
- //m_log.DebugFormat(
+ ////m_log.DebugFormat(
// "[AVATAR APPEARANCE]: Unpacked attachment itemID {0}, assetID {1}, point {2}",
// att.ItemID, att.AssetID, att.AttachPoint);
}
@@ -996,11 +968,11 @@ public void Unpack(OSDMap data)
}
catch (Exception e)
{
- m_log.ErrorFormat("[AVATAR APPEARANCE]: unpack failed badly: {0}{1}", e.Message, e.StackTrace);
+ //m_log.ErrorFormat("[AVATAR APPEARANCE]: unpack failed badly: {0}{1}", e.Message, e.StackTrace);
}
}
- #endregion
+ #endregion Packing Functions
public bool CanTeleport(float version)
{
@@ -1008,9 +980,9 @@ public bool CanTeleport(float version)
return true;
if (m_wearables.Length <= MAXWEARABLE_PV7)
return true;
- for(int i = MAXWEARABLE_PV7; i < m_wearables.Length; ++i)
+ for (int i = MAXWEARABLE_PV7; i < m_wearables.Length; ++i)
{
- if(m_wearables[i].Count > 0)
+ if (m_wearables[i].Count > 0)
return false;
}
@@ -1040,658 +1012,826 @@ public enum VPElement : int
/// Brow Size - Small 0--+255 Large
///
SHAPE_BIG_BROW = 0,
+
///
/// Nose Size - Small 0--+255 Large
///
SHAPE_NOSE_BIG_OUT = 1,
+
///
/// Nostril Width - Narrow 0--+255 Broad
///
SHAPE_BROAD_NOSTRILS = 2,
+
///
/// Chin Cleft - Round 0--+255 Cleft
///
SHAPE_CLEFT_CHIN = 3,
+
///
/// Nose Tip Shape - Pointy 0--+255 Bulbous
///
SHAPE_BULBOUS_NOSE_TIP = 4,
+
///
/// Chin Angle - Chin Out 0--+255 Chin In
///
SHAPE_WEAK_CHIN = 5,
+
///
/// Chin-Neck - Tight Chin 0--+255 Double Chin
///
SHAPE_DOUBLE_CHIN = 6,
+
///
/// Lower Cheeks - Well-Fed 0--+255 Sunken
///
SHAPE_SUNKEN_CHEEKS = 7,
+
///
/// Upper Bridge - Low 0--+255 High
///
SHAPE_NOBLE_NOSE_BRIDGE = 8,
+
///
/// - Less 0--+255 More
///
SHAPE_JOWLS = 9,
+
///
/// Upper Chin Cleft - Round 0--+255 Cleft
///
SHAPE_CLEFT_CHIN_UPPER = 10,
+
///
/// Cheek Bones - Low 0--+255 High
///
SHAPE_HIGH_CHEEK_BONES = 11,
+
///
/// Ear Angle - In 0--+255 Out
///
SHAPE_EARS_OUT = 12,
+
///
/// Eyebrow Points - Smooth 0--+255 Pointy
///
HAIR_POINTY_EYEBROWS = 13,
+
///
/// Jaw Shape - Pointy 0--+255 Square
///
SHAPE_SQUARE_JAW = 14,
+
///
/// Upper Cheeks - Thin 0--+255 Puffy
///
SHAPE_PUFFY_UPPER_CHEEKS = 15,
+
///
/// Nose Tip Angle - Downturned 0--+255 Upturned
///
SHAPE_UPTURNED_NOSE_TIP = 16,
+
///
/// Nose Thickness - Thin Nose 0--+255 Bulbous Nose
///
SHAPE_BULBOUS_NOSE = 17,
+
///
/// Upper Eyelid Fold - Uncreased 0--+255 Creased
///
SHAPE_UPPER_EYELID_FOLD = 18,
+
///
/// Attached Earlobes - Unattached 0--+255 Attached
///
SHAPE_ATTACHED_EARLOBES = 19,
+
///
/// Eye Bags - Smooth 0--+255 Baggy
///
SHAPE_BAGGY_EYES = 20,
+
///
/// Eye Opening - Narrow 0--+255 Wide
///
SHAPE_WIDE_EYES = 21,
+
///
/// Lip Cleft - Narrow 0--+255 Wide
///
SHAPE_WIDE_LIP_CLEFT = 22,
+
///
/// Bridge Width - Narrow 0--+255 Wide
///
SHAPE_WIDE_NOSE_BRIDGE = 23,
+
///
/// Eyebrow Arc - Flat 0--+255 Arced
///
HAIR_ARCED_EYEBROWS = 24,
+
///
/// Height - Short 0--+255 Tall
///
SHAPE_HEIGHT = 25,
+
///
/// Body Thickness - Body Thin 0--+255 Body Thick
///
SHAPE_THICKNESS = 26,
+
///
/// Ear Size - Small 0--+255 Large
///
SHAPE_BIG_EARS = 27,
+
///
/// Shoulders - Narrow 0--+255 Broad
///
SHAPE_SHOULDERS = 28,
+
///
/// Hip Width - Narrow 0--+255 Wide
///
SHAPE_HIP_WIDTH = 29,
+
///
/// - Short Torso 0--+255 Long Torso
///
SHAPE_TORSO_LENGTH = 30,
+
SHAPE_MALE = 31,
+
///
/// - Short 0--+255 Long
///
GLOVES_GLOVE_LENGTH = 32,
+
///
/// - Darker 0--+255 Lighter
///
EYES_EYE_LIGHTNESS = 33,
+
///
/// - Natural 0--+255 Unnatural
///
EYES_EYE_COLOR = 34,
+
///
/// - Small 0--+255 Large
///
SHAPE_BREAST_SIZE = 35,
+
///
/// - None 0--+255 Wild
///
SKIN_RAINBOW_COLOR = 36,
+
///
/// Ruddiness - Pale 0--+255 Ruddy
///
SKIN_RED_SKIN = 37,
+
///
/// - Light 0--+255 Dark
///
SKIN_PIGMENT = 38,
+
HAIR_RAINBOW_COLOR_39 = 39,
+
///
/// - No Red 0--+255 Very Red
///
HAIR_RED_HAIR = 40,
+
///
/// - Black 0--+255 Blonde
///
HAIR_BLONDE_HAIR = 41,
+
///
/// - No White 0--+255 All White
///
HAIR_WHITE_HAIR = 42,
+
///
/// - Less Rosy 0--+255 More Rosy
///
SKIN_ROSY_COMPLEXION = 43,
+
///
/// - Darker 0--+255 Pinker
///
SKIN_LIP_PINKNESS = 44,
+
///
/// - Thin Eyebrows 0--+255 Bushy Eyebrows
///
HAIR_EYEBROW_SIZE = 45,
+
///
/// - Short 0--+255 Long
///
HAIR_FRONT_FRINGE = 46,
+
///
/// - Short 0--+255 Long
///
HAIR_SIDE_FRINGE = 47,
+
///
/// - Short 0--+255 Long
///
HAIR_BACK_FRINGE = 48,
+
///
/// - Short 0--+255 Long
///
HAIR_HAIR_FRONT = 49,
+
///
/// - Short 0--+255 Long
///
HAIR_HAIR_SIDES = 50,
+
///
/// - Short 0--+255 Long
///
HAIR_HAIR_BACK = 51,
+
///
/// - Sweep Forward 0--+255 Sweep Back
///
HAIR_HAIR_SWEEP = 52,
+
///
/// - Left 0--+255 Right
///
HAIR_HAIR_TILT = 53,
+
///
/// Middle Part - No Part 0--+255 Part
///
HAIR_HAIR_PART_MIDDLE = 54,
+
///
/// Right Part - No Part 0--+255 Part
///
HAIR_HAIR_PART_RIGHT = 55,
+
///
/// Left Part - No Part 0--+255 Part
///
HAIR_HAIR_PART_LEFT = 56,
+
///
/// Full Hair Sides - Mowhawk 0--+255 Full Sides
///
HAIR_HAIR_SIDES_FULL = 57,
+
///
/// - Less 0--+255 More
///
SKIN_BODY_DEFINITION = 58,
+
///
/// Lip Width - Narrow Lips 0--+255 Wide Lips
///
SHAPE_LIP_WIDTH = 59,
+
///
/// - Small 0--+255 Big
///
SHAPE_BELLY_SIZE = 60,
+
///
/// - Less 0--+255 More
///
SKIN_FACIAL_DEFINITION = 61,
+
///
/// - Less 0--+255 More
///
SKIN_WRINKLES = 62,
+
///
/// - Less 0--+255 More
///
SKIN_FRECKLES = 63,
+
///
/// - Short Sideburns 0--+255 Mutton Chops
///
HAIR_SIDEBURNS = 64,
+
///
/// - Chaplin 0--+255 Handlebars
///
HAIR_MOUSTACHE = 65,
+
///
/// - Less soul 0--+255 More soul
///
HAIR_SOULPATCH = 66,
+
///
/// - Less Curtains 0--+255 More Curtains
///
HAIR_CHIN_CURTAINS = 67,
+
///
/// Rumpled Hair - Smooth Hair 0--+255 Rumpled Hair
///
HAIR_HAIR_RUMPLED = 68,
+
///
/// Big Hair Front - Less 0--+255 More
///
HAIR_HAIR_BIG_FRONT = 69,
+
///
/// Big Hair Top - Less 0--+255 More
///
HAIR_HAIR_BIG_TOP = 70,
+
///
/// Big Hair Back - Less 0--+255 More
///
HAIR_HAIR_BIG_BACK = 71,
+
///
/// Spiked Hair - No Spikes 0--+255 Big Spikes
///
HAIR_HAIR_SPIKED = 72,
+
///
/// Chin Depth - Shallow 0--+255 Deep
///
SHAPE_DEEP_CHIN = 73,
+
///
/// Part Bangs - No Part 0--+255 Part Bangs
///
HAIR_BANGS_PART_MIDDLE = 74,
+
///
/// Head Shape - More Square 0--+255 More Round
///
SHAPE_HEAD_SHAPE = 75,
+
///
/// Eye Spacing - Close Set Eyes 0--+255 Far Set Eyes
///
SHAPE_EYE_SPACING = 76,
+
///
/// - Low Heels 0--+255 High Heels
///
SHOES_HEEL_HEIGHT = 77,
+
///
/// - Low Platforms 0--+255 High Platforms
///
SHOES_PLATFORM_HEIGHT = 78,
+
///
/// - Thin Lips 0--+255 Fat Lips
///
SHAPE_LIP_THICKNESS = 79,
+
///
/// Mouth Position - High 0--+255 Low
///
SHAPE_MOUTH_HEIGHT = 80,
+
///
/// Breast Buoyancy - Less Gravity 0--+255 More Gravity
///
SHAPE_BREAST_GRAVITY = 81,
+
///
/// Platform Width - Narrow 0--+255 Wide
///
SHOES_SHOE_PLATFORM_WIDTH = 82,
+
///
/// - Pointy Heels 0--+255 Thick Heels
///
SHOES_HEEL_SHAPE = 83,
+
///
/// - Pointy 0--+255 Square
///
SHOES_TOE_SHAPE = 84,
+
///
/// Foot Size - Small 0--+255 Big
///
SHAPE_FOOT_SIZE = 85,
+
///
/// Nose Width - Narrow 0--+255 Wide
///
SHAPE_WIDE_NOSE = 86,
+
///
/// Eyelash Length - Short 0--+255 Long
///
SHAPE_EYELASHES_LONG = 87,
+
///
/// - Short 0--+255 Long
///
UNDERSHIRT_SLEEVE_LENGTH = 88,
+
///
/// - Short 0--+255 Long
///
UNDERSHIRT_BOTTOM = 89,
+
///
/// - Low 0--+255 High
///
UNDERSHIRT_COLLAR_FRONT = 90,
+
JACKET_SLEEVE_LENGTH_91 = 91,
JACKET_COLLAR_FRONT_92 = 92,
+
///
/// Jacket Length - Short 0--+255 Long
///
JACKET_BOTTOM_LENGTH_LOWER = 93,
+
///
/// Open Front - Open 0--+255 Closed
///
JACKET_OPEN_JACKET = 94,
+
///
/// - Short 0--+255 Tall
///
SHOES_SHOE_HEIGHT = 95,
+
///
/// - Short 0--+255 Long
///
SOCKS_SOCKS_LENGTH = 96,
+
///
/// - Short 0--+255 Long
///
UNDERPANTS_PANTS_LENGTH = 97,
+
///
/// - Low 0--+255 High
///
UNDERPANTS_PANTS_WAIST = 98,
+
///
/// Cuff Flare - Tight Cuffs 0--+255 Flared Cuffs
///
PANTS_LEG_PANTFLAIR = 99,
+
///
/// - More Vertical 0--+255 More Sloped
///
SHAPE_FOREHEAD_ANGLE = 100,
+
///
/// - Less Body Fat 0--+255 More Body Fat
///
SHAPE_BODY_FAT = 101,
+
///
/// Pants Crotch - High and Tight 0--+255 Low and Loose
///
PANTS_LOW_CROTCH = 102,
+
///
/// Egg Head - Chin Heavy 0--+255 Forehead Heavy
///
SHAPE_EGG_HEAD = 103,
+
///
/// Head Stretch - Squash Head 0--+255 Stretch Head
///
SHAPE_SQUASH_STRETCH_HEAD = 104,
+
///
/// Torso Muscles - Less Muscular 0--+255 More Muscular
///
SHAPE_TORSO_MUSCLES = 105,
+
///
/// Outer Eye Corner - Corner Down 0--+255 Corner Up
///
SHAPE_EYELID_CORNER_UP = 106,
+
///
/// - Less Muscular 0--+255 More Muscular
///
SHAPE_LEG_MUSCLES = 107,
+
///
/// Lip Fullness - Less Full 0--+255 More Full
///
SHAPE_TALL_LIPS = 108,
+
///
/// Toe Thickness - Flat Toe 0--+255 Thick Toe
///
SHOES_SHOE_TOE_THICK = 109,
+
///
/// Crooked Nose - Nose Left 0--+255 Nose Right
///
SHAPE_CROOKED_NOSE = 110,
+
///
/// - Corner Down 0--+255 Corner Up
///
SHAPE_MOUTH_CORNER = 111,
+
///
/// - Shear Right Up 0--+255 Shear Left Up
///
SHAPE_FACE_SHEAR = 112,
+
///
/// Shift Mouth - Shift Left 0--+255 Shift Right
///
SHAPE_SHIFT_MOUTH = 113,
+
///
/// Eye Pop - Pop Right Eye 0--+255 Pop Left Eye
///
SHAPE_POP_EYE = 114,
+
///
/// Jaw Jut - Overbite 0--+255 Underbite
///
SHAPE_JAW_JUT = 115,
+
///
/// Shear Back - Full Back 0--+255 Sheared Back
///
HAIR_HAIR_SHEAR_BACK = 116,
+
///
/// - Small Hands 0--+255 Large Hands
///
SHAPE_HAND_SIZE = 117,
+
///
/// Love Handles - Less Love 0--+255 More Love
///
SHAPE_LOVE_HANDLES = 118,
+
SHAPE_TORSO_MUSCLES_119 = 119,
+
///
/// Head Size - Small Head 0--+255 Big Head
///
SHAPE_HEAD_SIZE = 120,
+
///
/// - Skinny Neck 0--+255 Thick Neck
///
SHAPE_NECK_THICKNESS = 121,
+
///
/// Breast Cleavage - Separate 0--+255 Join
///
SHAPE_BREAST_FEMALE_CLEAVAGE = 122,
+
///
/// Pectorals - Big Pectorals 0--+255 Sunken Chest
///
SHAPE_CHEST_MALE_NO_PECS = 123,
+
///
/// Eye Size - Beady Eyes 0--+255 Anime Eyes
///
SHAPE_EYE_SIZE = 124,
+
///
/// - Short Legs 0--+255 Long Legs
///
SHAPE_LEG_LENGTH = 125,
+
///
/// - Short Arms 0--+255 Long arms
///
SHAPE_ARM_LENGTH = 126,
+
///
/// - Pink 0--+255 Black
///
SKIN_LIPSTICK_COLOR = 127,
+
///
/// - No Lipstick 0--+255 More Lipstick
///
SKIN_LIPSTICK = 128,
+
///
/// - No Lipgloss 0--+255 Glossy
///
SKIN_LIPGLOSS = 129,
+
///
/// - No Eyeliner 0--+255 Full Eyeliner
///
SKIN_EYELINER = 130,
+
///
/// - No Blush 0--+255 More Blush
///
SKIN_BLUSH = 131,
+
///
/// - Pink 0--+255 Orange
///
SKIN_BLUSH_COLOR = 132,
+
///
/// - Clear 0--+255 Opaque
///
SKIN_OUT_SHDW_OPACITY = 133,
+
///
/// - No Eyeshadow 0--+255 More Eyeshadow
///
SKIN_OUTER_SHADOW = 134,
+
///
/// - Light 0--+255 Dark
///
SKIN_OUT_SHDW_COLOR = 135,
+
///
/// - No Eyeshadow 0--+255 More Eyeshadow
///
SKIN_INNER_SHADOW = 136,
+
///
/// - No Polish 0--+255 Painted Nails
///
SKIN_NAIL_POLISH = 137,
+
///
/// - Clear 0--+255 Opaque
///
SKIN_BLUSH_OPACITY = 138,
+
///
/// - Light 0--+255 Dark
///
SKIN_IN_SHDW_COLOR = 139,
+
///
/// - Clear 0--+255 Opaque
///
SKIN_IN_SHDW_OPACITY = 140,
+
///
/// - Dark Green 0--+255 Black
///
SKIN_EYELINER_COLOR = 141,
+
///
/// - Pink 0--+255 Black
///
SKIN_NAIL_POLISH_COLOR = 142,
+
///
/// - Sparse 0--+255 Dense
///
HAIR_EYEBROW_DENSITY = 143,
+
///
/// - 5 O'Clock Shadow 0--+255 Bushy Hair
///
HAIR_HAIR_THICKNESS = 144,
+
///
/// Saddle Bags - Less Saddle 0--+255 More Saddle
///
SHAPE_SADDLEBAGS = 145,
+
///
/// Taper Back - Wide Back 0--+255 Narrow Back
///
HAIR_HAIR_TAPER_BACK = 146,
+
///
/// Taper Front - Wide Front 0--+255 Narrow Front
///
HAIR_HAIR_TAPER_FRONT = 147,
+
///
/// - Short Neck 0--+255 Long Neck
///
SHAPE_NECK_LENGTH = 148,
+
///
/// Eyebrow Height - Higher 0--+255 Lower
///
HAIR_LOWER_EYEBROWS = 149,
+
///
/// Lower Bridge - Low 0--+255 High
///
SHAPE_LOWER_BRIDGE_NOSE = 150,
+
///
/// Nostril Division - High 0--+255 Low
///
SHAPE_LOW_SEPTUM_NOSE = 151,
+
///
/// Jaw Angle - Low Jaw 0--+255 High Jaw
///
SHAPE_JAW_ANGLE = 152,
+
///
/// Shear Front - Full Front 0--+255 Sheared Front
///
HAIR_HAIR_SHEAR_FRONT = 153,
+
///
/// - Less Volume 0--+255 More Volume
///
HAIR_HAIR_VOLUME = 154,
+
///
/// Lip Cleft Depth - Shallow 0--+255 Deep
///
SHAPE_LIP_CLEFT_DEEP = 155,
+
///
/// Puffy Eyelids - Flat 0--+255 Puffy
///
SHAPE_PUFFY_LOWER_LIDS = 156,
+
///
/// - Sunken Eyes 0--+255 Bugged Eyes
///
SHAPE_EYE_DEPTH = 157,
+
///
/// - Flat Head 0--+255 Long Head
///
SHAPE_HEAD_LENGTH = 158,
+
///
/// - Less Freckles 0--+255 More Freckles
///
SKIN_BODY_FRECKLES = 159,
+
///
/// - Low 0--+255 High
///
UNDERSHIRT_COLLAR_BACK = 160,
+
JACKET_COLLAR_BACK_161 = 161,
SHIRT_COLLAR_BACK_162 = 162,
+
///
/// - Short Pigtails 0--+255 Long Pigtails
///
HAIR_PIGTAILS = 163,
+
///
/// - Short Ponytail 0--+255 Long Ponytail
///
HAIR_PONYTAIL = 164,
+
///
/// Butt Size - Flat Butt 0--+255 Big Butt
///
SHAPE_BUTT_SIZE = 165,
+
///
/// Ear Tips - Flat 0--+255 Pointy
///
SHAPE_POINTY_EARS = 166,
+
///
/// Lip Ratio - More Upper Lip 0--+255 More Lower Lip
///
SHAPE_LIP_RATIO = 167,
+
SHIRT_SLEEVE_LENGTH_168 = 168,
+
///
/// - Short 0--+255 Long
///
SHIRT_SHIRT_BOTTOM = 169,
+
SHIRT_COLLAR_FRONT_170 = 170,
SHIRT_SHIRT_RED = 171,
SHIRT_SHIRT_GREEN = 172,
@@ -1701,15 +1841,19 @@ public enum VPElement : int
PANTS_PANTS_BLUE = 176,
SHOES_SHOES_RED = 177,
SHOES_SHOES_GREEN = 178,
+
///
/// - Low 0--+255 High
///
PANTS_WAIST_HEIGHT = 179,
+
PANTS_PANTS_LENGTH_180 = 180,
+
///
/// Pants Fit - Tight Pants 0--+255 Loose Pants
///
PANTS_LOOSE_LOWER_CLOTHING = 181,
+
SHOES_SHOES_BLUE = 182,
SOCKS_SOCKS_RED = 183,
SOCKS_SOCKS_GREEN = 184,
@@ -1721,73 +1865,91 @@ public enum VPElement : int
UNDERPANTS_UNDERPANTS_GREEN = 190,
UNDERPANTS_UNDERPANTS_BLUE = 191,
GLOVES_GLOVES_RED = 192,
+
///
/// Shirt Fit - Tight Shirt 0--+255 Loose Shirt
///
SHIRT_LOOSE_UPPER_CLOTHING = 193,
+
GLOVES_GLOVES_GREEN = 194,
GLOVES_GLOVES_BLUE = 195,
JACKET_JACKET_RED = 196,
JACKET_JACKET_GREEN = 197,
JACKET_JACKET_BLUE = 198,
+
///
/// Sleeve Looseness - Tight Sleeves 0--+255 Loose Sleeves
///
SHIRT_SHIRTSLEEVE_FLAIR = 199,
+
///
/// Knee Angle - Knock Kneed 0--+255 Bow Legged
///
SHAPE_BOWED_LEGS = 200,
+
///
/// - Short hips 0--+255 Long Hips
///
SHAPE_HIP_LENGTH = 201,
+
///
/// - Fingerless 0--+255 Fingers
///
GLOVES_GLOVE_FINGERS = 202,
+
///
/// bustle skirt - no bustle 0--+255 more bustle
///
SKIRT_SKIRT_BUSTLE = 203,
+
///
/// - Short 0--+255 Long
///
SKIRT_SKIRT_LENGTH = 204,
+
///
/// - Open Front 0--+255 Closed Front
///
SKIRT_SLIT_FRONT = 205,
+
///
/// - Open Back 0--+255 Closed Back
///
SKIRT_SLIT_BACK = 206,
+
///
/// - Open Left 0--+255 Closed Left
///
SKIRT_SLIT_LEFT = 207,
+
///
/// - Open Right 0--+255 Closed Right
///
SKIRT_SLIT_RIGHT = 208,
+
///
/// Skirt Fit - Tight Skirt 0--+255 Poofy Skirt
///
SKIRT_SKIRT_LOOSENESS = 209,
+
SHIRT_SHIRT_WRINKLES = 210,
PANTS_PANTS_WRINKLES = 211,
+
///
/// Jacket Wrinkles - No Wrinkles 0--+255 Wrinkles
///
JACKET_JACKET_WRINKLES = 212,
+
///
/// Package - Coin Purse 0--+255 Duffle Bag
///
SHAPE_MALE_PACKAGE = 213,
+
///
/// Inner Eye Corner - Corner Down 0--+255 Corner Up
///
SHAPE_EYELID_INNER_CORNER_UP = 214,
+
SKIRT_SKIRT_RED = 215,
SKIRT_SKIRT_GREEN = 216,
SKIRT_SKIRT_BLUE = 217,
@@ -1800,6 +1962,7 @@ public enum VPElement : int
/// Breast Part 1
///
BREAST_PHYSICS_MASS = 218,
+
BREAST_PHYSICS_GRAVITY = 219,
BREAST_PHYSICS_DRAG = 220,
BREAST_PHYSICS_UPDOWN_MAX_EFFECT = 221,
@@ -1810,10 +1973,12 @@ public enum VPElement : int
BREAST_PHYSICS_INOUT_SPRING = 226,
BREAST_PHYSICS_INOUT_GAIN = 227,
BREAST_PHYSICS_INOUT_DAMPING = 228,
+
///
/// Belly
///
BELLY_PHYISCS_MASS = 229,
+
BELLY_PHYSICS_GRAVITY = 230,
BELLY_PHYSICS_DRAG = 231,
BELLY_PHYISCS_UPDOWN_MAX_EFFECT = 232,
@@ -1825,6 +1990,7 @@ public enum VPElement : int
/// Butt
///
BUTT_PHYSICS_MASS = 236,
+
BUTT_PHYSICS_GRAVITY = 237,
BUTT_PHYSICS_DRAG = 238,
BUTT_PHYSICS_UPDOWN_MAX_EFFECT = 239,
@@ -1835,11 +2001,13 @@ public enum VPElement : int
BUTT_PHYSICS_LEFTRIGHT_SPRING = 244,
BUTT_PHYSICS_LEFTRIGHT_GAIN = 245,
BUTT_PHYSICS_LEFTRIGHT_DAMPING = 246,
+
///
/// Breast Part 2
///
BREAST_PHYSICS_LEFTRIGHT_MAX_EFFECT = 247,
- BREAST_PHYSICS_LEFTRIGHT_SPRING= 248,
+
+ BREAST_PHYSICS_LEFTRIGHT_SPRING = 248,
BREAST_PHYSICS_LEFTRIGHT_GAIN = 249,
BREAST_PHYSICS_LEFTRIGHT_DAMPING = 250,
@@ -1848,6 +2016,7 @@ public enum VPElement : int
SHAPE_HOVER = 252, //ID 11001
}
- #endregion
+
+ #endregion VPElement
}
-}
+}
\ No newline at end of file
diff --git a/Source/OpenSim.Framework/BasicDOSProtector.cs b/Source/OpenSim.Framework/BasicDOSProtector.cs
index d1026088b24..c668f5655d4 100644
--- a/Source/OpenSim.Framework/BasicDOSProtector.cs
+++ b/Source/OpenSim.Framework/BasicDOSProtector.cs
@@ -24,14 +24,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using log4net;
+
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework
{
-
public class BasicDOSProtector
{
public enum ThrottleAction
@@ -45,11 +42,19 @@ public enum ThrottleAction
private readonly Dictionary _tempBlocked; // blocked list
private readonly Dictionary _sessions;
private readonly System.Timers.Timer _forgetTimer; // Cleanup timer
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
private readonly System.Threading.ReaderWriterLockSlim _blockLockSlim = new System.Threading.ReaderWriterLockSlim();
private readonly System.Threading.ReaderWriterLockSlim _sessionLockSlim = new System.Threading.ReaderWriterLockSlim();
- public BasicDOSProtector(BasicDosProtectorOptions options)
+
+ private readonly ILogger _logger;
+
+ public BasicDOSProtector(
+ ILogger logger,
+ BasicDosProtectorOptions options
+ )
{
+ _logger = logger;
+
_generalRequestTimes = new CircularBuffer(options.MaxRequestsInTimeframe + 1, true);
_generalRequestTimes.Put(0);
_options = options;
@@ -65,27 +70,31 @@ public BasicDOSProtector(BasicDosProtectorOptions options)
_blockLockSlim.EnterReadLock();
foreach (string str in _tempBlocked.Keys)
{
- if (
- Util.EnvironmentTickCountSubtract(Util.EnvironmentTickCount(),
- _tempBlocked[str]) > 0)
+ if (Util.EnvironmentTickCountSubtract(Util.EnvironmentTickCount(), _tempBlocked[str]) > 0)
removes.Add(str);
}
+
_blockLockSlim.ExitReadLock();
+
lock (_deeperInspection)
{
_blockLockSlim.EnterWriteLock();
+
for (int i = 0; i < removes.Count; i++)
{
_tempBlocked.Remove(removes[i]);
_deeperInspection.Remove(removes[i]);
_sessions.Remove(removes[i]);
}
+
_blockLockSlim.ExitWriteLock();
}
+
foreach (string str in removes)
{
- m_log.Info($"[{_options.ReportingName}] client: {str} is no longer blocked.");
+ _logger.LogInformation($"[{_options.ReportingName}] client: {str} is no longer blocked.");
}
+
_blockLockSlim.EnterReadLock();
if (_tempBlocked.Count > 0)
_forgetTimer.Enabled = true;
@@ -145,6 +154,7 @@ public bool Process(string key, string endpoint)
_sessionLockSlim.EnterReadLock();
if (_sessions.ContainsKey(key))
sessionscount = _sessions[key];
+
_sessionLockSlim.ExitReadLock();
if (sessionscount > _options.MaxConcurrentSessions)
@@ -159,7 +169,10 @@ public bool Process(string key, string endpoint)
Util.EnvironmentTickCount() +
(int) _options.ForgetTimeSpan.TotalMilliseconds);
_forgetTimer.Enabled = true;
- m_log.Warn($"[{_options.ReportingName}]: client: {clientstring} is blocked for {_options.ForgetTimeSpan.TotalMilliseconds}ms based on concurrency, X-ForwardedForAllowed status is {_options.AllowXForwardedFor}, endpoint:{_options.AllowXForwardedFor}");
+
+ _logger.LogWarning(
+ $"[{_options.ReportingName}]: client: {clientstring} is blocked for {_options.ForgetTimeSpan.TotalMilliseconds}ms " +
+ $"based on concurrency, X-ForwardedForAllowed status is {_options.AllowXForwardedFor}, endpoint:{_options.AllowXForwardedFor}");
}
else
@@ -240,7 +253,10 @@ private bool DeeperInspection(string key, string endpoint)
_tempBlocked[clientstring] = Util.EnvironmentTickCount() + (int)_options.ForgetTimeSpan.TotalMilliseconds;
_blockLockSlim.ExitWriteLock();
- m_log.Warn($"[{_options.ReportingName}]: client: {clientstring} is blocked for {_options.ForgetTimeSpan.TotalMilliseconds}ms, X-ForwardedForAllowed status is {_options.AllowXForwardedFor}, endpoint:{endpoint}");
+ _logger.LogWarning(
+ $"[{_options.ReportingName}]: client: {clientstring} is blocked for {_options.ForgetTimeSpan.TotalMilliseconds}ms, " +
+ $"X-ForwardedForAllowed status is {_options.AllowXForwardedFor}, endpoint:{endpoint}");
+
return false;
}
//else
diff --git a/Source/OpenSim.Framework/ChildAgentDataUpdate.cs b/Source/OpenSim.Framework/ChildAgentDataUpdate.cs
index 0314aaf467f..12f510c7b97 100644
--- a/Source/OpenSim.Framework/ChildAgentDataUpdate.cs
+++ b/Source/OpenSim.Framework/ChildAgentDataUpdate.cs
@@ -25,11 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using log4net;
+
using OpenMetaverse;
using OpenMetaverse.StructuredData;
@@ -403,8 +400,6 @@ public UUID AgentID
public List CachedFriendsOnline;
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public void SetLookAt(Vector3 value)
{
if (value.X == 0 && value.Y == 0)
@@ -422,7 +417,7 @@ public void SetLookAt(Vector3 value)
public virtual OSDMap Pack(EntityTransferContext ctx)
{
- //m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
+ ////m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
OSDMap args = new OSDMap();
args["message_type"] = OSD.FromString("AgentData");
@@ -562,7 +557,7 @@ public virtual OSDMap Pack(EntityTransferContext ctx)
}
catch (IndexOutOfRangeException)
{
- m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list.");
+ //m_logger.LogWarning("[CHILD AGENT DATA]: scripts list is shorter than object list.");
}
attObjs.Add(info);
@@ -591,7 +586,7 @@ public virtual OSDMap Pack(EntityTransferContext ctx)
///
public virtual void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx)
{
- //m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
+ ////m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
OSD tmp;
if (args.TryGetValue("region_id", out tmp) && tmp != null)
UUID.TryParse(tmp.AsString(), out RegionID);
@@ -781,13 +776,13 @@ public virtual void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx)
// packed_appearence should contain all appearance information
if (args.TryGetValue("packed_appearance", out tmp) && tmp is OSDMap)
{
- //m_log.WarnFormat("[CHILDAGENTDATAUPDATE] got packed appearance");
+ ////m_log.WarnFormat("[CHILDAGENTDATAUPDATE] got packed appearance");
Appearance = new AvatarAppearance((OSDMap)tmp);
}
else
{
// if missing try the old pack method
- m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance, checking old method");
+ //m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance, checking old method");
Appearance = new AvatarAppearance();
@@ -825,7 +820,7 @@ public virtual void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx)
// We know all of these must end up as attachments so we
// append rather than replace to ensure multiple attachments
// per point continues to work
- // m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID);
+ // //m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID);
Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
}
}
diff --git a/Source/OpenSim.Framework/ConfigurationMember.cs b/Source/OpenSim.Framework/ConfigurationMember.cs
index 08bf91ee3a7..df57b34cea9 100755
--- a/Source/OpenSim.Framework/ConfigurationMember.cs
+++ b/Source/OpenSim.Framework/ConfigurationMember.cs
@@ -25,15 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Globalization;
using System.Net;
using System.Reflection;
using System.Xml;
-using log4net;
using OpenMetaverse;
-//using OpenSim.Framework.Console;
namespace OpenSim.Framework
{
@@ -47,7 +43,6 @@ public class ConfigurationMember
#endregion
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private int cE = 0;
private string configurationDescription = String.Empty;
@@ -119,9 +114,9 @@ private void checkAndAddConfigOption(ConfigurationOption option)
}
else
{
- m_log.Info(
- "Required fields for adding a configuration option is invalid. Will not add this option (" +
- option.configurationKey + ")");
+ //m_log.Info(
+ //"Required fields for adding a configuration option is invalid. Will not add this option (" +
+ //option.configurationKey + ")");
}
}
@@ -160,39 +155,39 @@ public void addConfigurationOption(string configuration_key,
public void performConfigurationRetrieve()
{
if (cE > 1)
- m_log.Error("READING CONFIGURATION COUT: " + cE.ToString());
+ //m_log.Error("READING CONFIGURATION COUT: " + cE.ToString());
configurationPlugin = LoadConfigDll(configurationPluginFilename);
configurationOptions.Clear();
if (loadFunction == null)
{
- m_log.Error("Load Function for '" + configurationDescription +
- "' is null. Refusing to run configuration.");
+ //m_log.Error("Load Function for '" + configurationDescription +
+ //"' is null. Refusing to run configuration.");
return;
}
if (resultFunction == null)
{
- m_log.Error("Result Function for '" + configurationDescription +
- "' is null. Refusing to run configuration.");
+ //m_log.Error("Result Function for '" + configurationDescription +
+ //"' is null. Refusing to run configuration.");
return;
}
- //m_log.Debug("[CONFIG]: Calling Configuration Load Function...");
+ ////m_log.Debug("[CONFIG]: Calling Configuration Load Function...");
loadFunction();
if (configurationOptions.Count <= 0)
{
- m_log.Error("[CONFIG]: No configuration options were specified for '" + configurationOptions +
- "'. Refusing to continue configuration.");
+ //m_log.Error("[CONFIG]: No configuration options were specified for '" + configurationOptions +
+ //"'. Refusing to continue configuration.");
return;
}
bool useFile = true;
if (configurationPlugin == null)
{
- m_log.Error("[CONFIG]: Configuration Plugin NOT LOADED!");
+ //m_log.Error("[CONFIG]: Configuration Plugin NOT LOADED!");
return;
}
@@ -206,10 +201,10 @@ public void performConfigurationRetrieve()
}
catch (XmlException e)
{
- m_log.WarnFormat("[CONFIG] Not using {0}: {1}",
- configurationFilename,
- e.Message.ToString());
- //m_log.Error("Error loading " + configurationFilename + ": " + e.ToString());
+ ////m_log.WarnFormat("[CONFIG] Not using {0}: {1}",
+ // configurationFilename,
+ // e.Message.ToString());
+ ////m_log.Error("Error loading " + configurationFilename + ": " + e.ToString());
useFile = false;
}
}
@@ -217,11 +212,11 @@ public void performConfigurationRetrieve()
{
if (configurationFromXMLNode != null)
{
- m_log.Info("Loading from XML Node, will not save to the file");
+ //m_log.Info("Loading from XML Node, will not save to the file");
configurationPlugin.LoadDataFromString(configurationFromXMLNode.OuterXml);
}
- m_log.Info("XML Configuration Filename is not valid; will not save to the file.");
+ //m_log.Info("XML Configuration Filename is not valid; will not save to the file.");
useFile = false;
}
@@ -458,8 +453,7 @@ public void performConfigurationRetrieve()
if (!resultFunction(configOption.configurationKey, return_result))
{
- m_log.Info(
- "The handler for the last configuration option denied that input, please try again.");
+ //m_log.Info("The handler for the last configuration option denied that input, please try again.");
convertSuccess = false;
ignoreNextFromConfig = true;
}
@@ -468,18 +462,18 @@ public void performConfigurationRetrieve()
{
if (configOption.configurationUseDefaultNoPrompt)
{
- m_log.Error(string.Format(
- "[CONFIG]: [{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n",
- configOption.configurationKey, console_result, errorMessage,
- configurationFilename));
+ //m_log.Error(string.Format(
+ //"[CONFIG]: [{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n",
+ //configOption.configurationKey, console_result, errorMessage,
+ //configurationFilename));
convertSuccess = true;
}
else
{
- m_log.Warn(string.Format(
- "[CONFIG]: [{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n",
- configOption.configurationKey, console_result, errorMessage,
- configurationFilename));
+ //m_log.Warn(string.Format(
+ //"[CONFIG]: [{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n",
+ //configOption.configurationKey, console_result, errorMessage,
+ //configurationFilename));
ignoreNextFromConfig = true;
}
}
diff --git a/Source/OpenSim.Framework/DAMap.cs b/Source/OpenSim.Framework/DAMap.cs
index 1915fa52f9d..003a0c59d1d 100644
--- a/Source/OpenSim.Framework/DAMap.cs
+++ b/Source/OpenSim.Framework/DAMap.cs
@@ -25,17 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
-using log4net;
-using OpenMetaverse;
+
using OpenMetaverse.StructuredData;
namespace OpenSim.Framework
@@ -52,13 +45,12 @@ namespace OpenSim.Framework
///
public class DAMap : IXmlSerializable
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static readonly int MIN_NAMESPACE_LENGTH = 4;
private OSDMap m_map = new OSDMap();
// WARNING: this is temporary for experimentation only, it will be removed!!!!
+ [Obsolete]
public OSDMap TopLevelMap
{
get { return m_map; }
diff --git a/Source/OpenSim.Framework/GridInfo.cs b/Source/OpenSim.Framework/GridInfo.cs
index d82d5e0809d..3ae7daa9a34 100644
--- a/Source/OpenSim.Framework/GridInfo.cs
+++ b/Source/OpenSim.Framework/GridInfo.cs
@@ -25,13 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Net;
using System.Reflection;
-using log4net;
+
using Microsoft.Extensions.Configuration;
-using Nini.Config;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework
{
@@ -354,8 +352,6 @@ public override int GetHashCode()
public class GridInfo
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private bool m_hasHGconfig;
private OSHHTPHost m_gateKeeperURL;
private HashSet m_gateKeeperAlias;
@@ -370,11 +366,14 @@ public class GridInfo
private string m_DestinationGuideURL = string.Empty;
private string m_economyURL = string.Empty;
- public GridInfo (IConfiguration config, string defaultURI = "")
+ private readonly ILogger m_logger;
+
+ public GridInfo (IConfiguration config, ILogger logger, string defaultURI = "")
{
- string[] sections = new string[] {"Const", "Startup", "Hypergrid"};
+ m_logger = logger;
- string gatekeeper = Util.GetConfigVarFromSections(config, "GatekeeperURI", sections, string.Empty);
+ string[] sections = new string[] {"Const", "Startup", "Hypergrid"};
+ string? gatekeeper = Util.GetConfigVarFromSections(config, "GatekeeperURI", sections, string.Empty);
if (string.IsNullOrEmpty(gatekeeper))
{
@@ -402,7 +401,7 @@ public GridInfo (IConfiguration config, string defaultURI = "")
if (!m_gateKeeperURL.IsResolvedHost)
{
- m_log.Error(m_gateKeeperURL.IsValidHost ? "Could not resolve GatekeeperURI" : "GatekeeperURI is a invalid host");
+ m_logger.LogError(m_gateKeeperURL.IsValidHost ? "Could not resolve GatekeeperURI" : "GatekeeperURI is a invalid host");
throw new Exception("GatekeeperURI configuration error");
}
@@ -447,7 +446,7 @@ public GridInfo (IConfiguration config, string defaultURI = "")
if (!m_homeURL.IsResolvedHost)
{
- m_log.Error(m_homeURL.IsValidHost ? "Could not resolve HomeURI" : "HomeURI is a invalid host");
+ m_logger.LogError(m_homeURL.IsValidHost ? "Could not resolve HomeURI" : "HomeURI is a invalid host");
throw new Exception("HomeURI configuration error");
}
@@ -484,7 +483,7 @@ public GridInfo (IConfiguration config, string defaultURI = "")
tmpuri = new OSHTTPURI(m_SearchURL.Trim(), true);
if (!tmpuri.IsResolvedHost)
{
- m_log.Error(tmpuri.IsValidHost ? "Could not resolve SearchServerURI" : "SearchServerURI is a invalid host");
+ m_logger.LogError(tmpuri.IsValidHost ? "Could not resolve SearchServerURI" : "SearchServerURI is a invalid host");
throw new Exception("SearchServerURI configuration error");
}
m_SearchURL = tmpuri.URI;
@@ -500,7 +499,7 @@ public GridInfo (IConfiguration config, string defaultURI = "")
tmpuri = new OSHTTPURI(m_DestinationGuideURL.Trim(), true);
if (!tmpuri.IsResolvedHost)
{
- m_log.Error(tmpuri.IsValidHost ? "Could not resolve DestinationGuideURL" : "DestinationGuideURL is a invalid host");
+ m_logger.LogError(tmpuri.IsValidHost ? "Could not resolve DestinationGuideURL" : "DestinationGuideURL is a invalid host");
throw new Exception("DestinationGuideURL configuration error");
}
m_DestinationGuideURL = tmpuri.URI;
@@ -512,7 +511,7 @@ public GridInfo (IConfiguration config, string defaultURI = "")
tmpuri = new OSHTTPURI(m_economyURL.Trim(), true);
if (!tmpuri.IsResolvedHost)
{
- m_log.Error(tmpuri.IsValidHost ? "Could not resolve economyURL" : "economyURL is a invalid host");
+ m_logger.LogError(tmpuri.IsValidHost ? "Could not resolve economyURL" : "economyURL is a invalid host");
throw new Exception("economyURL configuration error");
}
m_economyURL = tmpuri.URI;
@@ -714,9 +713,13 @@ public string GridUrl
{
OSHHTPHost tmp = new OSHHTPHost(value, true);
if (tmp.IsResolvedHost)
+ {
m_gridUrl = tmp.URI;
+ }
else
- m_log.Error((tmp.IsValidHost ? "Could not resolve GridUrl" : "GridUrl is a invalid host ") + value ?? "");
+ {
+ m_logger.LogError((tmp.IsValidHost ? "Could not resolve GridUrl" : "GridUrl is a invalid host ") + value ?? "");
+ }
}
}
@@ -727,9 +730,13 @@ public string SearchURL
{
OSHTTPURI tmp = new OSHTTPURI(value, true);
if (tmp.IsResolvedHost)
+ {
m_SearchURL = tmp.URI;
+ }
else
- m_log.Error((tmp.IsValidHost ? "Could not resolve SearchURL" : "SearchURL is a invalid host ") + value??"");
+ {
+ m_logger.LogError((tmp.IsValidHost ? "Could not resolve SearchURL" : "SearchURL is a invalid host ") + value ?? "");
+ }
}
}
@@ -740,9 +747,13 @@ public string DestinationGuideURL
{
OSHTTPURI tmp = new OSHTTPURI(value, true);
if (tmp.IsResolvedHost)
+ {
m_DestinationGuideURL = tmp.URI;
+ }
else
- m_log.Error((tmp.IsValidHost ? "Could not resolve DestinationGuideURL" : "DestinationGuideURL is a invalid host ") + value ?? "");
+ {
+ m_logger.LogError((tmp.IsValidHost ? "Could not resolve DestinationGuideURL" : "DestinationGuideURL is a invalid host ") + value ?? "");
+ }
}
}
@@ -753,9 +764,13 @@ public string EconomyURL
{
OSHTTPURI tmp = new OSHTTPURI(value, true);
if (tmp.IsResolvedHost)
+ {
m_economyURL = tmp.URI;
+ }
else
- m_log.Error((tmp.IsValidHost ? "Could not resolve EconomyURL" : "EconomyURL is a invalid host ") + value ?? "");
+ {
+ m_logger.LogError((tmp.IsValidHost ? "Could not resolve EconomyURL" : "EconomyURL is a invalid host ") + value ?? "");
+ }
}
}
}
diff --git a/Source/OpenSim.Framework/ICommandConsole.cs b/Source/OpenSim.Framework/ICommandConsole.cs
index 69d261f1264..975fec8287d 100755
--- a/Source/OpenSim.Framework/ICommandConsole.cs
+++ b/Source/OpenSim.Framework/ICommandConsole.cs
@@ -25,10 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using Microsoft.Extensions.Configuration;
-using Nini.Config;
-using System;
-using System.Collections.Generic;
using System.Xml;
namespace OpenSim.Framework
diff --git a/Source/OpenSim.Framework/IScene.cs b/Source/OpenSim.Framework/IScene.cs
index bb6426b13e7..ec1d5b0a920 100644
--- a/Source/OpenSim.Framework/IScene.cs
+++ b/Source/OpenSim.Framework/IScene.cs
@@ -26,9 +26,9 @@
*/
using OpenMetaverse;
-//using OpenSim.Framework.Console;
-using Nini.Config;
+
using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework
{
@@ -67,6 +67,8 @@ public interface IScene
IConfiguration Config { get; }
+ ILogger Logger { get; }
+
///
/// Are logins enabled on this simulator?
///
diff --git a/Source/OpenSim.Framework/InventoryFolderImpl.cs b/Source/OpenSim.Framework/InventoryFolderImpl.cs
index 02259ab9942..7233f0efa9f 100644
--- a/Source/OpenSim.Framework/InventoryFolderImpl.cs
+++ b/Source/OpenSim.Framework/InventoryFolderImpl.cs
@@ -25,18 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using log4net;
using OpenMetaverse;
namespace OpenSim.Framework
{
public class InventoryFolderImpl : InventoryFolderBase
{
- //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public static readonly string PATH_DELIMITER = "/";
///
@@ -386,8 +380,6 @@ public List RequestListOfItems()
}
}
- //m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count);
-
return itemList;
}
diff --git a/Source/OpenSim.Framework/LogWriter.cs b/Source/OpenSim.Framework/LogWriter.cs
index 2e0bf4a354d..d010e52181f 100755
--- a/Source/OpenSim.Framework/LogWriter.cs
+++ b/Source/OpenSim.Framework/LogWriter.cs
@@ -25,10 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
+using Microsoft.Extensions.Logging;
using System.Text;
-using log4net;
namespace OpenSim.Framework
{
@@ -55,7 +53,7 @@ public class LogWriter : IDisposable
private bool m_flushWrite;
// set externally when debugging. If let 'null', this does not write any error messages.
- public ILog ErrorLogger = null;
+ public ILogger ErrorLogger = null;
private string LogHeader = "[LOG WRITER]";
///
@@ -171,7 +169,7 @@ public void Write(string line)
{
if (ErrorLogger != null)
{
- ErrorLogger.ErrorFormat("{0}: FAILURE WRITING TO LOGFILE: {1}", LogHeader, e);
+ ErrorLogger.LogError(e, $"{LogHeader}: FAILURE WRITING TO LOGFILE: ");
}
Enabled = false;
}
diff --git a/Source/OpenSim.Framework/ModuleLoader.cs b/Source/OpenSim.Framework/ModuleLoader.cs
deleted file mode 100644
index 0e2ad5ac7ed..00000000000
--- a/Source/OpenSim.Framework/ModuleLoader.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) Contributors, http://whitecore-sim.org/, http://aurora-sim.org
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the WhiteCore-Sim Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-
-namespace OpenSim.Framework
-{
- public static class ModuleLoader
- {
- #region Module Loaders
-
- ///
- /// Find all T modules in the current directory
- ///
- ///
- ///
- public static List FindModules()
- {
- return LoadModules(".");
- }
-
- ///
- /// Gets all modules found in the given directory.
- /// Identifier is the name of the interface.
- ///
- ///
- ///
- ///
- public static List LoadModules(string moduleDir)
- {
- PluginLoadContext loadContext = new PluginLoadContext(moduleDir);
- List modules = new List();
-
- DirectoryInfo dir = new DirectoryInfo(moduleDir);
-
- foreach (FileInfo fileInfo in dir.GetFiles("*.dll"))
- modules.AddRange(LoadModulesFromDLL(moduleDir, fileInfo.FullName));
-
- //try
- //{
- // List loadedDllModules;
- // LoadedDlls.TryGetValue(moduleDir, out loadedDllModules);
- // foreach (Type pluginType in loadedDllModules)
- // {
- // try
- // {
- // if (pluginType.IsPublic)
- // {
- // if (!pluginType.IsAbstract)
- // {
- // if(typeof (T).IsAssignableFrom(pluginType))
- // {
- // modules.Add((T) Activator.CreateInstance(pluginType));
- // }
- // }
- // }
- // }
- // catch (Exception)
- // {
- // }
- // }
- // }
- // catch (Exception)
- // {
- // }
-
- return modules;
- }
-
- ///
- /// Load all T modules from dllname
- ///
- ///
- ///
- ///
- ///
- private static List LoadModulesFromDLL(string moduleDir, string dllName)
- {
- List modules = new List();
-
- Assembly pluginAssembly = Assembly.Load(AssemblyName.GetAssemblyName(dllName));
-
- if (pluginAssembly != null)
- {
- try
- {
- List loadedTypes = new List();
- foreach (Type pluginType in pluginAssembly.GetTypes().Where((p) => p.IsPublic && !p.IsAbstract))
- {
- try
- {
- if (typeof(T).IsAssignableFrom(pluginType))
- {
- modules.Add((T) Activator.CreateInstance(pluginType));
- }
- }
- catch (Exception ex)
- {
- //MainConsole.Instance.Warn("[MODULELOADER]: Error loading module " + pluginType.Name +
- // " in file " + dllName +
- // " : " + ex);
- }
- }
- }
- catch (Exception)
- {
- }
- }
-
- return modules;
- }
-
- #endregion
-
- ///
- /// Load all plugins from the given .dll file with the interface 'type'
- ///
- ///
- ///
- ///
- public static List LoadPlugins(string dllName)
- {
- List plugins = new List();
- try
- {
- Assembly pluginAssembly = Assembly.Load(AssemblyName.GetAssemblyName(dllName));
- foreach (Type pluginType in pluginAssembly.GetTypes().Where(pluginType => pluginType.IsPublic))
- {
- try
- {
- if (typeof(T).IsAssignableFrom(pluginType))
- {
- plugins.Add((T) Activator.CreateInstance(pluginType));
- }
- }
- catch (Exception)
- {
- }
- }
- }
- catch (ReflectionTypeLoadException e)
- {
- foreach (Exception e2 in e.LoaderExceptions)
- {
- //MainConsole.Instance.Error(e2.ToString());
- }
- throw e;
- }
- return plugins;
- }
- }
-}
diff --git a/Source/OpenSim.Framework/NetworkUtil.cs b/Source/OpenSim.Framework/NetworkUtil.cs
index 93c94463a2f..541dfdf19e4 100644
--- a/Source/OpenSim.Framework/NetworkUtil.cs
+++ b/Source/OpenSim.Framework/NetworkUtil.cs
@@ -25,14 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Net.Sockets;
using System.Net;
using System.Net.NetworkInformation;
-using System.Reflection;
-using System.Text;
-using log4net;
namespace OpenSim.Framework
{
@@ -46,9 +41,6 @@ namespace OpenSim.Framework
///
public static class NetworkUtil
{
- // Logger
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static bool m_disabled = true;
public static bool Enabled
@@ -70,7 +62,6 @@ public static IPAddress GetIPFor(IPAddress user, IPAddress simulator)
{
if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork)
{
- m_log.Info("[NetworkUtil] Localhost user detected, sending them '" + host + "' instead of '" + simulator + "'");
return host;
}
}
@@ -101,7 +92,6 @@ public static IPAddress GetIPFor(IPAddress user, IPAddress simulator)
if (valid)
{
- m_log.Info("[NetworkUtil] Local LAN user detected, sending them '" + subnet.Key + "' instead of '" + simulator + "'");
return subnet.Key;
}
}
@@ -119,7 +109,6 @@ private static IPAddress GetExternalIPFor(IPAddress destination, string defaultH
{
if (host.AddressFamily == AddressFamily.InterNetworkV6)
{
- m_log.Info("[NetworkUtil] Localhost user detected, sending them '" + host + "' instead of '" + defaultHostname + "'");
return host;
}
}
@@ -134,7 +123,6 @@ private static IPAddress GetExternalIPFor(IPAddress destination, string defaultH
IPAddress host = pair.Value;
if (host.Equals(destination) && host.AddressFamily == AddressFamily.InterNetwork)
{
- m_log.Info("[NATROUTING] Localhost user detected, sending them '" + host + "' instead of '" + defaultHostname + "'");
return destination;
}
}
@@ -165,7 +153,6 @@ private static IPAddress GetExternalIPFor(IPAddress destination, string defaultH
if (valid)
{
- m_log.Info("[NetworkUtil] Local LAN user detected, sending them '" + subnet.Key + "' instead of '" + defaultHostname + "'");
return subnet.Key;
}
}
diff --git a/Source/OpenSim.Framework/ObjectJobEngine.cs b/Source/OpenSim.Framework/ObjectJobEngine.cs
index 19e59d7147e..24693539403 100644
--- a/Source/OpenSim.Framework/ObjectJobEngine.cs
+++ b/Source/OpenSim.Framework/ObjectJobEngine.cs
@@ -29,18 +29,14 @@
// can have up to m_concurrency number of execution threads
// it will hold each thread up to m_threadsHoldtime ms waiting for more work, before releasing it back to the pool.
-using System;
+using Microsoft.Extensions.Logging;
using System.Collections.Concurrent;
using System.Reflection;
-using System.Threading;
-using log4net;
namespace OpenSim.Framework
{
public class ObjectJobEngine : IDisposable
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private readonly object m_mainLock = new object();
private readonly string m_name;
private readonly int m_threadsHoldtime;
@@ -52,8 +48,16 @@ public class ObjectJobEngine : IDisposable
private int m_numberThreads = 0;
private bool m_isRunning;
- public ObjectJobEngine(WaitCallback callback, string name, int threadsHoldtime = 1000, int concurrency = 1)
+ private ILogger m_logger;
+
+ public ObjectJobEngine(
+ ILogger logger,
+ WaitCallback callback,
+ string name,
+ int threadsHoldtime = 1000,
+ int concurrency = 1)
{
+ m_logger = logger;
m_name = name;
m_threadsHoldtime = threadsHoldtime;
@@ -155,12 +159,13 @@ public bool Enqueue(object o)
private void ProcessRequests(object o)
{
- object obj;
+ object? obj;
+
while (m_isRunning)
{
try
{
- if(!m_jobQueue.TryTake(out obj, m_threadsHoldtime, m_cancelSource.Token))
+ if (!m_jobQueue.TryTake(out obj, m_threadsHoldtime, m_cancelSource.Token))
{
lock (m_mainLock)
{
@@ -178,6 +183,7 @@ private void ProcessRequests(object o)
if(!m_isRunning || m_callback == null)
break;
+
try
{
m_callback.Invoke(obj);
@@ -185,11 +191,14 @@ private void ProcessRequests(object o)
}
catch (Exception e)
{
- m_log.ErrorFormat("[ObjectJob {0}]: Job failed, continuing. Exception {1}", m_name, e);
+ m_logger.LogError(e, $"[ObjectJob {m_name}]: Job failed, continuing.");
}
}
+
lock (m_mainLock)
+ {
--m_numberThreads;
+ }
}
}
}
diff --git a/Source/OpenSim.Framework/OpenSim.Framework.csproj b/Source/OpenSim.Framework/OpenSim.Framework.csproj
index 5d75e300e3c..9b306f4ff6e 100644
--- a/Source/OpenSim.Framework/OpenSim.Framework.csproj
+++ b/Source/OpenSim.Framework/OpenSim.Framework.csproj
@@ -29,9 +29,6 @@
False
-
-
-
@@ -39,8 +36,9 @@
-
-
+
+
+
diff --git a/Source/OpenSim.Framework/OutboundUrlFilter.cs b/Source/OpenSim.Framework/OutboundUrlFilter.cs
index 5fc201a05a5..3834a1bca14 100644
--- a/Source/OpenSim.Framework/OutboundUrlFilter.cs
+++ b/Source/OpenSim.Framework/OutboundUrlFilter.cs
@@ -26,10 +26,9 @@
*/
using System.Net;
-using System.Reflection;
-using log4net;
-using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
using IPNetwork = LukeSkywalker.IPNetwork.IPNetwork;
@@ -37,8 +36,6 @@ namespace OpenSim.Framework
{
public class OutboundUrlFilter
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public string Name { get; private set; }
private List m_blacklistNetworks;
@@ -47,11 +44,15 @@ public class OutboundUrlFilter
private List m_blacklistExceptionNetworks;
private List m_blacklistExceptionEndPoints;
+ private ILogger m_logger;
+
public OutboundUrlFilter(
+ ILogger logger,
string name,
List blacklistNetworks, List blacklistEndPoints,
List blacklistExceptionNetworks, List blacklistExceptionEndPoints)
{
+ m_logger = logger;
Name = name;
m_blacklistNetworks = blacklistNetworks;
@@ -65,8 +66,9 @@ public OutboundUrlFilter(
///
/// Name of the filter for logging purposes.
/// Filter configuration
- public OutboundUrlFilter(string name, IConfiguration config)
+ public OutboundUrlFilter(ILogger logger, string name, IConfiguration config)
{
+ m_logger = logger;
Name = name;
string configBlacklist
@@ -80,10 +82,10 @@ string configBlacklist
configBlacklistExceptions = networkConfig.GetValue("OutboundDisallowForUserScriptsExcept", configBlacklistExceptions);
}
- m_log.DebugFormat(
- "[OUTBOUND URL FILTER]: OutboundDisallowForUserScripts for {0} is [{1}]", Name, configBlacklist);
- m_log.DebugFormat(
- "[OUTBOUND URL FILTER]: OutboundDisallowForUserScriptsExcept for {0} is [{1}]", Name, configBlacklistExceptions);
+ m_logger.LogDebug(
+ $"[OUTBOUND URL FILTER]: OutboundDisallowForUserScripts for {Name} is [{configBlacklist}]");
+ m_logger.LogDebug(
+ $"[OUTBOUND URL FILTER]: OutboundDisallowForUserScriptsExcept for {Name} is [{configBlacklistExceptions}]");
OutboundUrlFilter.ParseConfigList(
configBlacklist, Name, out m_blacklistNetworks, out m_blacklistEndPoints);
@@ -111,8 +113,8 @@ string[] configBlacklistEntries
if (!IPNetwork.TryParse(configEntry, out network))
{
- m_log.ErrorFormat(
- "[OUTBOUND URL FILTER]: Entry [{0}] is invalid network for {1}", configEntry, filterName);
+// m_logger.LogError(
+// $"[OUTBOUND URL FILTER]: Entry [{configEntry}] is invalid network for {filterName}");
continue;
}
@@ -125,9 +127,8 @@ string[] configBlacklistEntries
if (!Uri.TryCreate("http://" + configEntry, UriKind.Absolute, out configEntryUri))
{
- m_log.ErrorFormat(
- "[OUTBOUND URL FILTER]: EndPoint entry [{0}] is invalid endpoint for {1}",
- configEntry, filterName);
+// m_logger.LogError(
+// $"[OUTBOUND URL FILTER]: EndPoint entry [{configEntry}] is invalid endpoint for {filterName}");
continue;
}
@@ -138,12 +139,12 @@ string[] configBlacklistEntries
{
if (addr.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
{
- // m_log.DebugFormat("[OUTBOUND URL FILTER]: Found address [{0}] in config", addr);
+// m_logger.LogDebug($"[OUTBOUND URL FILTER]: Found address [{addr}] in config");
IPEndPoint configEntryEp = new IPEndPoint(addr, configEntryUri.Port);
endPoints.Add(configEntryEp);
- // m_log.DebugFormat("[OUTBOUND URL FILTER]: Added blacklist exception [{0}]", configEntryEp);
+// m_logger.LogDebug($"[OUTBOUND URL FILTER]: Added blacklist exception [{configEntryEp}]");
}
}
}
diff --git a/Source/OpenSim.Framework/PermissionsUtil.cs b/Source/OpenSim.Framework/PermissionsUtil.cs
index 99650d8bc5e..70a5cf42b54 100644
--- a/Source/OpenSim.Framework/PermissionsUtil.cs
+++ b/Source/OpenSim.Framework/PermissionsUtil.cs
@@ -25,27 +25,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using log4net;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Framework
{
public static class PermissionsUtil
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Logs permissions flags. Useful when debugging permission problems.
///
///
- public static void LogPermissions(String name, String message, uint basePerm, uint curPerm, uint nextPerm)
+ public static void LogPermissions(ILogger log, String name, String message, uint basePerm, uint curPerm, uint nextPerm)
{
- m_log.DebugFormat("Permissions of \"{0}\" at \"{1}\": Base {2} ({3:X4}), Current {4} ({5:X4}), NextOwner {6} ({7:X4})",
- name, message,
- PermissionsToString(basePerm), basePerm, PermissionsToString(curPerm), curPerm, PermissionsToString(nextPerm), nextPerm);
+ log.LogDebug(
+ $"Permissions of \"{name}\" at \"{message}\": Base {PermissionsToString(basePerm)} ({basePerm:X4}), " +
+ $"Current {PermissionsToString(curPerm)} ({curPerm:X4}), NextOwner {PermissionsToString(nextPerm)} ({nextPerm:X4})");
}
///
diff --git a/Source/OpenSim.Framework/PluginLoadContext.cs b/Source/OpenSim.Framework/PluginLoadContext.cs
deleted file mode 100644
index 75882265ed6..00000000000
--- a/Source/OpenSim.Framework/PluginLoadContext.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using log4net;
-using System;
-using System.Reflection;
-using System.Runtime.Loader;
-
-/*
- * To support the dotnet core way of doing plugin loading
- */
-namespace OpenSim.Framework
-{
- public class PluginLoadContext : AssemblyLoadContext
- {
- private static readonly ILog log
- = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- private AssemblyDependencyResolver _resolver;
-
- public PluginLoadContext(string pluginPath)
- {
- _resolver = new AssemblyDependencyResolver(pluginPath);
- }
-
- protected override Assembly Load(AssemblyName assemblyName)
- {
- string assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName);
-
- if (assemblyPath != null)
- {
- return LoadFromAssemblyPath(assemblyPath);
- }
-
- return null;
- }
-
- protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
- {
- string libraryPath = _resolver.ResolveUnmanagedDllToPath(unmanagedDllName);
- if (libraryPath != null)
- {
- return LoadUnmanagedDllFromPath(libraryPath);
- }
-
- return IntPtr.Zero;
- }
- }
-}
diff --git a/Source/OpenSim.Framework/PluginLoader.cs b/Source/OpenSim.Framework/PluginLoader.cs
deleted file mode 100644
index d9c03b0787b..00000000000
--- a/Source/OpenSim.Framework/PluginLoader.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the OpenSimulator Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System.Reflection;
-using System.Runtime.Loader;
-using log4net;
-
-namespace OpenSim.Framework
-{
- ///
- /// Generic Plugin Loader
- ///
- public class PluginLoader where T : IPlugin
- {
- private static readonly ILog log
- = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- public PluginInitialiserBase Initialiser { get; set; } = new PluginInitialiserBase();
-
- private string pluginBaseDir = String.Empty;
-
- public PluginLoader(PluginInitialiserBase init)
- {
- Initialiser = init;
- }
-
- public PluginLoader(PluginInitialiserBase init, string dir)
- {
- Initialiser = init;
- pluginBaseDir = dir;
- }
-
- public List Load()
- {
- List loadedPlugins = new List();
- if (string.IsNullOrEmpty(pluginBaseDir))
- {
- pluginBaseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
- }
-
- DirectoryInfo dir = new DirectoryInfo(pluginBaseDir);
- AssemblyLoadContext loadContext = new AssemblyLoadContext(dir.FullName);
-
- foreach (FileInfo fileInfo in dir.GetFiles("OpenSim.ApplicationPlugins.*.dll"))
- {
- try
- {
- AssemblyName assemblyName = AssemblyName.GetAssemblyName(fileInfo.FullName);
-
- log.Info($"[PLUGINLOADER] Searching {assemblyName.FullName} for modules to load");
- Assembly pluginAssembly = loadContext.LoadFromAssemblyPath(fileInfo.FullName);
-
- if (pluginAssembly != null)
- {
- foreach (var pluginType in pluginAssembly.GetTypes().Where((p) => p.IsPublic && !p.IsAbstract))
- {
- try
- {
- if (typeof(T).IsAssignableFrom(pluginType))
- {
- log.Info($"[PLUGINLOADER] Initializing {pluginType.FullName}");
- loadedPlugins.Add((T)Activator.CreateInstance(pluginType));
- }
- }
- catch (Exception ex)
- {
- log.Warn($"[MODULELOADER]: Error loading module {pluginType.Name} in file {fileInfo.FullName} : {ex}");
- }
- }
- }
- }
- catch (Exception ex)
- {
- log.Warn($"[MODULELOADER]: Error loading assembly {fileInfo.FullName} : {ex}");
- continue;
- }
- }
-
- foreach (T plugin in loadedPlugins)
- {
- Initialiser.Initialise(plugin);
- }
-
- return loadedPlugins;
- }
- }
-}
diff --git a/Source/OpenSim.Framework/PrimitiveBaseShape.cs b/Source/OpenSim.Framework/PrimitiveBaseShape.cs
index fb9c416ec03..232ce801b04 100644
--- a/Source/OpenSim.Framework/PrimitiveBaseShape.cs
+++ b/Source/OpenSim.Framework/PrimitiveBaseShape.cs
@@ -25,16 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-
-using System.IO;
-using System.Reflection;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using System.Runtime.CompilerServices;
-using log4net;
+
using OpenMetaverse;
using OpenMetaverse.StructuredData;
@@ -79,8 +74,6 @@ public enum Extrusion : byte
[Serializable]
public class PrimitiveBaseShape
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static readonly byte[] DEFAULT_TEXTURE = new Primitive.TextureEntry(new UUID("89556747-24cb-43ed-920b-47caed15465f")).GetBytes();
private byte[] m_textureEntry;
@@ -197,10 +190,8 @@ public byte ProfileCurve
if (!Enum.IsDefined(typeof(HollowShape), hollowShapeByte))
{
- m_log.WarnFormat(
- "[SHAPE]: Attempt to set a ProfileCurve with a hollow shape value of {0}, which isn't a valid enum. Replacing with default shape.",
- hollowShapeByte);
-
+ // Attempt to set a ProfileCurve with a hollow shape value of {0}, which isn't a valid enum.
+ // Replacing with default shape.",
_hollowShape = HollowShape.Same;
}
else
@@ -213,10 +204,8 @@ public byte ProfileCurve
if (!Enum.IsDefined(typeof(ProfileShape), profileShapeByte))
{
- m_log.WarnFormat(
- "[SHAPE]: Attempt to set a ProfileCurve with a profile shape value of {0}, which isn't a valid enum. Replacing with square.",
- profileShapeByte);
-
+ // Attempt to set a ProfileCurve with a profile shape value of {0}, which isn't a valid enum.
+ // Replacing with square.
_profileShape = ProfileShape.Square;
}
else
@@ -292,10 +281,11 @@ public Primitive.TextureEntry Textures
get
{
//m_log.DebugFormat("[SHAPE]: get m_textureEntry length {0}", m_textureEntry.Length);
- try { return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length); }
+ try {
+ return new Primitive.TextureEntry(m_textureEntry, 0, m_textureEntry.Length);
+ }
catch { }
- m_log.Warn("[SHAPE]: Failed to decode texture, length=" + ((m_textureEntry != null) ? m_textureEntry.Length : 0));
return new Primitive.TextureEntry(UUID.Zero);
}
@@ -1675,7 +1665,7 @@ public void ReadXml(string rawXml)
}
catch
{
- m_log.Debug("PrimitiveBaseShape] error decoding MOAP xml" );
+ // PrimitiveBaseShape] error decoding MOAP xml
}
}
diff --git a/Source/OpenSim.Framework/RegionInfo.cs b/Source/OpenSim.Framework/RegionInfo.cs
index c8407bd492c..7cdb885cf9c 100644
--- a/Source/OpenSim.Framework/RegionInfo.cs
+++ b/Source/OpenSim.Framework/RegionInfo.cs
@@ -25,21 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using log4net;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Configuration.Ini;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
-
using System.Net;
-using System.Reflection;
-using System.Xml;
namespace OpenSim.Framework
{
public class RegionInfo
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly string LogHeader = "[REGION INFO]";
public bool commFailTF = false;
@@ -437,13 +430,13 @@ public void SetEndPoint(string ipaddr, int port)
m_internalEndPoint = tmpEPE;
}
- public string GetSetting(string key)
+ public string? GetSetting(string key)
{
string val;
string keylower = key.ToLower();
if (m_extraSettings.TryGetValue(keylower, out val))
return val;
- m_log.DebugFormat("[RegionInfo] Could not locate value for parameter {0}", key);
+
return null;
}
@@ -749,9 +742,6 @@ private void DoDefaultLandingSanityChecks()
// Height
if (DefaultLandingPoint.Z < 0f)
DefaultLandingPoint.Z = 0f;
-
- if (ValuesCapped)
- m_log.WarnFormat("[RegionInfo]: The default landing location for {0} has been capped to {1}", RegionName, DefaultLandingPoint);
}
// Make sure user specified region sizes are sane.
@@ -768,17 +758,14 @@ private void DoRegionSizeSanityChecks()
RegionSizeX -= partial;
if (RegionSizeX == 0)
RegionSizeX = Constants.RegionSize;
- m_log.ErrorFormat("{0} Region size must be multiple of {1}. Enforcing {2}.RegionSizeX={3} instead of specified {4}",
- LogHeader, Constants.RegionSize, m_regionName, RegionSizeX, RegionSizeX + partial);
}
+
partial = RegionSizeY % Constants.RegionSize;
if (partial != 0)
{
RegionSizeY -= partial;
if (RegionSizeY == 0)
RegionSizeY = Constants.RegionSize;
- m_log.ErrorFormat("{0} Region size must be multiple of {1}. Enforcing {2}.RegionSizeY={3} instead of specified {4}",
- LogHeader, Constants.RegionSize, m_regionName, RegionSizeY, RegionSizeY + partial);
}
// Because of things in the viewer, regions MUST be square.
@@ -788,8 +775,6 @@ private void DoRegionSizeSanityChecks()
uint minSize = Math.Min(RegionSizeX, RegionSizeY);
RegionSizeX = minSize;
RegionSizeY = minSize;
- m_log.ErrorFormat("{0} Regions must be square until viewers are updated. Forcing region {1} size to <{2},{3}>",
- LogHeader, m_regionName, RegionSizeX, RegionSizeY);
}
// There is a practical limit to region size.
@@ -797,11 +782,7 @@ private void DoRegionSizeSanityChecks()
{
RegionSizeX = Util.Clamp(RegionSizeX, Constants.RegionSize, Constants.MaximumRegionSize);
RegionSizeY = Util.Clamp(RegionSizeY, Constants.RegionSize, Constants.MaximumRegionSize);
- m_log.ErrorFormat("{0} Region dimensions must be less than {1}. Clamping {2}'s size to <{3},{4}>",
- LogHeader, Constants.MaximumRegionSize, m_regionName, RegionSizeX, RegionSizeY);
}
-
- m_log.InfoFormat("{0} Region {1} size set to <{2},{3}>", LogHeader, m_regionName, RegionSizeX, RegionSizeY);
}
}
diff --git a/Source/OpenSim.Framework/RestClient.cs b/Source/OpenSim.Framework/RestClient.cs
index 49c7f632a55..75cdf0162d5 100644
--- a/Source/OpenSim.Framework/RestClient.cs
+++ b/Source/OpenSim.Framework/RestClient.cs
@@ -25,18 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
using System.Net;
-using System.Net.Http;
-using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
-using System.Threading;
using System.Web;
-using log4net;
-
+using Microsoft.Extensions.Logging;
using OpenSim.Framework.ServiceAuth;
namespace OpenSim.Framework
@@ -49,8 +42,6 @@ namespace OpenSim.Framework
///
public class RestClient : IDisposable
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
// private string realuri;
#region member variables
@@ -103,15 +94,18 @@ public class RestClient : IDisposable
/// Instantiate a new RestClient
///
/// Web-service to query, e.g. http://osgrid.org:8003
- public RestClient(string url)
+ public RestClient(ILogger logger, string url)
{
+ _logger = logger;
+ _lock = new object();
+
_url = url;
_readbuf = new byte[BufferSize];
_resource = new MemoryStream();
- _lock = new object();
}
private readonly object _lock;
+ private readonly ILogger _logger;
#endregion constructors
@@ -164,11 +158,11 @@ public void AddQueryParameter(string name, string value)
}
catch (ArgumentException)
{
- m_log.Error("[REST]: Query parameter " + name + " is already added.");
+ _logger.LogError($"[REST]: Query parameter {name} is already added.");
}
catch (Exception e)
{
- m_log.Error("[REST]: An exception was raised adding query parameter to dictionary. Exception: {0}",e);
+ _logger.LogError(e, "[REST]: An exception was raised adding query parameter to dictionary.");
}
}
@@ -184,11 +178,11 @@ public void AddQueryParameter(string name)
}
catch (ArgumentException)
{
- m_log.Error("[REST]: Query parameter " + name + " is already added.");
+ _logger.LogError($"[REST]: Query parameter {name} is already added.");
}
catch (Exception e)
{
- m_log.Error("[REST]: An exception was raised adding query parameter to dictionary. Exception: {0}",e);
+ _logger.LogError(e, "[REST]: An exception was raised adding query parameter to dictionary.");
}
}
@@ -234,8 +228,7 @@ private Uri buildUri()
sb.Append(kv.Value);
}
}
- // realuri = sb.ToString();
- //m_log.InfoFormat("[REST CLIENT]: RestURL: {0}", realuri);
+
return new Uri(sb.ToString());
}
@@ -243,15 +236,15 @@ private Uri buildUri()
/// Perform a synchronous request
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public MemoryStream Request()
+ public MemoryStream? Request(ILogger logger)
{
- return Request(null);
+ return Request(logger, auth: null);
}
///
/// Perform a synchronous request
///
- public MemoryStream Request(IServiceAuth auth)
+ public MemoryStream? Request(ILogger logger, IServiceAuth auth)
{
lock (_lock)
{
@@ -280,7 +273,9 @@ public MemoryStream Request(IServiceAuth auth)
if (WebUtil.DebugLevel >= 3)
- m_log.DebugFormat("[REST CLIENT] {0} to {1}", RequestMethod, uri);
+ {
+ _logger.LogDebug($"[REST CLIENT] {RequestMethod} to {uri}");
+ }
//_request.ContentType = "application/xml";
responseMessage = client.Send(request, HttpCompletionOption.ResponseHeadersRead);
@@ -303,22 +298,23 @@ public MemoryStream Request(IServiceAuth auth)
if (status == HttpStatusCode.NotFound)
{
// This is often benign. E.g., requesting a missing asset will return 404.
- m_log.DebugFormat("[REST CLIENT] Resource not found (404): {0}", uri.ToString());
+ _logger.LogDebug($"[REST CLIENT] Resource not found (404): {uri}");
}
else
{
- m_log.Error($"[REST CLIENT] Error fetching resource from server: {uri} status: {status} {e.Message}");
+ _logger.LogError(e, $"[REST CLIENT] Error fetching resource from server: {uri} status: {status}");
}
}
else
{
- m_log.Error($"[REST CLIENT] Error fetching resource from server: {uri} {e.Message}");
+ _logger.LogError(e, $"[REST CLIENT] Error fetching resource from server: {uri}");
}
}
else
{
- m_log.Error($"[REST CLIENT] Error fetching null resource from server: {e.Message}");
+ _logger.LogError(e, $"[REST CLIENT] Error fetching null resource from server.");
}
+
return null;
}
finally
@@ -335,7 +331,9 @@ public MemoryStream Request(IServiceAuth auth)
}
if (WebUtil.DebugLevel >= 5)
- WebUtil.LogOutgoingDetail("[REST CLIENT]", _resource);
+ {
+ // WebUtil.LogOutgoingDetail(logger, "[REST CLIENT]", _resource);
+ }
return _resource;
}
@@ -376,23 +374,23 @@ public void POSTRequest(byte[] src, IServiceAuth auth)
}
catch (HttpRequestException e)
{
- if(uri is not null)
+ if (uri is not null)
{
if (e.StatusCode is HttpStatusCode status)
- m_log.Warn($"[REST]: POST {uri} failed with status {status} and message {e.Message}");
+ _logger.LogWarning(e, $"[REST]: POST {uri} failed with status {status}");
else
- m_log.Warn($"[REST]: POST {uri} failed with message {e.Message}");
+ _logger.LogError(e, $"[REST]: POST {uri}");
}
else
- m_log.Warn($"[REST]: POST failed {e.Message}");
+ _logger.LogError(e, $"[REST]: POST failed");
return;
}
catch (Exception e)
{
if (uri is not null)
- m_log.Warn($"[REST]: POST {uri} failed with message {e.Message}");
+ _logger.LogError(e, $"[REST]: POST {uri}");
else
- m_log.Warn($"[REST]: POST failed {e.Message}");
+ _logger.LogError(e, $"[REST]: POST failed");
return;
}
finally
diff --git a/Source/OpenSim.Framework/ServiceAuth/BasicHttpAuthentication.cs b/Source/OpenSim.Framework/ServiceAuth/BasicHttpAuthentication.cs
index 23210500cbb..7d0ea661811 100644
--- a/Source/OpenSim.Framework/ServiceAuth/BasicHttpAuthentication.cs
+++ b/Source/OpenSim.Framework/ServiceAuth/BasicHttpAuthentication.cs
@@ -25,14 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
-using System.Reflection;
-
-using Nini.Config;
-using log4net;
using System.Net.Http.Headers;
using Microsoft.Extensions.Configuration;
@@ -40,8 +34,6 @@ namespace OpenSim.Framework.ServiceAuth
{
public class BasicHttpAuthentication : IServiceAuth
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public string Name { get { return "BasicHttp"; } }
private string m_Username, m_Password;
diff --git a/Source/OpenSim.Framework/ServiceAuth/ServiceAuth.cs b/Source/OpenSim.Framework/ServiceAuth/ServiceAuth.cs
index abb71058692..c32ffe707d4 100644
--- a/Source/OpenSim.Framework/ServiceAuth/ServiceAuth.cs
+++ b/Source/OpenSim.Framework/ServiceAuth/ServiceAuth.cs
@@ -25,12 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using log4net;
using Microsoft.Extensions.Configuration;
-using Nini.Config;
namespace OpenSim.Framework.ServiceAuth
{
diff --git a/Source/OpenSim.Framework/TaskInventoryDictionary.cs b/Source/OpenSim.Framework/TaskInventoryDictionary.cs
index d1a112a69a2..12ede85bf86 100644
--- a/Source/OpenSim.Framework/TaskInventoryDictionary.cs
+++ b/Source/OpenSim.Framework/TaskInventoryDictionary.cs
@@ -25,15 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Reflection;
using System.Xml;
-using System.Diagnostics;
using System.Xml.Schema;
using System.Xml.Serialization;
-using log4net;
using OpenMetaverse;
namespace OpenSim.Framework
@@ -50,7 +44,6 @@ public class TaskInventoryDictionary : Dictionary, IClo
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Thread LockedByThread;
// private string WriterStack;
@@ -119,7 +112,7 @@ public void LockItemsForRead(bool locked)
if (m_itemLock.RecursiveReadCount > 0)
{
- m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
+ //m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
try
{
// That call stack is useful for end users only. RealProgrammers need a full dump. Commented.
@@ -148,7 +141,7 @@ public void LockItemsForRead(bool locked)
}
if (m_itemLock.RecursiveWriteCount > 0)
{
- m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
+// m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
// try
// {
// System.Console.WriteLine("------------------------------------------");
@@ -164,9 +157,9 @@ public void LockItemsForRead(bool locked)
while (!m_itemLock.TryEnterReadLock(60000))
{
- m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
- //if (m_itemLock.IsWriteLockHeld)
- //{
+// m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
+// if (m_itemLock.IsWriteLockHeld)
+// {
m_itemLock = new System.Threading.ReaderWriterLockSlim();
// System.Console.WriteLine("------------------------------------------");
// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
@@ -200,12 +193,12 @@ public void LockItemsForWrite(bool locked)
//Enter a write lock, wait indefinately for one to open.
if (m_itemLock.RecursiveReadCount > 0)
{
- m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
+// m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
m_itemLock.ExitReadLock();
}
if (m_itemLock.RecursiveWriteCount > 0)
{
- m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
+// m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
m_itemLock.ExitWriteLock();
}
@@ -213,7 +206,7 @@ public void LockItemsForWrite(bool locked)
{
if (m_itemLock.IsWriteLockHeld)
{
- m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
+// m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
// System.Console.WriteLine("------------------------------------------");
// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
// System.Console.WriteLine("------------------------------------------");
@@ -222,7 +215,7 @@ public void LockItemsForWrite(bool locked)
}
else
{
- m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by a reader. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
+// m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by a reader. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
// System.Console.WriteLine("------------------------------------------");
// System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
// System.Console.WriteLine("------------------------------------------");
diff --git a/Source/OpenSim.Framework/TaskInventoryItem.cs b/Source/OpenSim.Framework/TaskInventoryItem.cs
index 68e2babe2d0..fed246d1b18 100644
--- a/Source/OpenSim.Framework/TaskInventoryItem.cs
+++ b/Source/OpenSim.Framework/TaskInventoryItem.cs
@@ -25,9 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Reflection;
-using log4net;
using OpenMetaverse;
namespace OpenSim.Framework
diff --git a/Source/OpenSim.Framework/TerrainData.cs b/Source/OpenSim.Framework/TerrainData.cs
index bbaebb838c0..aafa08c0138 100644
--- a/Source/OpenSim.Framework/TerrainData.cs
+++ b/Source/OpenSim.Framework/TerrainData.cs
@@ -25,15 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections;
-using System.IO;
using System.IO.Compression;
-using System.Reflection;
-
-using OpenMetaverse;
-
-using log4net;
namespace OpenSim.Framework
{
@@ -68,9 +60,6 @@ public enum DBTerrainRevision
public class TerrainData
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private static string LogHeader = "[TERRAIN DATA]";
-
private float[,] m_heightmap;
// Remember subregions of the heightmap that has changed.
@@ -470,7 +459,6 @@ public TerrainData(double[,] pTerrain)
}
}
- // m_log.DebugFormat("{0} new by doubles. sizeX={1}, sizeY={2}, sizeZ={3}", LogHeader, SizeX, SizeY, SizeZ);
m_taints = new TerrainTaintsArray(m_taintSizeX * m_taintSizeY);
}
@@ -489,7 +477,6 @@ public TerrainData(int pX, int pY, int pZ)
m_heightmap = new float[SizeX, SizeY];
m_taints = new TerrainTaintsArray(m_taintSizeX * m_taintSizeY);
- // m_log.DebugFormat("{0} new by dimensions. sizeX={1}, sizeY={2}, sizeZ={3}", LogHeader, SizeX, SizeY, SizeZ);
ClearLand(0f);
}
@@ -501,7 +488,6 @@ public TerrainData(float[] cmap, float pCompressionFactor, int pX, int pY, int p
for (int xx = 0; xx < SizeX; xx++)
for (int yy = 0; yy < SizeY; yy++)
m_heightmap[xx, yy] = cmap[ind++];
- // m_log.DebugFormat("{0} new by compressed map. sizeX={1}, sizeY={2}, sizeZ={3}", LogHeader, SizeX, SizeY, SizeZ);
}
// Create a heighmap from a database blob
@@ -512,20 +498,16 @@ public TerrainData(int pSizeX, int pSizeY, int pSizeZ, int pFormatCode, byte[] p
{
case DBTerrainRevision.Variable2DGzip:
FromCompressedTerrainSerializationV2DGZip(pBlob);
- m_log.DebugFormat("{0} HeightmapTerrainData create from Variable2DGzip serialization. Size=<{1},{2}>", LogHeader, SizeX, SizeY);
break;
case DBTerrainRevision.Variable2D:
FromCompressedTerrainSerializationV2D(pBlob);
- m_log.DebugFormat("{0} HeightmapTerrainData create from Variable2D serialization. Size=<{1},{2}>", LogHeader, SizeX, SizeY);
break;
case DBTerrainRevision.Compressed2D:
FromCompressedTerrainSerialization2D(pBlob);
- m_log.DebugFormat("{0} HeightmapTerrainData create from Compressed2D serialization. Size=<{1},{2}>", LogHeader, SizeX, SizeY);
break;
default:
FromLegacyTerrainSerialization(pBlob);
- m_log.DebugFormat("{0} HeightmapTerrainData create from legacy serialization. Size=<{1},{2}>", LogHeader, SizeX, SizeY);
break;
}
}
@@ -593,7 +575,7 @@ public void FromLegacyTerrainSerialization(byte[] pBlob)
// int32 sizeY
// float[,] array
- public Array ToCompressedTerrainSerializationV2D()
+ public Array? ToCompressedTerrainSerializationV2D()
{
Array ret = null;
try
@@ -617,8 +599,6 @@ public Array ToCompressedTerrainSerializationV2D()
}
catch {}
- m_log.DebugFormat("{0} V2D {1} bytes", LogHeader, ret.Length);
-
return ret;
}
@@ -658,7 +638,6 @@ public Array ToCompressedTerrainSerializationV2DGzip()
}
catch {}
- m_log.DebugFormat("{0} V2DGzip {1} bytes", LogHeader, ret.Length);
return ret;
}
@@ -708,9 +687,6 @@ public void FromCompressedTerrainSerialization2D(byte[] pBlob)
}
}
ClearTaint();
-
- m_log.DebugFormat("{0} Read (compressed2D) heightmap. Heightmap size=<{1},{2}>. Region size=<{3},{4}>. CompFact={5}",
- LogHeader, hmSizeX, hmSizeY, SizeX, SizeY, hmCompressionFactor);
}
}
@@ -759,22 +735,15 @@ public void FromCompressedTerrainSerializationV2D(byte[] pBlob)
catch (Exception e)
{
ClearTaint();
- m_log.ErrorFormat("{0} 2D error: {1} - terrain may be damaged",
- LogHeader, e.Message);
return;
}
- ClearTaint();
-
- m_log.DebugFormat("{0} V2D Heightmap size=<{1},{2}>. Region size=<{3},{4}>",
- LogHeader, hmSizeX, hmSizeY, SizeX, SizeY);
+ ClearTaint();
}
// as above but Gzip compressed
public void FromCompressedTerrainSerializationV2DGZip(byte[] pBlob)
{
- m_log.InfoFormat("{0} VD2Gzip {1} bytes input",
- LogHeader, pBlob.Length);
int hmSizeX, hmSizeY;
try
@@ -825,15 +794,10 @@ public void FromCompressedTerrainSerializationV2DGZip(byte[] pBlob)
catch( Exception e)
{
ClearTaint();
- m_log.ErrorFormat("{0} V2DGzip error: {1} - terrain may be damaged",
- LogHeader, e.Message);
return;
}
ClearTaint();
- m_log.DebugFormat("{0} V2DGzip. Heightmap size=<{1},{2}>. Region size=<{3},{4}>",
- LogHeader, hmSizeX, hmSizeY, SizeX, SizeY);
-
}
}
}
diff --git a/Source/OpenSim.Framework/Util.cs b/Source/OpenSim.Framework/Util.cs
index 44ea6f2d357..8f0f51aebf3 100644
--- a/Source/OpenSim.Framework/Util.cs
+++ b/Source/OpenSim.Framework/Util.cs
@@ -25,39 +25,33 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Collections.Generic;
+using System.Collections.Concurrent;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
-using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
-using System.Threading;
-using log4net;
-using log4net.Appender;
-using Nini.Config;
+
using Nwc.XmlRpc;
+using Amib.Threading;
+
using OpenMetaverse;
using OpenMetaverse.StructuredData;
-using Amib.Threading;
-using System.Collections.Concurrent;
-using System.Net.Http;
+
using Microsoft.Extensions.Configuration;
+
namespace OpenSim.Framework
{
[Flags]
@@ -141,8 +135,6 @@ public class STPInfo
///
public static class Util
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Log-level for the thread pool:
/// 0 = no logging
@@ -164,7 +156,7 @@ static Util()
LogOverloads = true;
TimeStampClockPeriod = 1.0D / (double)Stopwatch.Frequency;
TimeStampClockPeriodMS = 1e3 * TimeStampClockPeriod;
- m_log.Info($"[UTIL] TimeStamp clock with period of {Math.Round(TimeStampClockPeriodMS, 6, MidpointRounding.AwayFromZero)}ms");
+// m_log.Info($"[UTIL] TimeStamp clock with period of {Math.Round(TimeStampClockPeriodMS, 6, MidpointRounding.AwayFromZero)}ms");
}
private static uint nextXferID = 5000;
@@ -1097,11 +1089,11 @@ public static bool LoadArchSpecificWindowsDll(string libraryName, string path)
else
nativeLibraryPath = Path.Combine(Path.Combine(path, "lib32"), libraryName);
- m_log.Debug($"[UTIL]: Loading native Windows library at {nativeLibraryPath}");
+ // m_log.Debug($"[UTIL]: Loading native Windows library at {nativeLibraryPath}");
if (!NativeLibrary.TryLoad(nativeLibraryPath, out _))
{
- m_log.Error($"[UTIL]: Couldn't find native Windows library at {nativeLibraryPath}");
+ // m_log.Error($"[UTIL]: Couldn't find native Windows library at {nativeLibraryPath}");
return false;
}
return true;
@@ -1762,37 +1754,37 @@ public static string dataDir()
return ".";
}
- public static string logFile()
- {
- foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
- {
- if (appender is FileAppender appender1 && appender1.Name == "LogFileAppender")
- {
- return appender1.File;
- }
- }
-
- return "./OpenSim.log";
- }
-
- public static string StatsLogFile()
- {
- foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
- {
- if (appender is FileAppender appender1 && appender1.Name == "StatsLogFileAppender")
- {
- return appender1.File;
- }
- }
-
- return "./OpenSimStats.log";
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static string logDir()
- {
- return Path.GetDirectoryName(logFile());
- }
+ //public static string logFile()
+ //{
+ // foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
+ // {
+ // if (appender is FileAppender appender1 && appender1.Name == "LogFileAppender")
+ // {
+ // return appender1.File;
+ // }
+ // }
+
+ // return "./OpenSim.log";
+ //}
+
+ //public static string StatsLogFile()
+ //{
+ // foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
+ // {
+ // if (appender is FileAppender appender1 && appender1.Name == "StatsLogFileAppender")
+ // {
+ // return appender1.File;
+ // }
+ // }
+
+ // return "./OpenSimStats.log";
+ //}
+
+ //[MethodImpl(MethodImplOptions.AggressiveInlining)]
+ //public static string logDir()
+ //{
+ // return Path.GetDirectoryName(logFile());
+ //}
// From: http://coercedcode.blogspot.com/2008/03/c-generate-unique-filenames-within.html
public static string GetUniqueFilename(string FileName)
@@ -1915,8 +1907,8 @@ public static T GetConfigVarFromSections(IConfiguration config, string varnam
val = cnf.GetValue(varname, (float)val);
else if (typeof(T) == typeof(double))
val = cnf.GetValue(varname, (double)val);
- else
- m_log.ErrorFormat($"[UTIL]: Unhandled type {typeof(T)}");
+ //else
+ // m_log.ErrorFormat($"[UTIL]: Unhandled type {typeof(T)}");
}
return (T)val;
@@ -2477,13 +2469,13 @@ public static OSDMap GetOSDMap(string data)
else
{
// uh?
- m_log.Debug($"[UTILS]: Got OSD of unexpected type {buffer.Type}");
+ //m_log.Debug($"[UTILS]: Got OSD of unexpected type {buffer.Type}");
return null;
}
}
catch (Exception ex)
{
- m_log.Debug($"[UTILS]: exception on GetOSDMap {ex.Message}");
+ //m_log.Debug($"[UTILS]: exception on GetOSDMap {ex.Message}");
return null;
}
}
@@ -2892,23 +2884,19 @@ public static void InitThreadPool(int minThreads, int maxThreads)
if (minThreads > maxThreads || minThreads < 2)
throw new ArgumentOutOfRangeException(nameof(minThreads), "minThreads must be greater than 2 and less than or equal to maxThreads");
- if (m_ThreadPool != null)
+ if (m_ThreadPool is null)
{
- m_log.Warn("SmartThreadPool is already initialized. Ignoring request.");
- return;
- }
-
- STPStartInfo startInfo = new()
- {
- ThreadPoolName = "Util",
- IdleTimeout = 20000,
- MaxWorkerThreads = maxThreads,
- MinWorkerThreads = minThreads,
- SuppressFlow = true
- };
+ STPStartInfo startInfo = new()
+ {
+ ThreadPoolName = "Util",
+ IdleTimeout = 20000,
+ MaxWorkerThreads = maxThreads,
+ MinWorkerThreads = minThreads,
+ };
- m_ThreadPool = new SmartThreadPool(startInfo);
- m_threadPoolWatchdog = new Timer(ThreadPoolWatchdog, null, 0, 1000);
+ m_ThreadPool = new SmartThreadPool(startInfo);
+ m_threadPoolWatchdog = new Timer(ThreadPoolWatchdog, null, 0, 1000);
+ }
}
public static int FireAndForgetCount()
@@ -3030,7 +3018,7 @@ private static void ThreadPoolWatchdog(object state)
ThreadInfo t = entry.Value;
if (t.DoTimeout && t.Running && !t.Aborted && (t.Elapsed() >= THREAD_TIMEOUT))
{
- m_log.Warn($"Timeout in threadfunc {t.ThreadFuncNum} ({t.Thread.Name}) {t.GetStackTrace()}");
+ // m_log.Warn($"Timeout in threadfunc {t.ThreadFuncNum} ({t.Thread.Name}) {t.GetStackTrace()}");
t.Abort();
activeThreads.TryRemove(entry.Key, out _);
@@ -3103,8 +3091,8 @@ public static void FireAndForget(System.Threading.WaitCallback callback, object
try
{
- if (loggingEnabled && threadInfo.LogThread)
- m_log.DebugFormat("Run threadfunc {0} (Queued {1}, Running {2})", threadFuncNum, numQueued1, numRunning1);
+ //if (loggingEnabled && threadInfo.LogThread)
+ // m_log.DebugFormat("Run threadfunc {0} (Queued {1}, Running {2})", threadFuncNum, numQueued1, numRunning1);
Culture.SetCurrentCulture();
callback(o);
@@ -3114,14 +3102,16 @@ public static void FireAndForget(System.Threading.WaitCallback callback, object
}
catch (Exception e)
{
- m_log.Error($"[UTIL]: Util STP threadfunc {threadFuncNum} terminated with error {e.Message}");
+ // m_log.Error($"[UTIL]: Util STP threadfunc {threadFuncNum} terminated with error {e.Message}");
}
finally
{
Interlocked.Decrement(ref numRunningThreadFuncs);
activeThreads.TryRemove(threadFuncNum, out ThreadInfo dummy);
- if (loggingEnabled && threadInfo.LogThread)
- m_log.Debug($"Exit threadfunc {threadFuncNum} ({FormatDuration(threadInfo.Elapsed())}");
+
+ //if (loggingEnabled && threadInfo.LogThread)
+ // m_log.Debug($"Exit threadfunc {threadFuncNum} ({FormatDuration(threadInfo.Elapsed())}");
+
callback = null;
o = null;
threadInfo = null;
@@ -3140,18 +3130,22 @@ public static void FireAndForget(System.Threading.WaitCallback callback, object
case FireAndForgetMethod.None:
realCallback.Invoke(obj);
break;
+
case FireAndForgetMethod.QueueUserWorkItem:
ThreadPool.UnsafeQueueUserWorkItem(realCallback, obj);
break;
- case FireAndForgetMethod.SmartThreadPool:
- if (m_ThreadPool == null)
- InitThreadPool(2, 15);
- threadInfo.WorkItem = m_ThreadPool.QueueWorkItem(realCallback, obj);
- break;
+
+ //case FireAndForgetMethod.SmartThreadPool:
+ // if (m_ThreadPool == null)
+ // InitThreadPool(2, 15);
+ // threadInfo.WorkItem = m_ThreadPool.QueueWorkItem(realCallback, obj);
+ // break;
+
case FireAndForgetMethod.Thread:
Thread thread = new(delegate (object o) { realCallback(o); realCallback = null; });
thread.Start(obj);
break;
+
default:
throw new NotImplementedException();
}
@@ -3499,27 +3493,27 @@ public static string FormatDuration(int ms)
return str;
}
- ///
- /// Prints the call stack at any given point. Useful for debugging.
- ///
- public static void PrintCallStack()
- {
- PrintCallStack(m_log.DebugFormat);
- }
-
- public delegate void DebugPrinter(string msg, params Object[] parm);
- public static void PrintCallStack(DebugPrinter printer)
- {
- StackTrace stackTrace = new(true); // get call stack
- StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
-
- // write call stack method names
- foreach (StackFrame stackFrame in stackFrames)
- {
- MethodBase mb = stackFrame.GetMethod();
- printer($"{mb.DeclaringType}.{mb.Name}:{stackFrame.GetFileLineNumber()}"); // write method name
- }
- }
+ /////
+ ///// Prints the call stack at any given point. Useful for debugging.
+ /////
+ //public static void PrintCallStack()
+ //{
+ // PrintCallStack(m_log.DebugFormat);
+ //}
+
+ //public delegate void DebugPrinter(string msg, params Object[] parm);
+ //public static void PrintCallStack(DebugPrinter printer)
+ //{
+ // StackTrace stackTrace = new(true); // get call stack
+ // StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
+
+ // // write call stack method names
+ // foreach (StackFrame stackFrame in stackFrames)
+ // {
+ // MethodBase mb = stackFrame.GetMethod();
+ // printer($"{mb.DeclaringType}.{mb.Name}:{stackFrame.GetFileLineNumber()}"); // write method name
+ // }
+ //}
///
/// Gets the client IP address
@@ -3540,7 +3534,7 @@ public static IPEndPoint GetClientIPFromXFF(string xff)
}
catch (Exception e)
{
- m_log.Warn($"[UTIL]: Exception parsing XFF header {xff}: {e.Message}");
+ //m_log.Warn($"[UTIL]: Exception parsing XFF header {xff}: {e.Message}");
}
}
@@ -3559,7 +3553,7 @@ public static string GetCallerIP(Hashtable req)
}
catch (Exception e)
{
- m_log.Warn($"[UTIL]: exception in GetCallerIP: {e.Message}");
+ //m_log.Warn($"[UTIL]: exception in GetCallerIP: {e.Message}");
}
}
return string.Empty;
@@ -4301,23 +4295,23 @@ public static string GetViewerName(AgentCircuitData agent)
return name;
}
- public static void LogFailedXML(string message, string xml)
- {
- int length = xml.Length;
- if (length > 250)
- xml = xml[..250] + "...";
+ //public static void LogFailedXML(string message, string xml)
+ //{
+ // int length = xml.Length;
+ // if (length > 250)
+ // xml = xml[..250] + "...";
- for (int i = 0; i < xml.Length; i++)
- {
- if (xml[i] < 0x20)
- {
- xml = "Unprintable binary data";
- break;
- }
- }
+ // for (int i = 0; i < xml.Length; i++)
+ // {
+ // if (xml[i] < 0x20)
+ // {
+ // xml = "Unprintable binary data";
+ // break;
+ // }
+ // }
- m_log.Error($"{message} Failed XML ({length} bytes) = {xml}");
- }
+ // //m_log.Error($"{message} Failed XML ({length} bytes) = {xml}");
+ //}
///
/// Performs a high quality image resize
diff --git a/Source/OpenSim.Framework/WebUtil.cs b/Source/OpenSim.Framework/WebUtil.cs
index 1a9d9cc1e51..837a4ee0418 100644
--- a/Source/OpenSim.Framework/WebUtil.cs
+++ b/Source/OpenSim.Framework/WebUtil.cs
@@ -25,11 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
using System.Collections.Specialized;
using System.Globalization;
-using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Security;
@@ -40,14 +38,13 @@
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Linq;
-using log4net;
+
using Nwc.XmlRpc;
+
using OpenMetaverse.StructuredData;
using OpenSim.Framework.ServiceAuth;
-using System.Net.Http;
using System.Security.Authentication;
using System.Runtime.CompilerServices;
-using System.Threading;
namespace OpenSim.Framework
{
@@ -58,8 +55,6 @@ namespace OpenSim.Framework
public static class WebUtil
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public static SocketsHttpHandler SharedSocketsHttpHandlerNoRedir = null;
public static SocketsHttpHandler SharedSocketsHttpHandler = null;
@@ -339,7 +334,7 @@ public static void LogOutgoingDetail(string context, string output)
output = output[..MaxRequestDiagLength] + "...";
}
- m_log.DebugFormat($"[LOGHTTP]: {context}{Util.BinaryToASCII(output)}");
+ //m_log.DebugFormat($"[LOGHTTP]: {context}{Util.BinaryToASCII(output)}");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -359,7 +354,9 @@ public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, i
int reqnum = RequestNumber++;
if (DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} JSON-RPC {method} to {url}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} JSON-RPC {method} to {url}");
+ }
string errorMessage = "unknown error";
int ticks = Util.EnvironmentTickCount();
@@ -443,7 +440,7 @@ public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, i
catch (Exception ex)
{
errorMessage = ex.Message;
- m_log.Debug($"[WEB UTIL]: Exception making request: {errorMessage}");
+ //m_log.Debug($"[WEB UTIL]: Exception making request: {errorMessage}");
}
finally
{
@@ -454,15 +451,15 @@ public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, i
ticks = Util.EnvironmentTickCountSubtract(ticks);
if (ticks > LongCallTime)
{
- m_log.Info($"[WEB UTIL]: SvcOSD {reqnum} {method} {url} took {ticks}ms, {sendlen}/{rcvlen}bytes");
+ //m_log.Info($"[WEB UTIL]: SvcOSD {reqnum} {method} {url} took {ticks}ms, {sendlen}/{rcvlen}bytes");
}
else if (DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
}
}
- m_log.Debug($"[LOGHTTP]: request {reqnum} {method} to {url} FAILED: {errorMessage}");
+ //m_log.Debug($"[LOGHTTP]: request {reqnum} {method} to {url} FAILED: {errorMessage}");
return ErrorResponseMap(errorMessage);
}
@@ -508,7 +505,7 @@ private static OSDMap CanonicalizeResults(string response)
catch
{
// don't need to treat this as an error... we're just guessing anyway
- //m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message);
+ ////m_log.DebugFormat("[WEB UTIL] couldn't decode <{0}>: {1}",response,e.Message);
}
return result;
@@ -534,7 +531,9 @@ public static OSDMap ServiceFormRequest(string url, NameValueCollection data, in
string method = (data is not null && data["RequestMethod"] is not null) ? data["RequestMethod"] : "unknown";
if (DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} ServiceForm '{method}' to {url}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} ServiceForm '{method}' to {url}");
+ }
string errorMessage = "unknown error";
int ticks = Util.EnvironmentTickCount();
@@ -620,16 +619,15 @@ public static OSDMap ServiceFormRequest(string url, NameValueCollection data, in
ticks = Util.EnvironmentTickCountSubtract(ticks);
if (ticks > LongCallTime)
{
- m_log.Info(
- $"[LOGHTTP]: Slow ServiceForm request {reqnum} '{method}' to {url} took {ticks}ms, {sendlen}/{rcvlen}bytes");
+ //m_log.Info($"[LOGHTTP]: Slow ServiceForm request {reqnum} '{method}' to {url} took {ticks}ms, {sendlen}/{rcvlen}bytes");
}
else if (DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
}
}
- m_log.Warn($"[LOGHTTP]: ServiceForm request {reqnum} '{method}' to {url} failed: {errorMessage}");
+ //m_log.Warn($"[LOGHTTP]: ServiceForm request {reqnum} '{method}' to {url} failed: {errorMessage}");
return ErrorResponseMap(errorMessage);
}
@@ -900,8 +898,6 @@ public static string[] GetPreferredImageTypes(string accept)
public static class AsynchronousRestObjectRequester
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Perform an asynchronous REST request.
///
@@ -951,7 +947,9 @@ public static void MakeRequest(string verb,
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} AsynchronousRequestObject {verb} to {requestUrl}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} AsynchronousRequestObject {verb} to {requestUrl}");
+ }
int tickstart = Util.EnvironmentTickCount();
int tickdata = 0;
@@ -1065,24 +1063,22 @@ public static void MakeRequest(string verb,
{
// We don't appear to be handling any other status codes, so log these feailures to that
// people don't spend unnecessary hours hunting phantom bugs.
- m_log.Debug(
- $"[ASYNC REQUEST]: Request {verb} {requestUrl} failed with unexpected status code {httpResponse.StatusCode}");
+ //m_log.Debug($"[ASYNC REQUEST]: Request {verb} {requestUrl} failed with unexpected status code {httpResponse.StatusCode}");
}
httpResponse.Dispose();
}
}
else
{
- m_log.Error(
- $"[ASYNC REQUEST]: Request {verb} {requestUrl} failed with status {e.Status} and message {e.Message}");
+ //m_log.Error($"[ASYNC REQUEST]: Request {verb} {requestUrl} failed with status {e.Status} and message {e.Message}");
}
}
catch (Exception e)
{
- m_log.Error($"[ASYNC REQUEST]: Request {verb} {requestUrl} failed with exception {e.Message}");
+ //m_log.Error($"[ASYNC REQUEST]: Request {verb} {requestUrl} failed with exception {e.Message}");
}
- //m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
+ ////m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
try
{
@@ -1090,7 +1086,7 @@ public static void MakeRequest(string verb,
}
catch (Exception e)
{
- m_log.ErrorFormat($"[ASYNC REQUEST]: Request {verb} {requestUrl} callback failed with exception {e.Message}");
+ //m_log.ErrorFormat($"[ASYNC REQUEST]: Request {verb} {requestUrl} callback failed with exception {e.Message}");
}
}, null);
@@ -1108,14 +1104,14 @@ public static void MakeRequest(string verb,
if (originalRequest.Length > WebUtil.MaxRequestDiagLength)
originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength);
}
- m_log.InfoFormat(
- "[LOGHTTP]: Slow AsynchronousRequestObject request {0} {1} to {2} took {3}ms, {4}ms writing, {5}",
- reqnum, verb, requestUrl, tickdiff, tickdata,
- originalRequest);
+ //m_log.InfoFormat(
+ // "[LOGHTTP]: Slow AsynchronousRequestObject request {0} {1} to {2} took {3}ms, {4}ms writing, {5}",
+ // reqnum, verb, requestUrl, tickdiff, tickdata,
+ // originalRequest);
}
else if (WebUtil.DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {tickdiff}ms, {tickdata}ms writing");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {tickdiff}ms, {tickdata}ms writing");
}
}
catch { }
@@ -1124,8 +1120,6 @@ public static void MakeRequest(string verb,
public static class SynchronousRestFormsRequester
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Perform a synchronous REST request.
///
@@ -1143,7 +1137,9 @@ public static string MakeRequest(string method, string requestUrl, string obj, i
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SynchronousRestForms {method} to {requestUrl}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SynchronousRestForms {method} to {requestUrl}");
+ }
int ticks = Util.EnvironmentTickCount();
HttpResponseMessage responseMessage = null;
@@ -1199,7 +1195,7 @@ public static string MakeRequest(string method, string requestUrl, string obj, i
}
catch (Exception e)
{
- m_log.Info($"[FORMS]: Error receiving response from {requestUrl}: {e.Message}");
+ //m_log.Info($"[FORMS]: Error receiving response from {requestUrl}: {e.Message}");
throw;
}
finally
@@ -1212,11 +1208,11 @@ public static string MakeRequest(string method, string requestUrl, string obj, i
ticks = Util.EnvironmentTickCountSubtract(ticks);
if (ticks > WebUtil.LongCallTime)
{
- m_log.Info($"[FORMS]: request {reqnum} {method} {requestUrl} took {ticks}ms, {sendlen}/{rcvlen}bytes");
+ //m_log.Info($"[FORMS]: request {reqnum} {method} {requestUrl} took {ticks}ms, {sendlen}/{rcvlen}bytes");
}
else if (WebUtil.DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
if (WebUtil.DebugLevel >= 5)
WebUtil.LogResponseDetail(reqnum, respstring);
}
@@ -1236,7 +1232,9 @@ public static string MakePostRequest(string requestUrl, string obj,
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SynchronousRestForms POST to {requestUrl}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SynchronousRestForms POST to {requestUrl}");
+ }
int ticks = Util.EnvironmentTickCount();
HttpResponseMessage responseMessage = null;
@@ -1283,7 +1281,7 @@ public static string MakePostRequest(string requestUrl, string obj,
}
catch (Exception e)
{
- m_log.Info($"[FORMS]: Error receiving response from {requestUrl}: {e.Message}");
+ //m_log.Info($"[FORMS]: Error receiving response from {requestUrl}: {e.Message}");
throw;
}
finally
@@ -1296,11 +1294,11 @@ public static string MakePostRequest(string requestUrl, string obj,
ticks = Util.EnvironmentTickCountSubtract(ticks);
if (ticks > WebUtil.LongCallTime)
{
- m_log.Info($"[FORMS]: request {reqnum} POST {requestUrl} took {ticks}ms {sendlen}/{rcvlen}bytes");
+ //m_log.Info($"[FORMS]: request {reqnum} POST {requestUrl} took {ticks}ms {sendlen}/{rcvlen}bytes");
}
else if (WebUtil.DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
if (WebUtil.DebugLevel >= 5)
WebUtil.LogResponseDetail(reqnum, respstring);
}
@@ -1311,8 +1309,6 @@ public static string MakePostRequest(string requestUrl, string obj,
public class SynchronousRestObjectRequester
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Perform a synchronous REST request.
///
@@ -1370,7 +1366,9 @@ public static TResponse MakeRequest(string method, string r
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SRestObjReq {method} {requestUrl}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SRestObjReq {method} {requestUrl}");
+ }
int ticks = Util.EnvironmentTickCount();
TResponse deserial = default;
@@ -1433,17 +1431,17 @@ public static TResponse MakeRequest(string method, string r
}
else
{
- m_log.Debug($"[SRestObjReq]: Oops! no content found in response stream from {method} {requestUrl}");
+ //m_log.Debug($"[SRestObjReq]: Oops! no content found in response stream from {method} {requestUrl}");
}
ticks = Util.EnvironmentTickCountSubtract(ticks);
if (ticks > WebUtil.LongCallTime)
{
- m_log.Info($"[LOGHTTP]: Slow SRestObjReq {reqnum} {method} {requestUrl} took {ticks}ms, {rcvlen}bytes");
+ //m_log.Info($"[LOGHTTP]: Slow SRestObjReq {reqnum} {method} {requestUrl} took {ticks}ms, {rcvlen}bytes");
}
else if (WebUtil.DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
}
}
catch (HttpRequestException e)
@@ -1452,26 +1450,28 @@ public static TResponse MakeRequest(string method, string r
{
if (status == HttpStatusCode.Unauthorized)
{
- m_log.Error($"[SRestObjReq]: GET {requestUrl} requires authentication");
+ //m_log.Error($"[SRestObjReq]: GET {requestUrl} requires authentication");
}
else if (status != HttpStatusCode.NotFound)
{
- m_log.Warn($"[SRestObjReq]: GET {requestUrl} returned error: {status}");
+ //m_log.Warn($"[SRestObjReq]: GET {requestUrl} returned error: {status}");
}
}
else
- m_log.ErrorFormat(
- "[SRestObjReq]: WebException for {0} {1} {2} {3}",
- method, requestUrl, typeof(TResponse).ToString(), e.Message);
+ {
+ //m_log.ErrorFormat(
+ // "[SRestObjReq]: WebException for {0} {1} {2} {3}",
+ // method, requestUrl, typeof(TResponse).ToString(), e.Message);
+ }
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
- m_log.Debug($"[SRestObjReq]: Invalid XML from {method} {requestUrl} {typeof(TResponse)}");
+ //m_log.Debug($"[SRestObjReq]: Invalid XML from {method} {requestUrl} {typeof(TResponse)}");
}
catch (Exception e)
{
- m_log.Debug($"[SRestObjReq]: Exception on response from {method} {requestUrl}: {e.Message}");
+ //m_log.Debug($"[SRestObjReq]: Exception on response from {method} {requestUrl}: {e.Message}");
}
finally
{
@@ -1488,7 +1488,9 @@ public static TResponse MakeGetRequest(string requestUrl, int pTimeou
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SRestObjReq GET {requestUrl}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} SRestObjReq GET {requestUrl}");
+ }
int ticks = Util.EnvironmentTickCount();
TResponse deserial = default;
@@ -1527,43 +1529,45 @@ public static TResponse MakeGetRequest(string requestUrl, int pTimeou
}
else
{
- m_log.Debug($"[SRestObjReq]: Oops! no content found in response stream from GET {requestUrl}");
+ //m_log.Debug($"[SRestObjReq]: Oops! no content found in response stream from GET {requestUrl}");
}
ticks = Util.EnvironmentTickCountSubtract(ticks);
if (ticks > WebUtil.LongCallTime)
{
- m_log.Info($"[LOGHTTP]: Slow SRestObjReq GET {reqnum} {requestUrl} took {ticks}ms, {rcvlen}bytes");
+ //m_log.Info($"[LOGHTTP]: Slow SRestObjReq GET {reqnum} {requestUrl} took {ticks}ms, {rcvlen}bytes");
}
else if (WebUtil.DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {ticks}ms");
}
}
catch (HttpRequestException e)
{
- if(e.StatusCode is HttpStatusCode status)
+ if (e.StatusCode is HttpStatusCode status)
{
if (status == HttpStatusCode.Unauthorized)
{
- m_log.Error($"[SRestObjReq]: GET {requestUrl} requires authentication");
+ //m_log.Error($"[SRestObjReq]: GET {requestUrl} requires authentication");
}
else if (status != HttpStatusCode.NotFound)
{
- m_log.Warn($"[SRestObjReq]: GET {requestUrl} returned error: {status}");
+ //m_log.Warn($"[SRestObjReq]: GET {requestUrl} returned error: {status}");
}
}
else
- m_log.Error($"[SRestObjReq]: WebException for GET {requestUrl} {typeof(TResponse)} {e.Message}");
+ {
+ //m_log.Error($"[SRestObjReq]: WebException for GET {requestUrl} {typeof(TResponse)} {e.Message}");
+ }
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
- m_log.Debug($"[SRestObjReq]: Invalid XML from GET {requestUrl} {typeof(TResponse)}");
+ //m_log.Debug($"[SRestObjReq]: Invalid XML from GET {requestUrl} {typeof(TResponse)}");
}
catch (Exception e)
{
- m_log.Debug($"[SRestObjReq]: Exception on response from GET {requestUrl}: {e.Message}");
+ //m_log.Debug($"[SRestObjReq]: Exception on response from GET {requestUrl}: {e.Message}");
}
finally
{
@@ -1624,14 +1628,14 @@ public static TResponse LogAndDeserialize(int reqnum, Stream respStre
public static class XMLRPCRequester
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public static Hashtable SendRequest(Hashtable ReqParams, string method, string url)
{
int reqnum = WebUtil.RequestNumber++;
if (WebUtil.DebugLevel >= 3)
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} XML-RPC '{method}' to {url}");
+ {
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} XML-RPC '{method}' to {url}");
+ }
int tickstart = Util.EnvironmentTickCount();
string responseStr = null;
@@ -1666,13 +1670,12 @@ public static Hashtable SendRequest(Hashtable ReqParams, string method, string u
}
catch (Exception e)
{
- m_log.Error($"[LOGHTTP]: Error parsing XML-RPC response: {e.Message}");
+ //m_log.Error($"[LOGHTTP]: Error parsing XML-RPC response: {e.Message}");
}
if (Resp.IsFault)
{
- m_log.Debug(
- $"[LOGHTTP]: XML-RPC request {reqnum} '{method}' to {url} FAILED: FaultCode={Resp.FaultCode}, {Resp.FaultString}");
+ //m_log.Debug($"[LOGHTTP]: XML-RPC request {reqnum} '{method}' to {url} FAILED: FaultCode={Resp.FaultCode}, {Resp.FaultString}");
return null;
}
@@ -1686,16 +1689,16 @@ public static Hashtable SendRequest(Hashtable ReqParams, string method, string u
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > WebUtil.LongCallTime)
{
- m_log.InfoFormat(
- "[LOGHTTP]: Slow XML-RPC request {0} '{1}' to {2} took {3}ms, {4}",
- reqnum, method, url, tickdiff,
- responseStr != null
- ? (responseStr.Length > WebUtil.MaxRequestDiagLength ? responseStr.Remove(WebUtil.MaxRequestDiagLength) : responseStr)
- : "");
+ //m_log.InfoFormat(
+ // "[LOGHTTP]: Slow XML-RPC request {0} '{1}' to {2} took {3}ms, {4}",
+ // reqnum, method, url, tickdiff,
+ // responseStr != null
+ // ? (responseStr.Length > WebUtil.MaxRequestDiagLength ? responseStr.Remove(WebUtil.MaxRequestDiagLength) : responseStr)
+ // : "");
}
else if (WebUtil.DebugLevel >= 4)
{
- m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {tickdiff}ms");
+ //m_log.Debug($"[LOGHTTP]: HTTP OUT {reqnum} took {tickdiff}ms");
}
}
}
diff --git a/Source/OpenSim.Region.ClientStack.LindenUDP/OpenSim.Region.ClientStack.LindenUDP.csproj b/Source/OpenSim.Region.ClientStack.LindenUDP/OpenSim.Region.ClientStack.LindenUDP.csproj
index e1b5e4e1626..8ef6d685cd9 100644
--- a/Source/OpenSim.Region.ClientStack.LindenUDP/OpenSim.Region.ClientStack.LindenUDP.csproj
+++ b/Source/OpenSim.Region.ClientStack.LindenUDP/OpenSim.Region.ClientStack.LindenUDP.csproj
@@ -39,8 +39,6 @@
-
-
diff --git a/Source/OpenSim.Region.CoreModules/OpenSim.Region.CoreModules.csproj b/Source/OpenSim.Region.CoreModules/OpenSim.Region.CoreModules.csproj
index 4467d2edbcf..bad98e54123 100644
--- a/Source/OpenSim.Region.CoreModules/OpenSim.Region.CoreModules.csproj
+++ b/Source/OpenSim.Region.CoreModules/OpenSim.Region.CoreModules.csproj
@@ -55,10 +55,10 @@
-
-
-
+
+
+
-
+
diff --git a/Source/OpenSim.Region.Framework/Interfaces/IOpenSimBase.cs b/Source/OpenSim.Region.Framework/Interfaces/IOpenSimBase.cs
index 6c029f5dd5f..d53b8a0662d 100644
--- a/Source/OpenSim.Region.Framework/Interfaces/IOpenSimBase.cs
+++ b/Source/OpenSim.Region.Framework/Interfaces/IOpenSimBase.cs
@@ -25,7 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using Nini.Config;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
diff --git a/Source/OpenSim.Region.Framework/Interfaces/IWindModelPlugin.cs b/Source/OpenSim.Region.Framework/Interfaces/IWindModelPlugin.cs
index 441d7ea729b..962dfd837bd 100644
--- a/Source/OpenSim.Region.Framework/Interfaces/IWindModelPlugin.cs
+++ b/Source/OpenSim.Region.Framework/Interfaces/IWindModelPlugin.cs
@@ -25,14 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-
-using Nini.Config;
using OpenSim.Framework;
using OpenMetaverse;
using OpenSim.Region.Framework.Scenes;
+using Microsoft.Extensions.Configuration;
+
namespace OpenSim.Region.Framework.Interfaces
{
public interface IWindModelPlugin : IPlugin
@@ -45,7 +43,7 @@ public interface IWindModelPlugin : IPlugin
///
/// Provides access to the wind configuration, if any.
///
- void WindConfig(Scene scene, IConfig windConfig);
+ void WindConfig(Scene scene, IConfigurationSection windConfig);
///
/// Update wind.
diff --git a/Source/OpenSim.Region.Framework/OpenSim.Region.Framework.csproj b/Source/OpenSim.Region.Framework/OpenSim.Region.Framework.csproj
index 29a90a1ecfa..c0fffad514d 100644
--- a/Source/OpenSim.Region.Framework/OpenSim.Region.Framework.csproj
+++ b/Source/OpenSim.Region.Framework/OpenSim.Region.Framework.csproj
@@ -41,9 +41,7 @@
-
-
-
-
+
+
\ No newline at end of file
diff --git a/Source/OpenSim.Region.Framework/Scenes/Animation/AnimationSet.cs b/Source/OpenSim.Region.Framework/Scenes/Animation/AnimationSet.cs
index 268c926b5cd..2f2579c5102 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Animation/AnimationSet.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Animation/AnimationSet.cs
@@ -25,25 +25,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
using System.Text;
-using log4net;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
-using OpenSim.Framework;
-
-using Animation = OpenSim.Framework.Animation;
-
namespace OpenSim.Region.Framework.Scenes.Animation
{
[Serializable]
public class AnimationSet
{
- //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private OpenSim.Framework.Animation m_implicitDefaultAnimation = new OpenSim.Framework.Animation();
private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation();
private readonly List m_animations = new List();
diff --git a/Source/OpenSim.Region.Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/Source/OpenSim.Region.Framework/Scenes/Animation/DefaultAvatarAnimations.cs
index 89ebd00fa03..fd4c91729a7 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Animation/DefaultAvatarAnimations.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Animation/DefaultAvatarAnimations.cs
@@ -25,18 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System.Collections.Generic;
-using System.Reflection;
using System.Xml;
-using log4net;
+
using OpenMetaverse;
namespace OpenSim.Region.Framework.Scenes.Animation
{
public class DefaultAvatarAnimations
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public static readonly string DefaultAnimationsPath = "data/avataranimations.xml";
public static Dictionary AnimsUUIDbyName = new Dictionary();
diff --git a/Source/OpenSim.Region.Framework/Scenes/Animation/MovementAnimationOverrides.cs b/Source/OpenSim.Region.Framework/Scenes/Animation/MovementAnimationOverrides.cs
index d3dae7163f1..1e1d4111881 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Animation/MovementAnimationOverrides.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Animation/MovementAnimationOverrides.cs
@@ -25,34 +25,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Xml;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Threading;
-using System.Timers;
-using Timer = System.Timers.Timer;
+using Microsoft.Extensions.Logging;
using OpenMetaverse;
-using log4net;
-using Nini.Config;
-using OpenSim.Framework;
-using OpenSim.Framework.Client;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes.Animation;
-using OpenSim.Region.Framework.Scenes.Types;
-using OpenSim.Region.PhysicsModule.SharedBase;
-using GridRegion = OpenSim.Services.Interfaces.GridRegion;
-using OpenSim.Services.Interfaces;
namespace OpenSim.Region.Framework.Scenes
{
public class MovementAnimationOverrides
{
- private static readonly ILog m_log =
- LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private object MAOLock = new object();
private Dictionary m_overrides = new Dictionary();
+
+ private readonly ILogger _logger;
+
+ public MovementAnimationOverrides(ILogger logger)
+ {
+ _logger = logger;
+ }
+
public void SetOverride(string state, UUID animID)
{
if (animID.IsZero())
@@ -64,7 +53,7 @@ public void SetOverride(string state, UUID animID)
return;
}
- m_log.DebugFormat("Setting override for {0} to {1}", state, animID);
+ _logger.LogDebug($"Setting override for {state} to {animID}", state, animID);
lock (MAOLock)
m_overrides[state] = animID;
diff --git a/Source/OpenSim.Region.Framework/Scenes/Animation/ScenePresenceAnimator.cs b/Source/OpenSim.Region.Framework/Scenes/Animation/ScenePresenceAnimator.cs
index f6eef682b40..72cd76143ca 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -25,16 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Threading;
-using log4net;
+using Microsoft.Extensions.Logging;
+
using OpenMetaverse;
+
using OpenSim.Framework;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.PhysicsModule.SharedBase;
namespace OpenSim.Region.Framework.Scenes.Animation
@@ -44,23 +39,31 @@ namespace OpenSim.Region.Framework.Scenes.Animation
///
public class ScenePresenceAnimator
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly ILogger _logger;
+
+ private float m_lastFallVelocity;
+
+ private int m_animTickFall;
+ private int m_animTickLand;
+ private int m_animTickJump;
+
+ protected AnimationSet m_animations = new AnimationSet();
+
+ ///
+ /// The scene presence that this animator applies to
+ ///
+ protected ScenePresence m_scenePresence;
public AnimationSet Animations
{
get { return m_animations; }
}
- protected AnimationSet m_animations = new AnimationSet();
///
/// The current movement animation
///
public string CurrentMovementAnimation { get; private set; }
- private int m_animTickFall;
- private int m_animTickLand;
- private int m_animTickJump;
-
public bool isJumping;
// private int m_landing = 0;
@@ -70,15 +73,10 @@ public AnimationSet Animations
///
public bool Falling { get; private set; }
- private float m_lastFallVelocity;
-
- ///
- /// The scene presence that this animator applies to
- ///
- protected ScenePresence m_scenePresence;
-
- public ScenePresenceAnimator(ScenePresence sp)
+ public ScenePresenceAnimator(ILogger logger, ScenePresence sp)
{
+ _logger = logger;
+
m_scenePresence = sp;
CurrentMovementAnimation = "STAND";
}
@@ -88,11 +86,10 @@ public void AddAnimation(UUID animID, UUID objectID)
if (m_scenePresence.IsChildAgent)
return;
- // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
if (m_scenePresence.Scene.DebugAnimations)
- m_log.DebugFormat(
- "[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}",
- GetAnimName(animID), animID, m_scenePresence.Name);
+ {
+ _logger.LogDebug($"[SCENE PRESENCE ANIMATOR]: Adding animation {GetAnimName(animID)} {animID} for {m_scenePresence.Name}");
+ }
if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
{
@@ -130,9 +127,9 @@ public void RemoveAnimation(UUID animID, bool allowNoDefault)
return;
if (m_scenePresence.Scene.DebugAnimations)
- m_log.DebugFormat(
- "[SCENE PRESENCE ANIMATOR]: Removing animation {0} {1} for {2}",
- GetAnimName(animID), animID, m_scenePresence.Name);
+ {
+ _logger.LogDebug($"[SCENE PRESENCE ANIMATOR]: Removing animation {GetAnimName(animID)} {animID} for {m_scenePresence.Name}");
+ }
if (m_animations.Remove(animID, allowNoDefault))
{
@@ -149,12 +146,19 @@ public void avnChangeAnim(UUID animID, bool addRemove, bool sendPack)
if (!animID.IsZero())
{
if (addRemove)
+ {
m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero);
+ }
else
+ {
m_animations.Remove(animID, false);
+ }
}
+
if (sendPack)
+ {
SendAnimPack();
+ }
}
// Called from scripts
@@ -164,6 +168,7 @@ public void RemoveAnimation(string name)
return;
UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name);
+
if (animID.IsZero())
return;
@@ -173,9 +178,11 @@ public void RemoveAnimation(string name)
public void ResetAnimations()
{
if (m_scenePresence.Scene.DebugAnimations)
- m_log.DebugFormat(
- "[SCENE PRESENCE ANIMATOR]: Resetting animations for {0} in {1}",
- m_scenePresence.Name, m_scenePresence.Scene.RegionInfo.RegionName);
+ {
+ _logger.LogDebug(
+ $"[SCENE PRESENCE ANIMATOR]: Resetting animations for {m_scenePresence.Name} " +
+ $"in {m_scenePresence.Scene.RegionInfo.RegionName}");
+ }
m_animations.Clear();
}
@@ -193,9 +200,8 @@ public bool TrySetMovementAnimation(string anim)
{
if (m_scenePresence.IsChildAgent)
{
- m_log.WarnFormat(
- "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}",
- anim, m_scenePresence.Name);
+ _logger.LogWarning($"[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {anim} on child presence {m_scenePresence.Name}");
+
return false;
}
@@ -214,8 +220,10 @@ public bool TrySetMovementAnimation(string anim)
if (anim.Equals("SITGROUND"))
{
UUID defsit = DefaultAvatarAnimations.AnimsUUIDbyName["SIT_GROUND_CONSTRAINED"];
+
if (defsit.IsZero())
return false;
+
m_animations.SetDefaultAnimation(defsit, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
aoSitGndAnim = overridenAnim;
avnChangeAnim(overridenAnim, true, false);
@@ -224,14 +232,18 @@ public bool TrySetMovementAnimation(string anim)
{
m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID);
}
+
m_scenePresence.SendScriptChangedEventToAttachments(Changed.ANIMATION);
SendAnimPack();
+
return true;
}
// translate sit and sitground state animations
if (anim.Equals("SIT") || anim.Equals("SITGROUND"))
+ {
anim = m_scenePresence.sitAnimation;
+ }
if (m_animations.TrySetDefaultAnimation(anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
{
diff --git a/Source/OpenSim.Region.Framework/Scenes/AsyncInventorySender.cs b/Source/OpenSim.Region.Framework/Scenes/AsyncInventorySender.cs
index 976a205897a..fe48efea7d9 100644
--- a/Source/OpenSim.Region.Framework/Scenes/AsyncInventorySender.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/AsyncInventorySender.cs
@@ -25,15 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Collections.Concurrent;
-//using System.Reflection;
-using System.Threading;
-using log4net;
+
using OpenMetaverse;
using OpenSim.Framework;
-using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.Framework.Scenes
{
diff --git a/Source/OpenSim.Region.Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/Source/OpenSim.Region.Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 46a44986370..74972832a52 100644
--- a/Source/OpenSim.Region.Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -25,12 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Collections.Concurrent;
-//using System.Reflection;
-using System.Threading;
-using log4net;
+
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
diff --git a/Source/OpenSim.Region.Framework/Scenes/CollisionSounds.cs b/Source/OpenSim.Region.Framework/Scenes/CollisionSounds.cs
index 365113f3f56..36f04e434b5 100644
--- a/Source/OpenSim.Region.Framework/Scenes/CollisionSounds.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/CollisionSounds.cs
@@ -26,12 +26,8 @@
*/
// Ubit 2012
-using System;
using System.Reflection;
-using System.Collections.Generic;
using OpenMetaverse;
-using OpenSim.Framework;
-using log4net;
namespace OpenSim.Region.Framework.Scenes
{
@@ -44,8 +40,6 @@ public struct CollisionForSoundInfo
public static class CollisionSounds
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private const int MaxMaterials = 7;
// part part
diff --git a/Source/OpenSim.Region.Framework/Scenes/EntityBase.cs b/Source/OpenSim.Region.Framework/Scenes/EntityBase.cs
index da6ef773029..f157bf8a682 100644
--- a/Source/OpenSim.Region.Framework/Scenes/EntityBase.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/EntityBase.cs
@@ -25,11 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Security.Permissions;
-using log4net;
using OpenSim.Framework;
using OpenMetaverse;
@@ -37,8 +32,6 @@ namespace OpenSim.Region.Framework.Scenes
{
public abstract class EntityBase : ISceneEntity
{
- // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// The scene to which this entity belongs
///
diff --git a/Source/OpenSim.Region.Framework/Scenes/EntityManager.cs b/Source/OpenSim.Region.Framework/Scenes/EntityManager.cs
index f034de898f0..00e005af68e 100644
--- a/Source/OpenSim.Region.Framework/Scenes/EntityManager.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/EntityManager.cs
@@ -25,11 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using log4net;
using OpenMetaverse;
using OpenSim.Framework;
@@ -37,8 +32,6 @@ namespace OpenSim.Region.Framework.Scenes
{
public class EntityManager
{
-// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private readonly DoubleDictionaryThreadAbortSafe m_entities
= new DoubleDictionaryThreadAbortSafe();
diff --git a/Source/OpenSim.Region.Framework/Scenes/EventManager.cs b/Source/OpenSim.Region.Framework/Scenes/EventManager.cs
index cb3eeb3f052..c47adb51e4e 100644
--- a/Source/OpenSim.Region.Framework/Scenes/EventManager.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/EventManager.cs
@@ -25,14 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using log4net;
+using Microsoft.Extensions.Logging;
+
using OpenMetaverse;
+
using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces;
+
using Caps = OpenSim.Framework.Capabilities.Caps;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
@@ -43,7 +43,12 @@ namespace OpenSim.Region.Framework.Scenes
///
public class EventManager
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly ILogger _logger;
+
+ public EventManager(ILogger logger)
+ {
+ _logger = logger;
+ }
///
/// Triggered on each sim frame.
@@ -451,9 +456,7 @@ public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID i
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing.");
}
}
}
@@ -486,9 +489,7 @@ public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId,
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing.");
}
}
}
@@ -1071,9 +1072,7 @@ public void TriggerOnAttach(uint localID, UUID itemID, UUID avatarID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing.");
}
}
}
@@ -1092,9 +1091,7 @@ public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID,
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerGetScriptRunning failed - continuing.");
}
}
}
@@ -1113,9 +1110,7 @@ public void TriggerOnScriptChangedEvent(uint localID, uint change, object parame
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnScriptChangedEvent failed - continuing.");
}
}
}
@@ -1134,9 +1129,7 @@ public void TriggerOnClientMovement(ScenePresence avatar)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnClientMovement failed - continuing.");
}
}
}
@@ -1155,9 +1148,7 @@ public void TriggerPermissionError(UUID user, string reason)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerPermissionError failed - continuing.");
}
}
}
@@ -1176,9 +1167,7 @@ public void TriggerOnPluginConsole(string[] args)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnPluginConsole failed - continuing.");
}
}
}
@@ -1197,9 +1186,7 @@ public void TriggerOnFrame()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnFrame failed - continuing.");
}
}
}
@@ -1218,9 +1205,7 @@ public void TriggerOnNewClient(IClientAPI client)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnNewClient failed - continuing.");
}
}
}
@@ -1239,9 +1224,7 @@ public void TriggerOnNewClient(IClientAPI client)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnNewClient (IClientCore) failed - continuing.");
}
}
}
@@ -1261,9 +1244,7 @@ public void TriggerOnClientLogin(IClientAPI client)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnClientLogin failed - continuing.");
}
}
}
@@ -1283,9 +1264,7 @@ public void TriggerOnNewPresence(ScenePresence presence)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnNewPresence failed - continuing.");
}
}
}
@@ -1300,15 +1279,11 @@ public void TriggerOnRemovePresence(UUID agentId)
{
try
{
-// m_log.ErrorFormat("[EVENT MANAGER]: OnRemovePresenceDelegate: {0}",d.Target.ToString());
d(agentId);
-// m_log.ErrorFormat("[EVENT MANAGER]: OnRemovePresenceDelegate done ");
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnRemovePresence failed - continuing.");
}
}
}
@@ -1327,9 +1302,7 @@ public void TriggerOnBackup(ISimulationDataService dstore, bool forced)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerOnBackup failed - continuing.");
}
}
}
@@ -1348,9 +1321,7 @@ public void TriggerParcelPrimCountUpdate()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerParcelPrimCountUpdate failed - continuing.");
}
}
}
@@ -1369,9 +1340,7 @@ public void TriggerMoneyTransfer(Object sender, MoneyTransferArgs args)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerMoneyTransfer failed - continuing.");
}
}
}
@@ -1389,9 +1358,7 @@ public void TriggerTerrainUpdate()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing.");
}
}
}
@@ -1410,9 +1377,7 @@ public void TriggerTerrainTick()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerTerrainTick failed - continuing.");
}
}
}
@@ -1431,9 +1396,7 @@ public void TriggerTerrainCheckUpdates()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TerrainCheckUpdates failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TerrainCheckUpdates failed - continuing.");
}
}
}
@@ -1452,9 +1415,7 @@ public void TriggerTerrainTainted()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerTerrainTainted failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerTerrainTainted failed - continuing.");
}
}
}
@@ -1473,9 +1434,7 @@ public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerParcelPrimCountAdd failed - continuing.");
}
}
}
@@ -1494,9 +1453,8 @@ public void TriggerObjectAddedToScene(SceneObjectGroup obj)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing."
+);
}
}
}
@@ -1517,9 +1475,7 @@ public bool TriggerDeRezRequested(IClientAPI client, List objs
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerDeRezRequested failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerDeRezRequested failed - continuing.");
}
}
}
@@ -1540,9 +1496,7 @@ public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectBeingRemovedFromScene failed - continuing.");
}
}
}
@@ -1561,9 +1515,7 @@ public void TriggerObjectAddedToPhysicalScene(SceneObjectPart obj)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing.");
}
}
}
@@ -1582,9 +1534,7 @@ public void TriggerObjectRemovedFromPhysicalScene(SceneObjectPart obj)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing.");
}
}
}
@@ -1603,9 +1553,7 @@ public void TriggerShutdown()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerShutdown failed - continuing.");
}
}
}
@@ -1624,9 +1572,7 @@ public void TriggerObjectGrab(uint localID, uint originalID, Vector3 offsetPos,
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing.");
}
}
}
@@ -1645,9 +1591,7 @@ public void TriggerObjectGrabbing(uint localID, uint originalID, Vector3 offsetP
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing.");
}
}
}
@@ -1666,9 +1610,7 @@ public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remote
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing.");
}
}
}
@@ -1687,9 +1629,7 @@ public void TriggerScriptReset(uint localID, UUID itemID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptReset failed - continuing.");
}
}
}
@@ -1708,9 +1648,7 @@ public void TriggerRezScript(uint localID, UUID itemID, string script, int start
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerRezScript failed - continuing.");
}
}
}
@@ -1729,9 +1667,7 @@ public void TriggerStartScript(uint localID, UUID itemID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerStartScript failed - continuing.");
}
}
}
@@ -1750,9 +1686,7 @@ public void TriggerStopScript(uint localID, UUID itemID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerStopScript failed - continuing.");
}
}
}
@@ -1771,10 +1705,7 @@ public void TriggerRemoveScript(uint localID, UUID itemID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
- m_log.ErrorFormat(Environment.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing.");
}
}
}
@@ -1796,9 +1727,7 @@ public bool TriggerGroupMove(UUID groupID, Vector3 delta)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerGroupMove failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerGroupMove failed - continuing.");
}
}
}
@@ -1822,9 +1751,7 @@ public bool TriggerGroupSpinStart(UUID groupID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerGroupSpinStart failed - continuing.");
}
}
}
@@ -1848,9 +1775,7 @@ public bool TriggerGroupSpin(UUID groupID, Quaternion rotation)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerGroupSpin failed - continuing.");
}
}
}
@@ -1871,9 +1796,7 @@ public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerGroupGrab failed - continuing.");
}
}
}
@@ -1892,9 +1815,7 @@ public void TriggerLandObjectAdded(ILandObject newParcel)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerLandObjectAdded failed - continuing.");
}
}
}
@@ -1913,9 +1834,7 @@ public void TriggerLandObjectRemoved(UUID globalID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerLandObjectRemoved failed - continuing.");
}
}
}
@@ -1939,9 +1858,7 @@ public void TriggerAvatarEnteringNewParcel(ScenePresence avatar, int localLandID
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerAvatarEnteringNewParcel failed - continuing.");
}
}
}
@@ -1960,9 +1877,7 @@ public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing.");
}
}
}
@@ -1981,9 +1896,7 @@ public void TriggerCrossAgentToNewRegion(ScenePresence agent, bool isFlying, Gri
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerCrossAgentToNewRegion failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerCrossAgentToNewRegion failed - continuing.");
}
}
}
@@ -2002,9 +1915,7 @@ public void TriggerIncomingInstantMessage(GridInstantMessage message)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerIncomingInstantMessage failed - continuing.");
}
}
}
@@ -2023,9 +1934,7 @@ public void TriggerUnhandledInstantMessage(GridInstantMessage message)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing.");
}
}
}
@@ -2040,16 +1949,11 @@ public void TriggerClientClosed(UUID ClientID, Scene scene)
{
try
{
-// m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed: {0}", d.Target.ToString());
d(ClientID, scene);
-// m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed done ");
-
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerClientClosed failed - continuing.");
}
}
}
@@ -2068,9 +1972,7 @@ public void TriggerOnMakeChildAgent(ScenePresence presence)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnMakeChildAgent failed - continuing.");
}
}
}
@@ -2089,9 +1991,7 @@ public void TriggerOnMakeRootAgent(ScenePresence presence)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnMakeRootAgent failed - continuing.");
}
}
}
@@ -2110,9 +2010,7 @@ public void TriggerOnIncomingSceneObject(SceneObjectGroup so)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnIncomingSceneObject failed - continuing.");
}
}
}
@@ -2131,9 +2029,7 @@ public void TriggerOnRegisterCaps(UUID agentID, Caps caps)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnRegisterCaps failed - continuing.");
}
}
}
@@ -2152,9 +2048,7 @@ public void TriggerOnDeregisterCaps(UUID agentID, Caps caps)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnDeregisterCaps failed - continuing.");
}
}
}
@@ -2173,9 +2067,7 @@ public void TriggerOnNewInventoryItemUploadComplete(InventoryItemBase item, int
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnNewInventoryItemUploadComplete failed - continuing.");
}
}
}
@@ -2194,9 +2086,7 @@ public void TriggerLandBuy(Object sender, LandBuyArgs args)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerLandBuy failed - continuing.");
}
}
}
@@ -2215,9 +2105,7 @@ public void TriggerValidateLandBuy(Object sender, LandBuyArgs args)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerValidateLandBuy failed - continuing.");
}
}
}
@@ -2236,9 +2124,7 @@ public void TriggerAtTargetEvent(UUID scriptID, uint handle, Vector3 targetpos,
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerAtTargetEvent failed - continuing.");
}
}
}
@@ -2257,9 +2143,7 @@ public void TriggerNotAtTargetEvent(UUID scriptID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerNotAtTargetEvent failed - continuing.");
}
}
}
@@ -2278,9 +2162,7 @@ public void TriggerAtRotTargetEvent(UUID scriptID, uint handle, Quaternion targe
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerAtRotTargetEvent failed - continuing.");
}
}
}
@@ -2299,9 +2181,7 @@ public void TriggerNotAtRotTargetEvent(UUID scriptID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerNotAtRotTargetEvent failed - continuing.");
}
}
}
@@ -2320,9 +2200,7 @@ public void TriggerMovingStartEvent(uint localID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerMovingStartEvent failed - continuing.");
}
}
}
@@ -2341,9 +2219,7 @@ public void TriggerMovingEndEvent(uint localID)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerMovingEndEvent failed - continuing.");
}
}
}
@@ -2368,9 +2244,7 @@ public void TriggerRequestChangeWaterHeight(float height)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerRequestChangeWaterHeight failed - continuing.");
}
}
}
@@ -2389,9 +2263,7 @@ public void TriggerAvatarKill(uint KillerObjectLocalID, ScenePresence DeadAvatar
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerAvatarKill failed - continuing.");
}
}
}
@@ -2410,9 +2282,7 @@ public void TriggerSignificantClientMovement(ScenePresence presence)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerSignificantClientMovement failed - continuing.");
}
}
}
@@ -2431,9 +2301,7 @@ public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnChatFromWorld failed - continuing.");
}
}
}
@@ -2452,9 +2320,7 @@ public void TriggerOnChatFromClient(Object sender, OSChatMessage chat)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnChatFromClient failed - continuing.");
}
}
}
@@ -2473,9 +2339,7 @@ public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnChatBroadcast failed - continuing.");
}
}
}
@@ -2494,9 +2358,7 @@ internal void TriggerControlEvent(UUID scriptUUID, UUID avatarID, uint held, uin
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerControlEvent failed - continuing.");
}
}
}
@@ -2515,9 +2377,7 @@ public void TriggerNoticeNoLandDataFromStorage()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerNoticeNoLandDataFromStorage failed - continuing.");
}
}
}
@@ -2536,9 +2396,7 @@ public void TriggerIncomingLandDataFromStorage(List landData)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerIncomingLandDataFromStorage failed - continuing.");
}
}
}
@@ -2557,9 +2415,7 @@ public void TriggerSetAllowForcefulBan(bool allow)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerSetAllowForcefulBan failed - continuing.");
}
}
}
@@ -2578,9 +2434,7 @@ public void TriggerRequestParcelPrimCountUpdate()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerRequestParcelPrimCountUpdate failed - continuing.");
}
}
}
@@ -2599,9 +2453,7 @@ public void TriggerParcelPrimCountTainted()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerParcelPrimCountTainted failed - continuing.");
}
}
}
@@ -2639,9 +2491,7 @@ public void TriggerEstateToolsSunUpdate(ulong regionHandle)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerEstateToolsSunUpdate failed - continuing.");
}
}
}
@@ -2660,9 +2510,7 @@ public float GetCurrentTimeAsSunLindenHour()
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnAttach failed - continuing.");
}
}
}
@@ -2683,9 +2531,7 @@ public void TriggerOarFileLoaded(Guid requestId, List loadedScenes, string
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOarFileLoaded failed - continuing.");
}
}
}
@@ -2704,9 +2550,7 @@ public void TriggerOarFileSaved(Guid requestId, string message)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOarFileSaved failed - continuing.");
}
}
}
@@ -2725,9 +2569,7 @@ public void TriggerEmptyScriptCompileQueue(int numScriptsFailed, string message)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerEmptyScriptCompileQueue failed - continuing.");
}
}
}
@@ -2746,9 +2588,7 @@ public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptCollidingStart failed - continuing.");
}
}
}
@@ -2767,9 +2607,7 @@ public void TriggerScriptColliding(uint localId, ColliderArgs colliders)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptColliding failed - continuing.");
}
}
}
@@ -2788,9 +2626,7 @@ public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptCollidingEnd failed - continuing.");
}
}
}
@@ -2809,9 +2645,7 @@ public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingStart failed - continuing.");
}
}
}
@@ -2830,9 +2664,7 @@ public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptLandColliding failed - continuing.");
}
}
}
@@ -2851,9 +2683,7 @@ public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScriptLandCollidingEnd failed - continuing.");
}
}
}
@@ -2872,9 +2702,7 @@ public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerSetRootAgentScene failed - continuing.");
}
}
}
@@ -2893,9 +2721,7 @@ public void TriggerOnRegionUp(GridRegion otherRegion)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnRegionUp failed - continuing.");
}
}
}
@@ -2914,9 +2740,7 @@ public void TriggerOnSceneObjectLoaded(SceneObjectGroup so)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing.");
}
}
}
@@ -2935,9 +2759,7 @@ public void TriggerOnSceneObjectPreSave(SceneObjectGroup persistingSo, SceneObje
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing.");
}
}
}
@@ -2956,9 +2778,7 @@ public void TriggerOnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart o
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing.");
}
}
}
@@ -2977,9 +2797,7 @@ public void TriggerSceneObjectPartUpdated(SceneObjectPart sop, bool full)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing.");
}
}
}
@@ -2998,9 +2816,7 @@ public void TriggerScenePresenceUpdated(ScenePresence sp)
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerScenePresenceUpdated failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerScenePresenceUpdated failed - continuing.");
}
}
}
@@ -3020,9 +2836,7 @@ public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args,
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing.");
}
}
}
@@ -3035,20 +2849,16 @@ public void TriggerSceneShuttingDown(Scene s)
{
foreach (Action d in handler.GetInvocationList())
{
- m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoke {0}", d.Method.Name.ToString());
try
{
d(s);
}
catch (Exception e)
{
- m_log.ErrorFormat(
- "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}",
- e.Message, e.StackTrace);
+ _logger.LogError($"[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing.");
}
}
}
- m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done");
}
public void TriggerOnRegionStarted(Scene scene)
@@ -3065,8 +2875,7 @@ public void TriggerOnRegionStarted(Scene scene)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for RegionStarted failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for RegionStarted failed - continuing.");
}
}
}
@@ -3086,8 +2895,7 @@ public void TriggerRegionHeartbeatStart(Scene scene)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatStart failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for OnRegionHeartbeatStart failed - continuing.");
}
}
}
@@ -3107,8 +2915,7 @@ public void TriggerRegionHeartbeatEnd(Scene scene)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatEnd failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for OnRegionHeartbeatEnd failed - continuing.");
}
}
}
@@ -3128,8 +2935,7 @@ public void TriggerRegionLoginsStatusChange(IScene scene)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionLoginsStatusChange failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for OnRegionLoginsStatusChange failed - continuing.");
}
}
}
@@ -3149,8 +2955,7 @@ public void TriggerRegionReadyStatusChange(IScene scene)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionReadyStatusChange failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for OnRegionReadyStatusChange failed - continuing.");
}
}
}
@@ -3170,8 +2975,7 @@ public void TriggerPrimsLoaded(Scene s)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for PrimsLoaded failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for PrimsLoaded failed - continuing.");
}
}
}
@@ -3191,8 +2995,7 @@ public void TriggerTeleportStart(IClientAPI client, GridRegion destination, Grid
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TeleportStart failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TeleportStart failed - continuing.");
}
}
}
@@ -3212,8 +3015,7 @@ public void TriggerTeleportFail(IClientAPI client, bool gridLogout)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TeleportFail failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TeleportFail failed - continuing.");
}
}
}
@@ -3235,8 +3037,7 @@ public void TriggerExtraSettingChanged(Scene scene, string name, string val)
}
catch (Exception e)
{
- m_log.ErrorFormat("[EVENT MANAGER]: Delegate for ExtraSettingChanged failed - continuing {0} - {1}",
- e.Message, e.StackTrace);
+ _logger.LogError(e, $"[EVENT MANAGER]: Delegate for ExtraSettingChanged failed - continuing.");
}
}
}
@@ -3261,8 +3062,8 @@ public void TriggerThrottleUpdate(ScenePresence scenePresence)
// }
// catch (Exception e)
// {
- // m_log.ErrorFormat("[EVENT MANAGER]: Delegate for TriggerUuidGather failed - continuing {0} - {1}",
- // e.Message, e.StackTrace);
+ // _logger.LogError(e, $"[EVENT MANAGER]: Delegate for TriggerUuidGather failed - continuing {0} - {1}",
+ //);
// }
// }
// }
diff --git a/Source/OpenSim.Region.Framework/Scenes/GodController.cs b/Source/OpenSim.Region.Framework/Scenes/GodController.cs
index 10b2756b7c1..4e7bcb097c8 100644
--- a/Source/OpenSim.Region.Framework/Scenes/GodController.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/GodController.cs
@@ -25,23 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-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 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;
+
using Microsoft.Extensions.Configuration;
namespace OpenSim.Region.Framework.Scenes
diff --git a/Source/OpenSim.Region.Framework/Scenes/KeyframeMotion.cs b/Source/OpenSim.Region.Framework/Scenes/KeyframeMotion.cs
index 42a640ba826..3234719b2c6 100644
--- a/Source/OpenSim.Region.Framework/Scenes/KeyframeMotion.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/KeyframeMotion.cs
@@ -25,35 +25,25 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Timers;
-using System.Collections;
-using System.Collections.Generic;
-using System.IO;
-using System.Diagnostics;
-using System.Reflection;
-using System.Threading;
using OpenMetaverse;
using OpenSim.Framework;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.PhysicsModule.SharedBase;
-using OpenSim.Region.Framework.Scenes.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
-using System.Runtime.Serialization;
+
using Timer = System.Timers.Timer;
-using log4net;
namespace OpenSim.Region.Framework.Scenes
{
public class KeyframeTimer
{
- private static Dictionary m_timers =
- new Dictionary();
+ private static Dictionary m_timers = new();
private Timer m_timer;
- private Dictionary m_motions = new Dictionary();
+ private Dictionary m_motions = new();
+
private object m_lockObject = new object();
private object m_timerLock = new object();
+
private const double m_tickDuration = 50.0;
public double TickDuration
diff --git a/Source/OpenSim.Region.Framework/Scenes/Prioritizer.cs b/Source/OpenSim.Region.Framework/Scenes/Prioritizer.cs
index a8f0a95fad8..6ba46e00492 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Prioritizer.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Prioritizer.cs
@@ -25,10 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using log4net;
-using Nini.Config;
using OpenSim.Framework;
using OpenMetaverse;
using OpenSim.Region.PhysicsModule.SharedBase;
@@ -43,8 +39,6 @@ public enum UpdatePrioritizationSchemes
public class Prioritizer
{
- private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
private Scene m_scene;
public Prioritizer(Scene scene)
@@ -60,7 +54,6 @@ public int GetUpdatePriority(IClientAPI client, ISceneEntity entity)
// If entity is null we have a serious problem
if (entity == null)
{
- m_log.WarnFormat("[PRIORITIZER] attempt to prioritize null entity");
throw new InvalidOperationException("Prioritization entity not defined");
}
diff --git a/Source/OpenSim.Region.Framework/Scenes/RegionStatsHandler.cs b/Source/OpenSim.Region.Framework/Scenes/RegionStatsHandler.cs
index ca0e2e78699..7435aaba4ef 100644
--- a/Source/OpenSim.Region.Framework/Scenes/RegionStatsHandler.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/RegionStatsHandler.cs
@@ -25,30 +25,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
using System.Net;
-using System.Reflection;
-using System.Text;
-using log4net;
-using Nini.Config;
-using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
-using OpenSim.Framework.Console;
-using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
-using OpenSim.Framework.Monitoring;
-using OpenSim.Region.Framework;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Scenes
{
public class RegionStatsSimpleHandler : SimpleStreamHandler
{
- //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private string osXStatsURI = String.Empty;
//private string osSecret = String.Empty;
private OpenSim.Framework.RegionInfo regionInfo;
diff --git a/Source/OpenSim.Region.Framework/Scenes/Scene.Inventory.cs b/Source/OpenSim.Region.Framework/Scenes/Scene.Inventory.cs
index 1abf0167d39..80291ae4e16 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Scene.Inventory.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Scene.Inventory.cs
@@ -25,25 +25,24 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Collections;
using System.Reflection;
using System.Text;
using System.Xml;
using OpenMetaverse;
-using log4net;
using OpenSim.Framework;
using OpenSim.Framework.Serialization.External;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Serialization;
using PermissionMask = OpenSim.Framework.PermissionMask;
+using Microsoft.Extensions.Logging;
+
+
namespace OpenSim.Region.Framework.Scenes
{
public partial class Scene
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//private static readonly string LogHeader = "[SCENE INVENTORY]";
///
@@ -65,7 +64,7 @@ public partial class Scene
///
public int CreateScriptInstances()
{
- m_log.InfoFormat("[SCENE]: Initializing script instances in {0}", RegionInfo.RegionName);
+ Logger?.LogInformation($"[SCENE]: Initializing script instances in {RegionInfo.RegionName}");
int scriptsValidForStarting = 0;
@@ -79,9 +78,7 @@ public int CreateScriptInstances()
}
}
- m_log.InfoFormat(
- "[SCENE]: Initialized {0} script instances in {1}",
- scriptsValidForStarting, RegionInfo.RegionName);
+ Logger?.LogInformation($"[SCENE]: Initialized {scriptsValidForStarting} script instances in {RegionInfo.RegionName}");
return scriptsValidForStarting;
}
@@ -110,12 +107,12 @@ public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item, uint
public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item)
{
if (AddInventoryItem(item))
+ {
return true;
+ }
else
{
- m_log.WarnFormat(
- "[AGENT INVENTORY]: Unable to add item {1} to agent {2} inventory", item.Name, AgentId);
-
+ Logger?.LogWarning($"[AGENT INVENTORY]: Unable to add item {item.Name} to agent {AgentId} inventory");
return false;
}
}
@@ -135,36 +132,38 @@ public bool AddInventoryItem(InventoryItemBase item, bool trigger)
{
int userlevel = Permissions.IsGod(item.Owner) ? 1 : 0;
if (trigger)
+ {
EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel);
+ }
return true;
}
// OK so either the viewer didn't send a folderID or AddItem failed
UUID originalFolder = item.Folder;
- InventoryFolderBase f = null;
+ InventoryFolderBase? f = null;
if (Enum.IsDefined(typeof(FolderType), (sbyte)item.AssetType))
+ {
f = InventoryService.GetFolderForType(item.Owner, (FolderType)item.AssetType);
+ }
+
if (f is not null)
{
- m_log.DebugFormat(
- "[AGENT INVENTORY]: Found folder {0} type {1} for item {2}",
- f.Name, (AssetType)f.Type, item.Name);
+ Logger?.LogDebug($"[AGENT INVENTORY]: Found folder {f.Name} type {(AssetType)f.Type} for item {item.Name}");
item.Folder = f.ID;
}
else
{
f = InventoryService.GetRootFolder(item.Owner);
+
if (f is not null)
{
item.Folder = f.ID;
}
else
{
- m_log.WarnFormat(
- "[AGENT INVENTORY]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified",
- item.Owner, item.Name);
+ Logger?.LogWarning($"[AGENT INVENTORY]: Could not find root folder for {item.Owner} when trying to add item {item.Name} with no parent folder specified");
return false;
}
}
@@ -173,7 +172,9 @@ public bool AddInventoryItem(InventoryItemBase item, bool trigger)
{
int userlevel = Permissions.IsGod(item.Owner) ? 1 : 0;
if (trigger)
+ {
EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel);
+ }
if (originalFolder.IsNotZero())
{
@@ -185,9 +186,7 @@ public bool AddInventoryItem(InventoryItemBase item, bool trigger)
}
else
{
- m_log.WarnFormat(
- "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}",
- item.Owner, item.Name, item.ID);
+ Logger?.LogWarning($"[AGENT INVENTORY]: Agent {item.Owner} could not add item {item.Name} {item.ID}");
return false;
}
@@ -243,7 +242,7 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
{
if (!TryGetScenePresence(avatarId, out ScenePresence avatar))
{
- m_log.ErrorFormat("[CapsUpdateItemAsset]: Avatar {0} cannot be found to update item asset", avatarId);
+ Logger?.LogError($"[CapsUpdateItemAsset]: Avatar {avatarId} cannot be found to update item asset");
return UUID.Zero;
}
@@ -254,23 +253,28 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
}
SceneObjectPart sop = GetSceneObjectPart(objectID);
+
if(sop is null || sop.ParentGroup.IsDeleted)
{
- m_log.ErrorFormat("[CapsUpdateItemAsset]: Object {0} cannot be found to update item asset", objectID);
+ Logger?.LogError($"[CapsUpdateItemAsset]: Object {objectID} cannot be found to update item asset");
return UUID.Zero;
}
TaskInventoryItem item = sop.Inventory.GetInventoryItem(itemID);
+
if (item is null)
{
- m_log.ErrorFormat("[CapsUpdateItemAsset]: Could not find item {0} for asset update", itemID);
+ Logger?.LogError($"[CapsUpdateItemAsset]: Could not find item {itemID} for asset update");
return UUID.Zero;
}
if (item.OwnerID.NotEqual(avatarId))
+ {
return UUID.Zero;
+ }
InventoryType itemType = (InventoryType)item.InvType;
+
switch (itemType)
{
case InventoryType.Notecard:
@@ -284,6 +288,7 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
avatar.ControllingClient.SendAlertMessage("Notecard updated");
break;
}
+
case (InventoryType)CustomInventoryType.AnimationSet:
{
AnimationSet animSet = new(data);
@@ -302,6 +307,7 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
}
break;
}
+
case InventoryType.Gesture:
{
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
@@ -313,6 +319,7 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
avatar.ControllingClient.SendAlertMessage("Gesture updated");
break;
}
+
case InventoryType.Settings:
{
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
@@ -324,6 +331,7 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
avatar.ControllingClient.SendAlertMessage("Setting updated");
break;
}
+
case InventoryType.Material:
{
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
@@ -353,8 +361,7 @@ public UUID CapsUpdateItemAsset(UUID avatarId, UUID itemID, UUID objectID, byte[
/// The prim which contains the item to update
/// Indicates whether the script to update is currently running
///
- public ArrayList CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId,
- UUID primId, bool isScriptRunning, byte[] data)
+ public ArrayList CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUID itemId, UUID primId, bool isScriptRunning, byte[] data)
{
if (!Permissions.CanEditScript(itemId, primId, remoteClient.AgentId))
{
@@ -365,7 +372,9 @@ public ArrayList CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUI
// Retrieve group
SceneObjectPart part = GetSceneObjectPart(primId);
if (part is null)
+ {
return new ArrayList();
+ }
SceneObjectGroup group = part.ParentGroup;
@@ -373,10 +382,9 @@ public ArrayList CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUI
TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
if (item is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update "
- + " but the item does not exist in this inventory",
- itemId, part.Name, part.UUID);
+ Logger?.LogError(
+ $"[PRIM INVENTORY]: Tried to retrieve item ID {itemId} from prim {part.Name}, {part.UUID} " +
+ $"for caps script update but the item does not exist in this inventory");
return new ArrayList();
}
@@ -385,10 +393,6 @@ public ArrayList CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, UUI
AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data, remoteClient.AgentId);
AssetService.Store(asset);
- //m_log.DebugFormat(
- // "[PRIM INVENTORY]: Stored asset {0} when updating item {1} in prim {2} for {3}",
- // asset.ID, item.Name, part.Name, remoteClient.Name);
-
part.Inventory.RemoveScriptInstance(item.ItemID, false);
// Update item with new asset
@@ -417,12 +421,11 @@ public ArrayList CapsUpdateTaskInventoryScriptAsset(UUID avatarId, UUID itemId,
{
if (TryGetScenePresence(avatarId, out ScenePresence avatar))
{
- return CapsUpdateTaskInventoryScriptAsset(
- avatar.ControllingClient, itemId, primId, isScriptRunning, data);
+ return CapsUpdateTaskInventoryScriptAsset(avatar.ControllingClient, itemId, primId, isScriptRunning, data);
}
else
{
- m_log.ErrorFormat("[PRIM INVENTORY]: Avatar {0} cannot be found to update its prim item asset", avatarId);
+ Logger?.LogError($"[PRIM INVENTORY]: Avatar {avatarId} cannot be found to update its prim item asset");
return new ArrayList();
}
}
@@ -441,13 +444,8 @@ public ArrayList CapsUpdateTaskInventoryScriptAsset(UUID avatarId, UUID itemId,
/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, string name, string description,
uint nextOwnerMask)*/
- public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
- UUID itemID, InventoryItemBase itemUpd)
+ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, UUID itemID, InventoryItemBase itemUpd)
{
- //m_log.DebugFormat(
- // "[USER INVENTORY]: Updating asset for item {0} {1}, transaction ID {2} for {3}",
- // itemID, itemUpd.Name, transactionID, remoteClient.Name);
-
// This one will let people set next perms on items in agent
// inventory. Rut-Roh. Whatever. Make this secure. Yeah.
//
@@ -461,18 +459,18 @@ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
bool sendUpdate = false;
item.Flags = (item.Flags & ~(uint)255) | (itemUpd.Flags & (uint)255);
- if(item.AssetType == (int)AssetType.Landmark)
+ if (item.AssetType == (int)AssetType.Landmark)
{
- if(item.Name.StartsWith("HG ") && !itemUpd.Name.StartsWith("HG "))
+ if (item.Name.StartsWith("HG ") && !itemUpd.Name.StartsWith("HG "))
{
itemUpd.Name = "HG " + itemUpd.Name;
sendUpdate = true;
}
int origIndx = item.Description.LastIndexOf("@ htt");
- if(origIndx >= 0)
+ if (origIndx >= 0)
{
- if(itemUpd.Description.LastIndexOf('@') < 0)
+ if (itemUpd.Description.LastIndexOf('@') < 0)
{
itemUpd.Description += string.Concat(" ", item.Description.AsSpan(origIndx));
sendUpdate = true;
@@ -482,19 +480,12 @@ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
item.Name = itemUpd.Name;
item.Description = itemUpd.Description;
- //m_log.DebugFormat(
- // "[USER INVENTORY]: itemUpd {0} {1} {2} {3}, item {4} {5} {6} {7}",
- // itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags,
- // item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions);
-
if (itemUpd.NextPermissions != 0) // Use this to determine validity. Can never be 0 if valid
{
// Create a set of base permissions that will not include export if the user
// is not allowed to change the export flag.
bool denyExportChange = false;
- //m_log.DebugFormat("[XXX]: B: {0} O: {1} E: {2}", itemUpd.BasePermissions, itemUpd.CurrentPermissions, itemUpd.EveryOnePermissions);
-
// If the user is not the creator or doesn't have "E" in both "B" and "O", deny setting export
if ((item.BasePermissions & (uint)(PermissionMask.All | PermissionMask.Export)) != (uint)(PermissionMask.All | PermissionMask.Export) || (item.CurrentPermissions & (uint)PermissionMask.Export) == 0 || item.CreatorIdAsUuid != item.Owner)
denyExportChange = true;
@@ -530,21 +521,24 @@ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
+
item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions))
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
+
item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
+
item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
item.GroupID = itemUpd.GroupID;
item.GroupOwned = itemUpd.GroupOwned;
item.CreationDate = itemUpd.CreationDate;
- // The client sends zero if its newly created?
+ // The client sends zero if its newly created?
if (itemUpd.CreationDate == 0)
item.CreationDate = Util.UnixTimeSinceEpoch();
else
@@ -557,6 +551,7 @@ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
if (item.SalePrice != itemUpd.SalePrice ||
item.SaleType != itemUpd.SaleType)
item.Flags |= (uint)InventoryItemFlags.ObjectSlamSale;
+
item.SalePrice = itemUpd.SalePrice;
item.SaleType = itemUpd.SaleType;
@@ -587,9 +582,7 @@ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
}
else
{
- m_log.ErrorFormat(
- "[AGENTINVENTORY]: Item id {0} not found for an inventory item update for {1}.",
- itemID, remoteClient.Name);
+ Logger?.LogError($"[AGENTINVENTORY]: Item id {itemID} not found for an inventory item update for {remoteClient.Name}.");
}
}
@@ -602,6 +595,7 @@ public void UpdateInventoryItem(IClientAPI remoteClient, UUID transactionID,
public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId, out string message)
{
InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId, out message);
+
if (itemCopy is not null)
recipientClient.SendBulkUpdateInventory(itemCopy);
}
@@ -645,9 +639,9 @@ public virtual InventoryItemBase GiveInventoryItem(
InventoryItemBase item = InventoryService.GetItem(senderId, itemId);
if (item is null)
{
- m_log.WarnFormat(
- "[AGENT INVENTORY]: Failed to find item {0} sent by {1} to {2}", itemId, senderId, recipient);
+ Logger?.LogWarning($"[AGENT INVENTORY]: Failed to find item {itemId} sent by {senderId} to {recipient}");
message = string.Format("Item not found: {0}.", itemId);
+
return null;
}
@@ -659,9 +653,7 @@ public virtual InventoryItemBase GiveInventoryItem(
if (item.Owner.NotEqual(senderId))
{
- m_log.WarnFormat(
- "[AGENT INVENTORY]: Attempt to send item {0} {1} to {2} failed because sender {3} did not match item owner {4}",
- item.Name, item.ID, recipient, senderId, item.Owner);
+ Logger?.LogWarning($"[AGENT INVENTORY]: Attempt to send item {item.Name} {item.ID} to {recipient} failed because sender {senderId} did not match item owner {item.Owner}");
message = "Sender did not match item owner.";
return null;
}
@@ -901,13 +893,13 @@ public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client,
InventoryFolderBase folder = InventoryService.GetFolder(senderId, folderId);
if (folder is null)
{
- m_log.ErrorFormat("[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId);
+ Logger?.LogError($"[AGENT INVENTORY]: Could not find inventory folder {folderId} to give");
return null;
}
if (denyGiveFolderTypes.Contains(folder.Type))
{
- m_log.ErrorFormat("[AGENT INVENTORY]: can not give inventory folder {0}", folderId);
+ Logger?.LogError($"[AGENT INVENTORY]: can not give inventory folder {folderId}");
return null;
}
@@ -918,7 +910,7 @@ public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client,
recipientParentFolderId = recipientRootFolder.ID;
else
{
- m_log.WarnFormat("[AGENT INVENTORY]: Unable to find root folder for receiving agent");
+ Logger?.LogWarning($"[AGENT INVENTORY]: Unable to find root folder for receiving agent");
return null;
}
}
@@ -956,7 +948,7 @@ public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client,
InventoryFolderBase folder = InventoryService.GetFolder(senderId, folderId);
if (folder is null)
{
- m_log.ErrorFormat("[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId);
+ Logger?.LogError($"[AGENT INVENTORY]: Could not find inventory folder {folderId} to give");
return null;
}
@@ -965,7 +957,7 @@ public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client,
if (denyGiveFolderTypes.Contains(folder.Type))
{
- m_log.ErrorFormat("[AGENT INVENTORY]: can not give inventory folder {0}", folderId);
+ Logger?.LogError($"[AGENT INVENTORY]: can not give inventory folder {folderId}");
return null;
}
@@ -973,11 +965,8 @@ public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client,
{
InventoryFolderBase recipientRootFolder = InventoryService.GetRootFolder(recipientId);
if (recipientRootFolder is not null)
- recipientParentFolderId = recipientRootFolder.ID;
- else
{
- m_log.WarnFormat("[AGENT INVENTORY]: Unable to find root folder for receiving agent");
- return null;
+ recipientParentFolderId = recipientRootFolder.ID;
}
}
@@ -1019,9 +1008,9 @@ public virtual InventoryFolderBase GiveInventoryFolder(IClientAPI client,
public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, UUID oldAgentID, UUID oldItemID,
UUID newFolderID, string newName)
{
- m_log.DebugFormat(
- "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
- remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName);
+ Logger?.LogDebug(
+ $"[AGENT INVENTORY]: CopyInventoryItem received by {remoteClient.AgentId} with oldAgentID {oldAgentID}, " +
+ $"oldItemID {oldItemID}, new FolderID {newFolderID}, newName {newName}");
InventoryItemBase item = null;
if (LibraryService is not null && LibraryService.LibraryRootFolder is not null)
@@ -1033,7 +1022,7 @@ public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, UUID old
if (item is null)
{
- m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
+ Logger.LogError($"[AGENT INVENTORY]: Failed to find item {oldItemID}");
return;
}
@@ -1112,16 +1101,17 @@ public void MoveInventoryItemsLeaveCopy(IClientAPI remoteClient, List items)
{
UUID agentId = remoteClient.AgentId;
- m_log.DebugFormat(
- "[AGENT INVENTORY]: Moving {0} items for user {1}", items.Count, agentId);
+ Logger?.LogDebug($"[AGENT INVENTORY]: Moving {items.Count} items for user {agentId}");
if (!InventoryService.MoveItems(agentId, items))
- m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + agentId);
+ {
+ Logger?.LogWarning($"[AGENT INVENTORY]: Failed to move items for user {agentId}");
+ }
foreach (InventoryItemBase it in items)
{
InventoryItemBase n = InventoryService.GetItem(agentId, it.ID);
- if(n is not null)
+ if (n is not null)
remoteClient.SendBulkUpdateInventory(n);
}
}
@@ -1193,9 +1183,7 @@ public void CreateNewInventoryItem(
else
{
m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item");
- m_log.WarnFormat(
- "Failed to add item for {0} in CreateNewInventoryItem!",
- remoteClient.Name);
+ Logger?.LogWarning($"Failed to add item for {remoteClient.Name} in CreateNewInventoryItem!");
}
}
@@ -1257,9 +1245,7 @@ private void HandleLinkInventoryItem(IClientAPI remoteClient, UUID transActionID
}
else
{
- m_log.ErrorFormat(
- "ScenePresence for agent uuid {0} unexpectedly not found in HandleLinkInventoryItem",
- remoteClient.AgentId);
+ Logger.LogError($"ScenePresence for agent uuid {remoteClient.AgentId} unexpectedly not found in HandleLinkInventoryItem");
}
}
@@ -1286,7 +1272,7 @@ private void RemoveInventoryItem(IClientAPI remoteClient, List itemIDs)
///
private void RemoveInventoryFolder(IClientAPI remoteClient, List folderIDs)
{
- m_log.DebugFormat("[SCENE INVENTORY]: RemoveInventoryFolders count {0}", folderIDs.Count);
+ Logger.LogDebug($"[SCENE INVENTORY]: RemoveInventoryFolders count {folderIDs.Count}");
InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs);
}
@@ -1339,7 +1325,7 @@ public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint local
if (item2 is null)
{
- m_log.WarnFormat("[SCENE INVENTORY]: RemoveTaskInventory of item {0} failed: {1}", itemID, message);
+ Logger?.LogWarning($"[SCENE INVENTORY]: RemoveTaskInventory of item {itemID} failed: {message}");
remoteClient.SendAgentAlertMessage(message, false);
return;
}
@@ -1368,11 +1354,10 @@ private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, Scene
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);
if (taskItem is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for creating an avatar"
- + " inventory item from a prim's inventory item "
- + " but the required item does not exist in the prim's inventory",
- itemId, part.Name, part.UUID);
+ Logger?.LogError(
+ $"[PRIM INVENTORY]: Tried to retrieve item ID {itemId} from prim {part.Name}, {part.UUID} for creating an avatar"
+ + " inventory item from a prim's inventory item but the required item does not exist in the prim's inventory");
+
message = "Item not found: " + itemId;
return null;
}
@@ -1470,9 +1455,7 @@ private void RemoveNonCopyTaskItemFromPrim(SceneObjectPart part, UUID itemId)
///
public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId, out string message)
{
- m_log.DebugFormat(
- "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}",
- itemId, part.Name, folderId, remoteClient.Name);
+ Logger?.LogDebug($"[PRIM INVENTORY]: Adding item {itemId} from {part.Name} to folder {folderId} for {remoteClient.Name}");
InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId, out message);
if (agentItem is null)
@@ -1502,30 +1485,27 @@ public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId,
SceneObjectPart part = GetSceneObjectPart(primLocalId);
if (part is null)
{
- m_log.WarnFormat(
- "[PRIM INVENTORY]: " +
- "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found",
- itemId, primLocalId);
-
+ Logger.LogWarning($"[PRIM INVENTORY]: Move of inventory item {itemId} from prim with local id {primLocalId} failed because the prim could not be found");
return;
}
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);
if (taskItem is null)
{
- m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed"
- + " because the inventory item could not be found",
- itemId, primLocalId);
-
+ Logger?.LogWarning($"[PRIM INVENTORY]: Move of inventory item {itemId} from prim with local id {primLocalId} failed because the inventory item could not be found");
return;
}
if (!Permissions.CanCopyObjectInventory(itemId, part.UUID, remoteClient.AgentId))
+ {
return;
+ }
InventoryItemBase item = MoveTaskInventoryItem(remoteClient, folderId, part, itemId, out string message);
if (item is null)
+ {
remoteClient.SendAgentAlertMessage(message, false);
+ }
}
///
@@ -1572,10 +1552,9 @@ public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId
TaskInventoryItem srcTaskItem = part.Inventory.GetInventoryItem(itemId);
if (srcTaskItem is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for moving"
- + " but the item does not exist in this inventory",
- itemId, part.Name, part.UUID);
+ Logger?.LogError(
+ $"[PRIM INVENTORY]: Tried to retrieve item ID {itemId} from prim {part.Name}, {part.UUID} for moving" +
+ $" but the item does not exist in this inventory");
return;
}
@@ -1583,10 +1562,7 @@ public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId
SceneObjectPart destPart = GetSceneObjectPart(destId);
if (destPart is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: " +
- "Could not find prim for ID {0}",
- destId);
+ Logger?.LogError($"[PRIM INVENTORY]: Could not find prim for ID {0}", destId);
return;
}
@@ -1779,7 +1755,7 @@ public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, Tas
UUID itemID = itemInfo.ItemID;
if (itemID.IsZero())
{
- m_log.ErrorFormat(
+ Logger?.LogError(
"[PRIM INVENTORY]: UpdateTaskInventory called with item ID Zero on update for {1}!",
remoteClient.Name);
return;
@@ -1789,11 +1765,8 @@ public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, Tas
SceneObjectPart part = GetSceneObjectPart(primLocalID);
if(part is null)
{
- m_log.WarnFormat(
- "[PRIM INVENTORY]: " +
- "Update with item {0} requested of prim {1} for {2} but this prim does not exist",
- itemID, primLocalID, remoteClient.Name);
- return;
+ Logger?.LogWarning($"[PRIM INVENTORY]: Update with item {itemID} requested of prim {primLocalID} for {remoteClient.Name} but this prim does not exist");
+ return;
}
TaskInventoryItem currentItem = part.Inventory.GetInventoryItem(itemID);
@@ -1808,9 +1781,7 @@ public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, Tas
if(item is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
- itemID, remoteClient.Name);
+ Logger?.LogError($"[PRIM INVENTORY]: Could not find inventory item {itemID} to update for {remoteClient.Name}!");
return;
}
@@ -1820,9 +1791,9 @@ public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, Tas
UUID copyID = UUID.Random();
bool modrights = Permissions.CanEditObject(part.ParentGroup, remoteClient);
part.ParentGroup.AddInventoryItem(remoteClient.AgentId, primLocalID, item, copyID, modrights);
- m_log.InfoFormat(
- "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
- item.Name, primLocalID, remoteClient.Name);
+
+ Logger?.LogInformation($"[PRIM INVENTORY]: Update with item {item.Name} requested of prim {primLocalID} for {remoteClient.Name}");
+
part.SendPropertiesToClient(remoteClient);
if (!Permissions.BypassPermissions())
{
@@ -1835,10 +1806,6 @@ public void UpdateTaskInventory(IClientAPI remoteClient, UUID transactionID, Tas
}
else // Updating existing item with new perms etc
{
- //m_log.DebugFormat(
- // "[PRIM INVENTORY]: Updating item {0} in {1} for UpdateTaskInventory()",
- // currentItem.Name, part.Name);
-
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
return;
@@ -1999,18 +1966,14 @@ public SceneObjectPart RezScriptFromAgentInventory(UUID agentID, UUID fromItemID
}
else
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: " +
- "Could not rez script {0} into prim local ID {1} for user {2}"
- + " because the prim could not be found in the region!",
- item.Name, localID, agentID);
+ Logger?.LogError(
+ $"[PRIM INVENTORY]: Could not rez script {item.Name} into prim local ID {localID} " +
+ $"for user {agentID} because the prim could not be found in the region!");
}
}
else
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Could not find script inventory item {0} to rez for {1}!",
- fromItemID, agentID);
+ Logger?.LogError($"[PRIM INVENTORY]: Could not find script inventory item {fromItemID} to rez for {agentID}!");
}
return null;
@@ -2124,10 +2087,9 @@ public void RezScriptFromPrim(UUID srcId, SceneObjectPart srcPart, UUID destId,
TaskInventoryItem srcTaskItem = srcPart.Inventory.GetInventoryItem(srcId);
if (srcTaskItem is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for rezzing a script but the "
- + " item does not exist in this inventory",
- srcId, srcPart.Name, srcPart.UUID);
+ Logger?.LogError(
+ $"[PRIM INVENTORY]: Tried to retrieve item ID {srcId} from prim {srcPart.Name}, {srcPart.UUID} " +
+ "for rezzing a script but the item does not exist in this inventory");
return;
}
@@ -2135,9 +2097,7 @@ public void RezScriptFromPrim(UUID srcId, SceneObjectPart srcPart, UUID destId,
SceneObjectPart destPart = GetSceneObjectPart(destId);
if (destPart is null)
{
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Could not find part {0} to insert script item {1} from {2} {3} in {4}",
- destId, srcId, srcPart.Name, srcPart.UUID, Name);
+ Logger?.LogError($"[PRIM INVENTORY]: Could not find part {destId} to insert script item {srcId} from {srcPart.Name} {srcPart.UUID} in {Name}");
return;
}
@@ -2159,10 +2119,11 @@ public void RezScriptFromPrim(UUID srcId, SceneObjectPart srcPart, UUID destId,
if (destPart.ScriptAccessPin == 0 || destPart.ScriptAccessPin != pin)
{
- m_log.WarnFormat(
- "[PRIM INVENTORY]: " +
- "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}",
- srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin);
+ Logger?.LogWarning(
+ $"[PRIM INVENTORY]: Script in object {srcPart.Name} : {srcId}, " +
+ $"attempted to load script {srcTaskItem.Name} : {srcTaskItem.ItemID} " +
+ $"into object {destPart.Name} : {destId} with invalid pin {pin}");
+
// the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL -
// "Object: Task Object trying to illegally load script onto task Other_Object!"
// How do we shout from in here?
@@ -2523,15 +2484,15 @@ public bool GetObjectsToRez(
if (isSingleObject || isAttachment)
{
- SceneObjectGroup g;
+ SceneObjectGroup? g;
try
{
g = SceneObjectSerializer.FromOriginalXmlFormat(reader);
}
catch (Exception e)
{
- m_log.Error("[AGENT INVENTORY]: Deserialization of xml failed ", e);
- Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
+ Logger?.LogError(e, "[AGENT INVENTORY]: Deserialization of xml failed.");
+ //Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
g = null;
}
@@ -2583,8 +2544,8 @@ public bool GetObjectsToRez(
}
catch (Exception e)
{
- m_log.Error("[AGENT INVENTORY]: Deserialization of xml failed when looking for CoalescedObject tag ", e);
- Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
+ Logger?.LogError(e, "\"[AGENT INVENTORY]: Deserialization of xml failed when looking for CoalescedObject tag.");
+ //Util.LogFailedXML("[AGENT INVENTORY]:", xmlData);
}
return true;
@@ -2630,9 +2591,9 @@ public virtual void RezObject(IClientAPI remoteClient, UUID itemID, UUID rezGrou
SceneObjectPart part = GetSceneObjectPart(fromTaskID);
if (part is null)
{
- m_log.ErrorFormat(
- "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object",
- remoteClient.Name, itemID, fromTaskID);
+ Logger?.LogError(
+ $"[TASK INVENTORY]: {remoteClient.Name} tried to rez item id {itemID} " +
+ $"from object id {fromTaskID} but there is no such scene object");
return;
}
@@ -2640,17 +2601,19 @@ public virtual void RezObject(IClientAPI remoteClient, UUID itemID, UUID rezGrou
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID);
if (item is null)
{
- m_log.ErrorFormat(
- "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item",
- remoteClient.Name, itemID, fromTaskID);
+ Logger?.LogError(
+ $"[TASK INVENTORY]: {remoteClient.Name} tried to rez item id {itemID} " +
+ $"from object id {fromTaskID} but there is no such item");
+
return;
}
if(item.InvType != (int)InventoryType.Object)
{
- m_log.ErrorFormat(
- "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but item is not a object",
- remoteClient.Name, itemID, fromTaskID);
+ Logger?.LogError(
+ $"[TASK INVENTORY]: {remoteClient.Name} tried to rez item id {itemID} " +
+ $"from object id {fromTaskID} but item is not a object");
+
return;
}
@@ -2967,13 +2930,13 @@ public void LinkObjects(UUID agentId, uint parentPrimId, List childPrimIds
if (root is null)
{
- m_log.DebugFormat("[LINK]: Can't find linkset root prim {0}", parentPrimId);
+ Logger?.LogDebug($"[LINK]: Can't find linkset root prim {parentPrimId}");
return;
}
if (!Permissions.CanLinkObject(agentId, root.ParentGroup.RootPart.UUID))
{
- m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim");
+ Logger?.LogDebug($"[LINK]: Refusing link. No permissions on root prim");
return;
}
@@ -2995,13 +2958,13 @@ public void LinkObjects(UUID agentId, uint parentPrimId, List childPrimIds
//
if (owners.Count > 1)
{
- m_log.DebugFormat("[LINK]: Refusing link. Too many owners");
+ Logger?.LogDebug($"[LINK]: Refusing link. Too many owners");
return;
}
if (children.Count == 0)
{
- m_log.DebugFormat("[LINK]: Refusing link. No permissions to link any of the children");
+ Logger?.LogDebug($"[LINK]: Refusing link. No permissions to link any of the children");
return;
}
diff --git a/Source/OpenSim.Region.Framework/Scenes/Scene.Permissions.cs b/Source/OpenSim.Region.Framework/Scenes/Scene.Permissions.cs
index 48c1f67518a..1a6703065ad 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Scene.Permissions.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Scene.Permissions.cs
@@ -25,14 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using log4net;
using OpenMetaverse;
using OpenSim.Framework;
-using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Region.Framework.Scenes
{
diff --git a/Source/OpenSim.Region.Framework/Scenes/Scene.cs b/Source/OpenSim.Region.Framework/Scenes/Scene.cs
index 3d9195323db..55f76dc2f08 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Scene.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Scene.cs
@@ -25,15 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.IO;
using System.Runtime;
using System.Text;
-using System.Threading;
using System.Timers;
-using Nini.Config;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
@@ -42,10 +37,12 @@
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Region.PhysicsModule.SharedBase;
+
using Timer = System.Timers.Timer;
using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using PermissionMask = OpenSim.Framework.PermissionMask;
+
using System.Runtime.CompilerServices;
using Microsoft.Extensions.Configuration;
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneBase.cs b/Source/OpenSim.Region.Framework/Scenes/SceneBase.cs
index 8b02c5fb2f4..2ab48eae03c 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneBase.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneBase.cs
@@ -25,26 +25,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Threading;
using OpenMetaverse;
-using log4net;
-using Nini.Config;
using OpenSim.Framework;
-using OpenSim.Framework.Console;
-
using OpenSim.Region.Framework.Interfaces;
+
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
+
using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Region.Framework.Scenes
{
public abstract class SceneBase : IScene
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
#pragma warning disable 414
private static readonly string LogHeader = "[SCENE]";
#pragma warning restore 414
@@ -59,12 +52,22 @@ public abstract class SceneBase : IScene
public string Name { get { return RegionInfo.RegionName; } }
- public IConfiguration Config
+ public IConfiguration? Config
{
get { return GetConfig(); }
}
- protected virtual IConfiguration GetConfig()
+ protected virtual IConfiguration? GetConfig()
+ {
+ return null;
+ }
+
+ public ILogger? Logger
+ {
+ get { return GetLogger(); }
+ }
+
+ protected virtual ILogger? GetLogger()
{
return null;
}
@@ -76,6 +79,7 @@ public Dictionary RegionModules
{
get { return m_regionModules; }
}
+
private Dictionary m_regionModules = new Dictionary();
///
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneCommunicationService.cs b/Source/OpenSim.Region.Framework/Scenes/SceneCommunicationService.cs
index cf8b2cd999a..b0f5503ced0 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneCommunicationService.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneCommunicationService.cs
@@ -25,20 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Net;
using System.Reflection;
-using System.Threading;
+using Microsoft.Extensions.Logging;
using OpenMetaverse;
-using OpenMetaverse.StructuredData;
-using log4net;
using OpenSim.Framework;
-using OpenSim.Framework.Client;
-using OpenSim.Framework.Capabilities;
-using OpenSim.Region.Framework.Interfaces;
using OpenSim.Services.Interfaces;
-using OSD = OpenMetaverse.StructuredData.OSD;
+
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Region.Framework.Scenes
@@ -50,12 +42,17 @@ namespace OpenSim.Region.Framework.Scenes
///
public class SceneCommunicationService //one instance per region
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private readonly ILogger _logger;
private static readonly string LogHeader = "[SCENE COMM]";
protected RegionInfo m_regionInfo;
protected Scene m_scene;
+ public SceneCommunicationService(ILogger logger)
+ {
+ _logger = logger;
+ }
+
public void SetScene(Scene s)
{
m_scene = s;
@@ -64,10 +61,9 @@ public void SetScene(Scene s)
public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region)
{
- //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
if (neighbourService == null)
{
- m_log.ErrorFormat("{0} No neighbour service provided for region {1} to inform neigbhours of status", LogHeader, m_scene.Name);
+ _logger.LogError($"{LogHeader} No neighbour service provided for region {m_scene.Name} to inform neigbhours of status");
return;
}
@@ -105,15 +101,12 @@ List neighbours
GridRegion neighbour = neighbourService.HelloNeighbour(regionhandle, region);
if (neighbour != null)
{
- m_log.DebugFormat("{0} Region {1} successfully informed neighbour {2} at {3}-{4} that it is up",
- LogHeader, m_scene.Name, neighbour.RegionName, rx, ry);
-
+ _logger.LogDebug($"{LogHeader} Region {m_scene.Name} successfully informed neighbour {neighbour.RegionName} at {rx}-{ry} that it is up");
m_scene.EventManager.TriggerOnRegionUp(neighbour);
}
else
{
- m_log.WarnFormat("{0} Region {1} failed to inform neighbour at {2}-{3} that it is up.",
- LogHeader, m_scene.Name, rx, ry);
+ _logger.LogWarning($"{LogHeader} Region {m_scene.Name} failed to inform neighbour at {rx}-{ry} that it is up.");
}
}
});
@@ -182,14 +175,11 @@ public void SendCloseChildAgentConnections(UUID agentID, string auth_code, List<
GridRegion destination = m_scene.GridService.GetRegionByHandle(m_regionInfo.ScopeID, regionHandle);
if (destination == null)
{
- m_log.DebugFormat(
- "[SCENE COMMUNICATION SERVICE]: Sending close agent ID {0} FAIL, region with handle {1} not found", agentID, regionHandle);
+ _logger.LogDebug($"[SCENE COMMUNICATION SERVICE]: Sending close agent ID {agentID} FAIL, region with handle {regionHandle} not found");
return;
}
- m_log.DebugFormat(
- "[SCENE COMMUNICATION SERVICE]: Sending close agent ID {0} to {1}", agentID, destination.RegionName);
-
+ _logger.LogDebug($"[SCENE COMMUNICATION SERVICE]: Sending close agent ID {agentID} to {destination.RegionName}");
m_scene.SimulationService.CloseAgent(destination, agentID, auth_code);
}
}, null, "SCOMM.SendCloseChildAgentConnections");
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneGraph.cs b/Source/OpenSim.Region.Framework/Scenes/SceneGraph.cs
index 9812f584927..d24f7249ca4 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneGraph.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneGraph.cs
@@ -25,18 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Threading;
-using System.Collections.Generic;
-using System.Collections.Concurrent;
using System.Reflection;
using OpenMetaverse;
using OpenMetaverse.Packets;
-using log4net;
using OpenSim.Framework;
-using OpenSim.Region.Framework.Scenes.Types;
using OpenSim.Region.PhysicsModule.SharedBase;
-using OpenSim.Region.Framework.Interfaces;
using System.Runtime.InteropServices;
namespace OpenSim.Region.Framework.Scenes
@@ -52,8 +45,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public class SceneGraph
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
#region Events
protected internal event PhysicsCrash UnRecoverableError;
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneManager.cs b/Source/OpenSim.Region.Framework/Scenes/SceneManager.cs
index f454908d9ce..07f67918f8a 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneManager.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneManager.cs
@@ -25,12 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Net;
using System.Reflection;
using OpenMetaverse;
-using log4net;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
@@ -43,8 +40,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public class SceneManager
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public event RestartSim OnRestartSim;
///
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneObjectGroup.Inventory.cs b/Source/OpenSim.Region.Framework/Scenes/SceneObjectGroup.Inventory.cs
index 88605ac4330..93e048c3546 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -25,23 +25,18 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
using System.Reflection;
using OpenMetaverse;
-using log4net;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
-using System.Collections.Generic;
using System.Xml;
+
using PermissionMask = OpenSim.Framework.PermissionMask;
namespace OpenSim.Region.Framework.Scenes
{
public partial class SceneObjectGroup : EntityBase
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Force all task inventories of prims in the scene object to persist
///
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneObjectPart.cs b/Source/OpenSim.Region.Framework/Scenes/SceneObjectPart.cs
index fe4b1f09253..fca530942a0 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneObjectPart.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneObjectPart.cs
@@ -30,7 +30,6 @@
using System.Text;
using System.Xml;
using System.Xml.Serialization;
-using log4net;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
@@ -109,8 +108,6 @@ public class SceneObjectPart : EntityBase, IDisposable
scriptEvents.collision_start | scriptEvents.collision_end
);
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
///
/// Dynamic attributes can be created and deleted as required.
///
diff --git a/Source/OpenSim.Region.Framework/Scenes/SceneObjectPartInventory.cs b/Source/OpenSim.Region.Framework/Scenes/SceneObjectPartInventory.cs
index c0dad7ac423..d953adc0d9b 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SceneObjectPartInventory.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SceneObjectPartInventory.cs
@@ -25,28 +25,20 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Text;
using System.Xml;
-using System.IO;
-using System.Collections.Generic;
using System.Collections;
using System.Reflection;
-using System.Threading;
using OpenMetaverse;
-using log4net;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes.Scripting;
-using OpenSim.Region.Framework.Scenes.Serialization;
+
using PermissionMask = OpenSim.Framework.PermissionMask;
namespace OpenSim.Region.Framework.Scenes
{
public class SceneObjectPartInventory : IEntityInventory , IDisposable
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private byte[] m_inventoryFileData = Array.Empty();
private byte[] m_inventoryFileNameBytes = Array.Empty();
private string m_inventoryFileName = "";
diff --git a/Source/OpenSim.Region.Framework/Scenes/ScenePresence.cs b/Source/OpenSim.Region.Framework/Scenes/ScenePresence.cs
index 84625b7206b..fdbc5dc7cef 100644
--- a/Source/OpenSim.Region.Framework/Scenes/ScenePresence.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/ScenePresence.cs
@@ -25,18 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Reflection;
-using System.Threading;
using OpenMetaverse;
-using log4net;
-using Nini.Config;
using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes.Animation;
-using OpenSim.Region.Framework.Scenes.Types;
using OpenSim.Region.PhysicsModule.SharedBase;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenSim.Services.Interfaces;
@@ -83,16 +77,10 @@ enum AgentUpdateFlags: byte
public class ScenePresence : EntityBase, IScenePresence, IDisposable
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- //~ScenePresence()
- //{
- // m_log.DebugFormat("[SCENE PRESENCE]: Destructor called on {0}", Name);
- //}
-
public bool GotAttachmentsData = false;
public int EnvironmentVersion = -1;
private ViewerEnvironment m_environment = null;
+
public ViewerEnvironment Environment
{
get
diff --git a/Source/OpenSim.Region.Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/Source/OpenSim.Region.Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
index 6a4a18144a6..cf03edc423a 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs
@@ -25,18 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
-using System.Reflection;
using System.Text;
using System.Xml;
-using log4net;
using OpenMetaverse;
using OpenSim.Framework;
-using OpenSim.Region.Framework.Interfaces;
-using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.Framework.Scenes.Serialization
{
@@ -45,7 +37,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
///
public class CoalescedSceneObjectsSerializer
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
///
/// Serialize coalesced objects to Xml
diff --git a/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneObjectSerializer.cs b/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneObjectSerializer.cs
index f371137f3e6..eb093516e40 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -25,13 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
using System.Drawing;
-using System.IO;
-using System.Reflection;
+
using System.Xml;
-using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Serialization.External;
@@ -45,8 +41,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
/// right now - hopefully this isn't forever.
public class SceneObjectSerializer
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static IUserManagement m_UserManagement;
///
diff --git a/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneXmlLoader.cs b/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneXmlLoader.cs
index 4fb3e6a0d27..5e10ec793a9 100644
--- a/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneXmlLoader.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/Serialization/SceneXmlLoader.cs
@@ -25,16 +25,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.IO;
using System.Reflection;
using System.Xml;
using OpenMetaverse;
-using log4net;
-using OpenSim.Framework;
-using OpenSim.Region.Framework.Scenes;
-using OpenSim.Region.PhysicsModule.SharedBase;
namespace OpenSim.Region.Framework.Scenes.Serialization
{
@@ -43,8 +36,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
///
public class SceneXmlLoader
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
#region old xml format
public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset)
{
diff --git a/Source/OpenSim.Region.Framework/Scenes/SimStatsReporter.cs b/Source/OpenSim.Region.Framework/Scenes/SimStatsReporter.cs
index 65df9ef829c..84fa5e052e3 100644
--- a/Source/OpenSim.Region.Framework/Scenes/SimStatsReporter.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/SimStatsReporter.cs
@@ -25,11 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Timers;
-using System.Threading;
-using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Framework.Monitoring;
using OpenSim.Region.Framework.Interfaces;
@@ -44,8 +39,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public class SimStatsReporter
{
- private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
public delegate void SendStatResult(SimStats stats);
public event SendStatResult OnSendStatsResult;
diff --git a/Source/OpenSim.Region.Framework/Scenes/TerrainChannel.cs b/Source/OpenSim.Region.Framework/Scenes/TerrainChannel.cs
index fc404c2d9cb..c621da4ee42 100644
--- a/Source/OpenSim.Region.Framework/Scenes/TerrainChannel.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/TerrainChannel.cs
@@ -25,21 +25,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.IO;
-using System.Text;
-using System.Reflection;
using System.Xml;
using System.Xml.Serialization;
-
-using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenMetaverse;
-using log4net;
-
namespace OpenSim.Region.Framework.Scenes
{
///
@@ -47,7 +39,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public class TerrainChannel : ITerrainChannel
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string LogHeader = "[TERRAIN CHANNEL]";
protected TerrainData m_terrainData;
diff --git a/Source/OpenSim.Region.Framework/Scenes/TerrainCompressor.cs b/Source/OpenSim.Region.Framework/Scenes/TerrainCompressor.cs
index 0f9c448139d..38c786d2636 100644
--- a/Source/OpenSim.Region.Framework/Scenes/TerrainCompressor.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/TerrainCompressor.cs
@@ -32,11 +32,6 @@
// terrain patchs must be 16mx16m
-using System;
-using System.Collections.Generic;
-
-using log4net;
-
using OpenSim.Framework;
using OpenMetaverse;
diff --git a/Source/OpenSim.Region.Framework/Scenes/UndoState.cs b/Source/OpenSim.Region.Framework/Scenes/UndoState.cs
index f2a3e5f23c0..efa17b3cb22 100644
--- a/Source/OpenSim.Region.Framework/Scenes/UndoState.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/UndoState.cs
@@ -25,11 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Reflection;
-using System.Collections.Generic;
-using log4net;
-using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
diff --git a/Source/OpenSim.Region.Framework/Scenes/UuidGatherer.cs b/Source/OpenSim.Region.Framework/Scenes/UuidGatherer.cs
index 7c9e7b94d26..b36307b5971 100644
--- a/Source/OpenSim.Region.Framework/Scenes/UuidGatherer.cs
+++ b/Source/OpenSim.Region.Framework/Scenes/UuidGatherer.cs
@@ -25,12 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
-using log4net;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
@@ -50,8 +46,6 @@ namespace OpenSim.Region.Framework.Scenes
///
public class UuidGatherer
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private static readonly HashSet ToSkip = new()
{
new UUID("11111111-1111-0000-0000-000100bba000"),
@@ -1315,8 +1309,6 @@ private void RecordMaterialAssetUuids(AssetBase materialAsset)
public class HGUuidGatherer : UuidGatherer
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
protected string m_assetServerURL;
public HGUuidGatherer(IAssetService assetService, string assetServerURL)
diff --git a/Source/OpenSim.Region.OptionalModules.Currency/OpenSim.Region.OptionalModules.Currency.csproj b/Source/OpenSim.Region.OptionalModules.Currency/OpenSim.Region.OptionalModules.Currency.csproj
index ea9e024b438..99e3ae49a37 100644
--- a/Source/OpenSim.Region.OptionalModules.Currency/OpenSim.Region.OptionalModules.Currency.csproj
+++ b/Source/OpenSim.Region.OptionalModules.Currency/OpenSim.Region.OptionalModules.Currency.csproj
@@ -32,7 +32,6 @@
-
diff --git a/Source/OpenSim.Region.OptionalModules/OpenSim.Region.OptionalModules.csproj b/Source/OpenSim.Region.OptionalModules/OpenSim.Region.OptionalModules.csproj
index 0da7b218ef4..7b3ca6f2cc9 100644
--- a/Source/OpenSim.Region.OptionalModules/OpenSim.Region.OptionalModules.csproj
+++ b/Source/OpenSim.Region.OptionalModules/OpenSim.Region.OptionalModules.csproj
@@ -52,10 +52,8 @@
-
-
-
+
\ No newline at end of file
diff --git a/Source/OpenSim.Region.PhysicsModule.BulletS/BSScene.cs b/Source/OpenSim.Region.PhysicsModule.BulletS/BSScene.cs
index 93996fd1b5b..cadce15bb62 100644
--- a/Source/OpenSim.Region.PhysicsModule.BulletS/BSScene.cs
+++ b/Source/OpenSim.Region.PhysicsModule.BulletS/BSScene.cs
@@ -35,7 +35,6 @@
using OpenMetaverse;
using Microsoft.Extensions.Configuration;
-using log4net.Core;
using Microsoft.Extensions.Logging;
namespace OpenSim.Region.PhysicsModule.BulletS
@@ -418,20 +417,20 @@ private void GetInitialParameterValues(IConfiguration config)
}
}
- // A helper function that handles a true/false parameter and returns the proper float number encoding
- float ParamBoolean(IConfig config, string parmName, float deflt)
- {
- float ret = deflt;
- if (config.Contains(parmName))
- {
- ret = ConfigurationParameters.numericFalse;
- if (config.GetBoolean(parmName, false))
- {
- ret = ConfigurationParameters.numericTrue;
- }
- }
- return ret;
- }
+ //// A helper function that handles a true/false parameter and returns the proper float number encoding
+ //float ParamBoolean(IConfig config, string parmName, float deflt)
+ //{
+ // float ret = deflt;
+ // if (config.Contains(parmName))
+ // {
+ // ret = ConfigurationParameters.numericFalse;
+ // if (config.GetBoolean(parmName, false))
+ // {
+ // ret = ConfigurationParameters.numericTrue;
+ // }
+ // }
+ // return ret;
+ //}
// Select the connection to the actual Bullet implementation.
// The main engine selection is the engineName up to the first hypen.
diff --git a/Source/OpenSim.Region.PhysicsModule.BulletS/OpenSim.Region.PhysicsModule.BulletS.csproj b/Source/OpenSim.Region.PhysicsModule.BulletS/OpenSim.Region.PhysicsModule.BulletS.csproj
index eb43d5b02a9..74cc9f125b8 100644
--- a/Source/OpenSim.Region.PhysicsModule.BulletS/OpenSim.Region.PhysicsModule.BulletS.csproj
+++ b/Source/OpenSim.Region.PhysicsModule.BulletS/OpenSim.Region.PhysicsModule.BulletS.csproj
@@ -31,7 +31,5 @@
-
-
diff --git a/Source/OpenSim.Region.PhysicsModule.Meshing/OpenSim.Region.PhysicsModule.Meshing.csproj b/Source/OpenSim.Region.PhysicsModule.Meshing/OpenSim.Region.PhysicsModule.Meshing.csproj
index 25937b11acf..df42b21e46d 100644
--- a/Source/OpenSim.Region.PhysicsModule.Meshing/OpenSim.Region.PhysicsModule.Meshing.csproj
+++ b/Source/OpenSim.Region.PhysicsModule.Meshing/OpenSim.Region.PhysicsModule.Meshing.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/Source/OpenSim.Region.PhysicsModule.SharedBase/NullPhysicsScene.cs b/Source/OpenSim.Region.PhysicsModule.SharedBase/NullPhysicsScene.cs
index 949b352c536..3b35b787fa3 100644
--- a/Source/OpenSim.Region.PhysicsModule.SharedBase/NullPhysicsScene.cs
+++ b/Source/OpenSim.Region.PhysicsModule.SharedBase/NullPhysicsScene.cs
@@ -27,7 +27,6 @@
using OpenSim.Framework;
using OpenMetaverse;
-using log4net.Core;
using Microsoft.Extensions.Logging;
namespace OpenSim.Region.PhysicsModule.SharedBase
diff --git a/Source/OpenSim.Region.PhysicsModule.SharedBase/OpenSim.Region.PhysicsModule.SharedBase.csproj b/Source/OpenSim.Region.PhysicsModule.SharedBase/OpenSim.Region.PhysicsModule.SharedBase.csproj
index ad2a121334a..7afb9f9d961 100644
--- a/Source/OpenSim.Region.PhysicsModule.SharedBase/OpenSim.Region.PhysicsModule.SharedBase.csproj
+++ b/Source/OpenSim.Region.PhysicsModule.SharedBase/OpenSim.Region.PhysicsModule.SharedBase.csproj
@@ -8,8 +8,6 @@
-
-
diff --git a/Source/OpenSim.Region.PhysicsModule.ubOdeMeshing/OpenSim.Region.PhysicsModule.ubOdeMeshing.csproj b/Source/OpenSim.Region.PhysicsModule.ubOdeMeshing/OpenSim.Region.PhysicsModule.ubOdeMeshing.csproj
index dd3c8c2b12e..834b0edaefa 100644
--- a/Source/OpenSim.Region.PhysicsModule.ubOdeMeshing/OpenSim.Region.PhysicsModule.ubOdeMeshing.csproj
+++ b/Source/OpenSim.Region.PhysicsModule.ubOdeMeshing/OpenSim.Region.PhysicsModule.ubOdeMeshing.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/Source/OpenSim.Region.ScriptEngine.Shared/OpenSim.Region.ScriptEngine.Shared.csproj b/Source/OpenSim.Region.ScriptEngine.Shared/OpenSim.Region.ScriptEngine.Shared.csproj
index 133dd5029ab..28eca379185 100644
--- a/Source/OpenSim.Region.ScriptEngine.Shared/OpenSim.Region.ScriptEngine.Shared.csproj
+++ b/Source/OpenSim.Region.ScriptEngine.Shared/OpenSim.Region.ScriptEngine.Shared.csproj
@@ -27,7 +27,6 @@
-
diff --git a/Source/OpenSim.Region.ScriptEngine.YEngine/OpenSim.Region.ScriptEngine.YEngine.csproj b/Source/OpenSim.Region.ScriptEngine.YEngine/OpenSim.Region.ScriptEngine.YEngine.csproj
index 951a200213d..a0ed42030f7 100644
--- a/Source/OpenSim.Region.ScriptEngine.YEngine/OpenSim.Region.ScriptEngine.YEngine.csproj
+++ b/Source/OpenSim.Region.ScriptEngine.YEngine/OpenSim.Region.ScriptEngine.YEngine.csproj
@@ -8,9 +8,7 @@
-
-
-
+
diff --git a/Source/OpenSim.Server.Base/ServerUtils.cs b/Source/OpenSim.Server.Base/ServerUtils.cs
index 5ebd986df78..b4bd40701d7 100644
--- a/Source/OpenSim.Server.Base/ServerUtils.cs
+++ b/Source/OpenSim.Server.Base/ServerUtils.cs
@@ -29,20 +29,13 @@
using System.Xml;
using System.Xml.Serialization;
using System.Text;
-using log4net;
using OpenSim.Framework;
using OpenMetaverse;
-using OpenSim.Framework.Servers.HttpServer;
-
-using Microsoft.Extensions.Configuration;
-using System.Net;
namespace OpenSim.Server.Base
{
public static class ServerUtils
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
public static byte[] SerializeResult(XmlSerializer xs, object data)
{
using (MemoryStream ms = new MemoryStream())
@@ -324,10 +317,10 @@ public static Dictionary ParseXmlResponse(string data)
if (!xr.ReadToFollowing("ServerResponse"))
return new Dictionary();
return ScanXmlResponse(xr);
- }
+ }
catch (Exception e)
{
- m_log.DebugFormat("[serverUtils.ParseXmlResponse]: failed error: {0}\n --string:\n{1}\n", e.Message, data);
+ //m_log.DebugFormat("[serverUtils.ParseXmlResponse]: failed error: {0}\n --string:\n{1}\n", e.Message, data);
}
return new Dictionary();
}
diff --git a/Source/OpenSim.Server.Common/OpenSim.Server.Common.csproj b/Source/OpenSim.Server.Common/OpenSim.Server.Common.csproj
index daa00d52cd7..c658e9467cd 100644
--- a/Source/OpenSim.Server.Common/OpenSim.Server.Common.csproj
+++ b/Source/OpenSim.Server.Common/OpenSim.Server.Common.csproj
@@ -12,7 +12,7 @@
-
+
diff --git a/Source/OpenSim.Server.MoneyServer/IMoneyDBService.cs b/Source/OpenSim.Server.MoneyServer/IMoneyDBService.cs
index 209cf7e59dc..ba36a5eeb37 100644
--- a/Source/OpenSim.Server.MoneyServer/IMoneyDBService.cs
+++ b/Source/OpenSim.Server.MoneyServer/IMoneyDBService.cs
@@ -41,7 +41,7 @@ public interface IMoneyDBService
bool giveMoney(UUID transactionID, string receiverID, int amount);
- bool addTransaction(TransactionData transaction);
+ bool addTransaction(MoneyTransactionData transaction);
bool addUser(string userID, int balance, int status, int type);
@@ -51,9 +51,9 @@ public interface IMoneyDBService
bool ValidateTransfer(string secureCode, UUID transactionID);
- TransactionData FetchTransaction(UUID transactionID);
+ MoneyTransactionData FetchTransaction(UUID transactionID);
- TransactionData FetchTransaction(string userID, int startTime, int endTime, int lastIndex);
+ MoneyTransactionData FetchTransaction(string userID, int startTime, int endTime, int lastIndex);
int getTransactionNum(string userID, int startTime, int endTime);
diff --git a/Source/OpenSim.Server.MoneyServer/MoneyDBService.cs b/Source/OpenSim.Server.MoneyServer/MoneyDBService.cs
index 1e4526566a4..aad7064f3dc 100644
--- a/Source/OpenSim.Server.MoneyServer/MoneyDBService.cs
+++ b/Source/OpenSim.Server.MoneyServer/MoneyDBService.cs
@@ -207,7 +207,7 @@ public bool giveMoney(UUID transactionID, string receiverID, int amount)
}
- public bool setTotalSale(TransactionData transaction)
+ public bool setTotalSale(MoneyTransactionData transaction)
{
if (transaction.Receiver == transaction.Sender) return false;
if (transaction.Sender == UUID.Zero.ToString()) return false;
@@ -236,7 +236,7 @@ public bool setTotalSale(TransactionData transaction)
}
- public bool addTransaction(TransactionData transaction)
+ public bool addTransaction(MoneyTransactionData transaction)
{
MySQLSuperManager dbm = GetLockedConnection();
@@ -264,7 +264,7 @@ public bool addTransaction(TransactionData transaction)
public bool addUser(string userID, int balance, int status, int type)
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction.TransUUID = UUID.Random();
transaction.Sender = UUID.Zero.ToString();
transaction.Receiver = userID;
@@ -389,7 +389,7 @@ public bool ValidateTransfer(string secureCode, UUID transactionID)
}
- public TransactionData FetchTransaction(UUID transactionID)
+ public MoneyTransactionData FetchTransaction(UUID transactionID)
{
MySQLSuperManager dbm = GetLockedConnection();
@@ -415,10 +415,10 @@ public TransactionData FetchTransaction(UUID transactionID)
}
- public TransactionData FetchTransaction(string userID, int startTime, int endTime, int lastIndex)
+ public MoneyTransactionData FetchTransaction(string userID, int startTime, int endTime, int lastIndex)
{
MySQLSuperManager dbm = GetLockedConnection();
- TransactionData[] arrTransaction;
+ MoneyTransactionData[] arrTransaction;
uint index = 0;
if (lastIndex >= 0) index = Convert.ToUInt32(lastIndex) + 1;
@@ -459,7 +459,7 @@ public bool DoTransfer(UUID transactionUUID)
{
bool do_trans = false;
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction = FetchTransaction(transactionUUID);
if (transaction != null && transaction.Status == (int)Status.PENDING_STATUS)
@@ -528,7 +528,7 @@ public bool DoTransfer(UUID transactionUUID)
// by Fumi.Iseki
public bool DoAddMoney(UUID transactionUUID)
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction = FetchTransaction(transactionUUID);
if (transaction != null && transaction.Status == (int)Status.PENDING_STATUS)
diff --git a/Source/OpenSim.Server.MoneyServer/MoneyXmlRpcModule.cs b/Source/OpenSim.Server.MoneyServer/MoneyXmlRpcModule.cs
index 18203bef3ed..b3c5f273e3e 100644
--- a/Source/OpenSim.Server.MoneyServer/MoneyXmlRpcModule.cs
+++ b/Source/OpenSim.Server.MoneyServer/MoneyXmlRpcModule.cs
@@ -627,7 +627,7 @@ public XmlRpcResponse handleTransaction(XmlRpcRequest request, IPEndPoint remote
int time = (int)((DateTime.UtcNow.Ticks - TicksToEpoch) / 10000000);
try
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction.TransUUID = transactionUUID;
transaction.Sender = senderID;
transaction.Receiver = receiverID;
@@ -768,7 +768,7 @@ public XmlRpcResponse handleForceTransaction(XmlRpcRequest request, IPEndPoint r
try
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction.TransUUID = transactionUUID;
transaction.Sender = senderID;
transaction.Receiver = receiverID;
@@ -909,7 +909,7 @@ public XmlRpcResponse handleScriptTransaction(XmlRpcRequest request, IPEndPoint
try
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction.TransUUID = transactionUUID;
transaction.Sender = senderID;
transaction.Receiver = receiverID;
@@ -1041,7 +1041,7 @@ public XmlRpcResponse handleAddBankerMoney(XmlRpcRequest request, IPEndPoint rem
try
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction.TransUUID = transactionUUID;
transaction.Sender = senderID;
transaction.Receiver = bankerID;
@@ -1159,7 +1159,7 @@ public XmlRpcResponse handlePayMoneyCharge(XmlRpcRequest request, IPEndPoint rem
int time = (int)((DateTime.UtcNow.Ticks - TicksToEpoch) / 10000000);
try
{
- TransactionData transaction = new TransactionData();
+ MoneyTransactionData transaction = new MoneyTransactionData();
transaction.TransUUID = transactionUUID;
transaction.Sender = senderID;
transaction.Receiver = receiverID;
@@ -1232,7 +1232,7 @@ public bool NotifyTransfer(UUID transactionUUID, string msg2sender, string msg2r
{
if (m_moneyDBService.DoTransfer(transactionUUID))
{
- TransactionData transaction = m_moneyDBService.FetchTransaction(transactionUUID);
+ MoneyTransactionData transaction = m_moneyDBService.FetchTransaction(transactionUUID);
if (transaction != null && transaction.Status == (int)Status.SUCCESS_STATUS)
{
_logger.LogInformation("[MONEY RPC]: NotifyTransfer: Transaction Type = {0}", transaction.Type);
@@ -1496,7 +1496,7 @@ private void UpdateBalance(string userID, string message)
///
///
///
- protected bool RollBackTransaction(TransactionData transaction)
+ protected bool RollBackTransaction(MoneyTransactionData transaction)
{
//m_logger.LogInformation("[MONEY RPC]: RollBackTransaction:");
@@ -1557,7 +1557,7 @@ public XmlRpcResponse handleCancelTransfer(XmlRpcRequest request, IPEndPoint rem
return response;
}
- TransactionData transaction = m_moneyDBService.FetchTransaction(transactionUUID);
+ MoneyTransactionData transaction = m_moneyDBService.FetchTransaction(transactionUUID);
UserInfo user = m_moneyDBService.FetchUserInfo(transaction.Sender);
try
@@ -1623,7 +1623,7 @@ public XmlRpcResponse handleGetTransaction(XmlRpcRequest request, IPEndPoint rem
try
{
- TransactionData transaction = m_moneyDBService.FetchTransaction(transactionUUID);
+ MoneyTransactionData transaction = m_moneyDBService.FetchTransaction(transactionUUID);
if (transaction != null)
{
responseData["success"] = true;
@@ -1854,7 +1854,7 @@ public XmlRpcResponse handleWebGetTransaction(XmlRpcRequest request, IPEndPoint
try
{
int total = m_moneyDBService.getTransactionNum(userID, startTime, endTime);
- TransactionData tran = null;
+ MoneyTransactionData tran = null;
_logger.LogInformation("[MONEY RPC]: handleWebGetTransaction: Getting transation[{0}] for user {1}", lastIndex + 1, userID);
if (total > lastIndex + 2)
{
diff --git a/Source/OpenSim.Server.MoneyServer/OpenSim.Server.MoneyServer.csproj b/Source/OpenSim.Server.MoneyServer/OpenSim.Server.MoneyServer.csproj
index b97ac39951c..8541e587da1 100644
--- a/Source/OpenSim.Server.MoneyServer/OpenSim.Server.MoneyServer.csproj
+++ b/Source/OpenSim.Server.MoneyServer/OpenSim.Server.MoneyServer.csproj
@@ -29,7 +29,6 @@
-
@@ -48,7 +47,7 @@
-
+
diff --git a/Source/OpenSim.Services.Interfaces/IAttachmentsService.cs b/Source/OpenSim.Services.Interfaces/IAttachmentsService.cs
index 7d3366289c4..71793e0111f 100644
--- a/Source/OpenSim.Services.Interfaces/IAttachmentsService.cs
+++ b/Source/OpenSim.Services.Interfaces/IAttachmentsService.cs
@@ -25,9 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using Nini.Config;
-
namespace OpenSim.Services.Interfaces
{
public interface IAttachmentsService
diff --git a/Source/OpenSim.Services.Interfaces/IBakedTextureService.cs b/Source/OpenSim.Services.Interfaces/IBakedTextureService.cs
index 50e0ed9a3da..49544255d92 100644
--- a/Source/OpenSim.Services.Interfaces/IBakedTextureService.cs
+++ b/Source/OpenSim.Services.Interfaces/IBakedTextureService.cs
@@ -25,9 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using Nini.Config;
-
namespace OpenSim.Services.Interfaces
{
public interface IBakedTextureService
diff --git a/Source/OpenSim.Services.Interfaces/IGridService.cs b/Source/OpenSim.Services.Interfaces/IGridService.cs
index 89828102018..5803faaffb4 100644
--- a/Source/OpenSim.Services.Interfaces/IGridService.cs
+++ b/Source/OpenSim.Services.Interfaces/IGridService.cs
@@ -25,18 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections;
-using System.Collections.Generic;
using System.Net;
-using System.Net.Sockets;
-using System.Reflection;
using OpenSim.Framework;
using OpenMetaverse;
-using log4net;
-
namespace OpenSim.Services.Interfaces
{
public interface IGridService
diff --git a/Source/OpenSim.Services.Interfaces/OpenProfileClient.cs b/Source/OpenSim.Services.Interfaces/OpenProfileClient.cs
index 8c4d14b8378..894570591a8 100644
--- a/Source/OpenSim.Services.Interfaces/OpenProfileClient.cs
+++ b/Source/OpenSim.Services.Interfaces/OpenProfileClient.cs
@@ -25,16 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
using System.Collections;
-using System.Collections.Generic;
-using System.Net;
-using System.Net.Sockets;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-using log4net;
+
using OpenMetaverse;
+
using OpenSim.Framework;
namespace OpenSim.Services.UserProfilesService
diff --git a/Source/OpenSim.Services/Connectors/AgentPreferences/AgentPreferencesConnector.cs b/Source/OpenSim.Services/Connectors/AgentPreferences/AgentPreferencesConnector.cs
index 692e651afdb..51757ac293f 100644
--- a/Source/OpenSim.Services/Connectors/AgentPreferences/AgentPreferencesConnector.cs
+++ b/Source/OpenSim.Services/Connectors/AgentPreferences/AgentPreferencesConnector.cs
@@ -25,28 +25,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using log4net;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Reflection;
-using Nini.Config;
using OpenSim.Framework;
-using OpenSim.Framework.ServiceAuth;
using OpenSim.Services.Interfaces;
-using GridRegion = OpenSim.Services.Interfaces.GridRegion;
-using IAvatarService = OpenSim.Services.Interfaces.IAvatarService;
using OpenSim.Server.Base;
using OpenMetaverse;
using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Services.Connectors
{
public class AgentPreferencesServicesConnector : BaseServiceConnector, IAgentPreferencesService
{
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
private string m_ServerURI = String.Empty;
+ private ILogger m_logger;
public AgentPreferencesServicesConnector()
{
@@ -57,9 +48,11 @@ public AgentPreferencesServicesConnector(string serverURI)
m_ServerURI = serverURI.TrimEnd('/');
}
- public AgentPreferencesServicesConnector(IConfiguration source)
+ public AgentPreferencesServicesConnector(IConfiguration source, ILogger logger)
: base(source, "AgentPreferencesService")
{
+ m_logger = logger;
+
Initialise(source);
}
@@ -68,7 +61,7 @@ public void Initialise(IConfiguration source)
var gridConfig = source.GetSection("AgentPreferencesService");
if (!gridConfig.Exists())
{
- m_log.Error("[AGENT PREFERENCES CONNECTOR]: AgentPreferencesService missing from OpenSim.ini");
+ m_logger.LogError("[AGENT PREFERENCES CONNECTOR]: AgentPreferencesService missing from OpenSim.ini");
throw new Exception("Agent Preferences connector init error");
}
@@ -76,7 +69,7 @@ public void Initialise(IConfiguration source)
if (string.IsNullOrEmpty(serviceURI))
{
- m_log.Error("[AGENT PREFERENCES CONNECTOR]: No Server URI named in section AgentPreferences");
+ m_logger.LogError("[AGENT PREFERENCES CONNECTOR]: No Server URI named in section AgentPreferences");
throw new Exception("Agent Preferences connector init error");
}
@@ -104,13 +97,13 @@ public AgentPrefs GetAgentPreferences(UUID principalID)
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
if (string.IsNullOrEmpty(reply))
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: GetAgentPreferences received null or empty reply");
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: GetAgentPreferences received null or empty reply");
return null;
}
}
catch (Exception e)
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: Exception when contacting agent preferences server at {0}: {1}", uri, e.Message);
+ m_logger.LogDebug(e, $"[AGENT PREFERENCES CONNECTOR]: Exception when contacting agent preferences server at {uri}");
}
Dictionary replyData = ServerUtils.ParseXmlResponse(reply);
@@ -119,15 +112,16 @@ public AgentPrefs GetAgentPreferences(UUID principalID)
if (replyData.ContainsKey("result") &&
(replyData["result"].ToString() == "null" || replyData["result"].ToString() == "Failure"))
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: GetAgentPreferences received Failure response");
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: GetAgentPreferences received Failure response");
return null;
}
}
else
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: GetAgentPreferences received null response");
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: GetAgentPreferences received null response");
return null;
}
+
AgentPrefs prefs = new AgentPrefs(replyData);
return prefs;
}
@@ -162,11 +156,13 @@ public bool StoreAgentPreferences(AgentPrefs data)
return false;
}
else
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences received empty reply");
+ {
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: StoreAgentPreferences received empty reply");
+ }
}
catch (Exception e)
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: Exception when contacting agent preferences server at {0}: {1}", uri, e.Message);
+ m_logger.LogDebug(e, $"[AGENT PREFERENCES CONNECTOR]: Exception when contacting agent preferences server at {uri}");
}
return false;
@@ -188,13 +184,13 @@ public string GetLang(UUID principalID)
reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
if (string.IsNullOrEmpty(reply))
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: GetLang received null or empty reply");
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: GetLang received null or empty reply");
return "en-us"; // I guess? Gotta return somethin'!
}
}
catch (Exception e)
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: Exception when contacting agent preferences server at {0}: {1}", uri, e.Message);
+ m_logger.LogDebug(e, $"[AGENT PREFERENCES CONNECTOR]: Exception when contacting agent preferences server at {uri}");
}
Dictionary replyData = ServerUtils.ParseXmlResponse(reply);
@@ -203,7 +199,7 @@ public string GetLang(UUID principalID)
if (replyData.ContainsKey("result") &&
(replyData["result"].ToString() == "null" || replyData["result"].ToString() == "Failure"))
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: GetLang received Failure response");
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: GetLang received Failure response");
return "en-us";
}
if (replyData.ContainsKey("Language"))
@@ -211,9 +207,10 @@ public string GetLang(UUID principalID)
}
else
{
- m_log.DebugFormat("[AGENT PREFERENCES CONNECTOR]: GetLang received null response");
+ m_logger.LogDebug($"[AGENT PREFERENCES CONNECTOR]: GetLang received null response");
}
+
return "en-us";
}
diff --git a/Source/OpenSim.Services/Connectors/Asset/AssetServicesConnector.cs b/Source/OpenSim.Services/Connectors/Asset/AssetServicesConnector.cs
index 7c752c6a72b..06e19b37aef 100644
--- a/Source/OpenSim.Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/Source/OpenSim.Services/Connectors/Asset/AssetServicesConnector.cs
@@ -25,30 +25,21 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using log4net;
-using System;
-using System.Threading;
-using System.Collections.Generic;
-using System.Collections.Concurrent;
-using System.IO;
using System.Reflection;
-using System.Timers;
-using Nini.Config;
using OpenSim.Framework;
-using OpenSim.Framework.Monitoring;
-using OpenSim.Framework.ServiceAuth;
using OpenSim.Services.Interfaces;
using OpenMetaverse;
using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
namespace OpenSim.Services.Connectors
{
public class AssetServicesConnector : BaseServiceConnector, IAssetService
- {
- private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
+ {
public readonly object ConnectorLock = new object();
+ private readonly ILogger _logger;
+
protected IAssetCache m_Cache = null;
private string m_ServerURI = string.Empty;
@@ -60,18 +51,16 @@ public class AssetServicesConnector : BaseServiceConnector, IAssetService
private Dictionary> m_AssetHandlers = new Dictionary>();
- public AssetServicesConnector()
- {
- }
-
public AssetServicesConnector(string serverURI)
{
OSHHTPHost tmp = new OSHHTPHost(serverURI, true);
m_ServerURI = tmp.IsResolvedHost ? tmp.URI : null;
}
- public AssetServicesConnector(IConfiguration source)
+ public AssetServicesConnector(IConfiguration source, ILogger logger)
{
+ _logger = logger;
+
Initialise(source);
}
@@ -82,7 +71,7 @@ public virtual void Initialise(IConfiguration source)
var assetConfig = source.GetSection("AssetService");
if (!assetConfig.Exists())
{
- m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
+ _logger.LogError("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
throw new Exception("Asset connector init error");
}
@@ -95,7 +84,7 @@ public virtual void Initialise(IConfiguration source)
if (string.IsNullOrEmpty(m_ServerURI))
{
- m_log.Error("[ASSET CONNECTOR]: AssetServerURI not defined in section AssetService");
+ _logger.LogError("[ASSET CONNECTOR]: AssetServerURI not defined in section AssetService");
throw new Exception("Asset connector init error");
}
diff --git a/Source/OpenSim.Services/MapImageService/MapImageService.cs b/Source/OpenSim.Services/MapImageService/MapImageService.cs
index e9637bf5691..ad3e2823f35 100644
--- a/Source/OpenSim.Services/MapImageService/MapImageService.cs
+++ b/Source/OpenSim.Services/MapImageService/MapImageService.cs
@@ -29,24 +29,13 @@
* https://github.com/openmetaversefoundation/simiangrid/
*/
-using System;
-using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
-using System.IO;
-using System.Net;
-using System.Reflection;
-using System.Threading;
-
-using Nini.Config;
-using log4net;
using OpenMetaverse;
using OpenSim.Framework;
-using OpenSim.Framework.Console;
using OpenSim.Services.Interfaces;
using Microsoft.Extensions.Configuration;
-using log4net.Core;
using Microsoft.Extensions.Logging;
diff --git a/Source/OpenSim.Services/OpenSim.Services.csproj b/Source/OpenSim.Services/OpenSim.Services.csproj
index 07e86bf375d..8409985f9d2 100644
--- a/Source/OpenSim.Services/OpenSim.Services.csproj
+++ b/Source/OpenSim.Services/OpenSim.Services.csproj
@@ -49,6 +49,7 @@
+
diff --git a/Source/OpenSim.Services/UserProfilesService/UserProfilesService.cs b/Source/OpenSim.Services/UserProfilesService/UserProfilesService.cs
index a437276e939..df8bff2c41d 100644
--- a/Source/OpenSim.Services/UserProfilesService/UserProfilesService.cs
+++ b/Source/OpenSim.Services/UserProfilesService/UserProfilesService.cs
@@ -29,7 +29,6 @@
using OpenSim.Framework;
using OpenSim.Data;
-using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenMetaverse;
@@ -37,7 +36,6 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
-using Nini.Config;
namespace OpenSim.Services.ProfilesService
{
diff --git a/Tests/OpenSim.Capabilities.Handlers.Tests/OpenSim.Capabilities.Handlers.Tests.csproj b/Tests/OpenSim.Capabilities.Handlers.Tests/OpenSim.Capabilities.Handlers.Tests.csproj
index 6f4a9ccdd83..2a33491742b 100644
--- a/Tests/OpenSim.Capabilities.Handlers.Tests/OpenSim.Capabilities.Handlers.Tests.csproj
+++ b/Tests/OpenSim.Capabilities.Handlers.Tests/OpenSim.Capabilities.Handlers.Tests.csproj
@@ -33,10 +33,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Clients.Assets.Tests/OpenSim.Tests.Clients.AssetClient.csproj b/Tests/OpenSim.Clients.Assets.Tests/OpenSim.Tests.Clients.AssetClient.csproj
index a19fb3d92e7..9a9ca721e8f 100644
--- a/Tests/OpenSim.Clients.Assets.Tests/OpenSim.Tests.Clients.AssetClient.csproj
+++ b/Tests/OpenSim.Clients.Assets.Tests/OpenSim.Tests.Clients.AssetClient.csproj
@@ -22,10 +22,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Data.Tests/OpenSim.Data.Tests.csproj b/Tests/OpenSim.Data.Tests/OpenSim.Data.Tests.csproj
index 68ce3f5b6f1..08a189e11a0 100644
--- a/Tests/OpenSim.Data.Tests/OpenSim.Data.Tests.csproj
+++ b/Tests/OpenSim.Data.Tests/OpenSim.Data.Tests.csproj
@@ -29,10 +29,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Framework.Serialization.Tests/OpenSim.Framework.Serialization.Tests.csproj b/Tests/OpenSim.Framework.Serialization.Tests/OpenSim.Framework.Serialization.Tests.csproj
index 0440e724b28..36462871ea6 100644
--- a/Tests/OpenSim.Framework.Serialization.Tests/OpenSim.Framework.Serialization.Tests.csproj
+++ b/Tests/OpenSim.Framework.Serialization.Tests/OpenSim.Framework.Serialization.Tests.csproj
@@ -28,10 +28,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Framework.Servers.Tests/OpenSim.Framework.Servers.Tests.csproj b/Tests/OpenSim.Framework.Servers.Tests/OpenSim.Framework.Servers.Tests.csproj
index 8bbf9b176b9..f83046226fe 100644
--- a/Tests/OpenSim.Framework.Servers.Tests/OpenSim.Framework.Servers.Tests.csproj
+++ b/Tests/OpenSim.Framework.Servers.Tests/OpenSim.Framework.Servers.Tests.csproj
@@ -15,10 +15,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Framework.Tests/AgentCircuitDataTest.cs b/Tests/OpenSim.Framework.Tests/AgentCircuitDataTest.cs
index ccec95bb1d5..0e25d189bd7 100644
--- a/Tests/OpenSim.Framework.Tests/AgentCircuitDataTest.cs
+++ b/Tests/OpenSim.Framework.Tests/AgentCircuitDataTest.cs
@@ -259,24 +259,24 @@ public void HistoricalAgentCircuitDataOSDConversion()
AgentCircuitData Agent2Data = new AgentCircuitData();
Agent2Data.UnpackAgentCircuitData(map2);
- Assert.True((Agent1Data.AgentID == Agent2Data.AgentID));
- Assert.True((Agent1Data.BaseFolder == Agent2Data.BaseFolder));
-
- Assert.True((Agent1Data.CapsPath == Agent2Data.CapsPath));
- Assert.True((Agent1Data.child == Agent2Data.child));
- Assert.True((Agent1Data.ChildrenCapSeeds.Count == Agent2Data.ChildrenCapSeeds.Count));
- Assert.True((Agent1Data.circuitcode == Agent2Data.circuitcode));
- Assert.True((Agent1Data.firstname == Agent2Data.firstname));
- Assert.True((Agent1Data.InventoryFolder == Agent2Data.InventoryFolder));
- Assert.True((Agent1Data.lastname == Agent2Data.lastname));
- Assert.True((Agent1Data.SecureSessionID == Agent2Data.SecureSessionID));
- Assert.True((Agent1Data.SessionID == Agent2Data.SessionID));
- Assert.True((Agent1Data.startpos == Agent2Data.startpos));
+ Assert.Equals(Agent1Data.AgentID, Agent2Data.AgentID);
+ Assert.Equals(Agent1Data.BaseFolder, Agent2Data.BaseFolder);
+
+ Assert.Equals(Agent1Data.CapsPath, Agent2Data.CapsPath);
+ Assert.Equals(Agent1Data.child, Agent2Data.child);
+ Assert.Equals(Agent1Data.ChildrenCapSeeds.Count, Agent2Data.ChildrenCapSeeds.Count);
+ Assert.Equals(Agent1Data.circuitcode, Agent2Data.circuitcode);
+ Assert.Equals(Agent1Data.firstname, Agent2Data.firstname);
+ Assert.Equals(Agent1Data.InventoryFolder, Agent2Data.InventoryFolder);
+ Assert.Equals(Agent1Data.lastname, Agent2Data.lastname);
+ Assert.Equals(Agent1Data.SecureSessionID, Agent2Data.SecureSessionID);
+ Assert.Equals(Agent1Data.SessionID, Agent2Data.SessionID);
+ Assert.Equals(Agent1Data.startpos, Agent2Data.startpos);
}
catch (LitJson.JsonException)
{
//intermittant litjson errors :P
- Assert.True(1 == 1);
+ Assert.Equals(1,1);
}
/*
Enable this once VisualParams go in the packing method
@@ -319,26 +319,26 @@ public void TestAgentCircuitDataOSDConversion()
{
//spurious litjson errors :P
map2 = map;
- Assert.True(1==1);
+ Assert.Equals(1,1);
return;
}
AgentCircuitData Agent2Data = new AgentCircuitData();
Agent2Data.UnpackAgentCircuitData(map2);
- Assert.True((Agent1Data.AgentID == Agent2Data.AgentID));
- Assert.True((Agent1Data.BaseFolder == Agent2Data.BaseFolder));
-
- Assert.True((Agent1Data.CapsPath == Agent2Data.CapsPath));
- Assert.True((Agent1Data.child == Agent2Data.child));
- Assert.True((Agent1Data.ChildrenCapSeeds.Count == Agent2Data.ChildrenCapSeeds.Count));
- Assert.True((Agent1Data.circuitcode == Agent2Data.circuitcode));
- Assert.True((Agent1Data.firstname == Agent2Data.firstname));
- Assert.True((Agent1Data.InventoryFolder == Agent2Data.InventoryFolder));
- Assert.True((Agent1Data.lastname == Agent2Data.lastname));
- Assert.True((Agent1Data.SecureSessionID == Agent2Data.SecureSessionID));
- Assert.True((Agent1Data.SessionID == Agent2Data.SessionID));
- Assert.True((Agent1Data.startpos == Agent2Data.startpos));
+ Assert.Equals(Agent1Data.AgentID, Agent2Data.AgentID);
+ Assert.Equals(Agent1Data.BaseFolder, Agent2Data.BaseFolder);
+
+ Assert.Equals(Agent1Data.CapsPath, Agent2Data.CapsPath);
+ Assert.Equals(Agent1Data.child, Agent2Data.child);
+ Assert.Equals(Agent1Data.ChildrenCapSeeds.Count, Agent2Data.ChildrenCapSeeds.Count);
+ Assert.Equals(Agent1Data.circuitcode, Agent2Data.circuitcode);
+ Assert.Equals(Agent1Data.firstname, Agent2Data.firstname);
+ Assert.Equals(Agent1Data.InventoryFolder, Agent2Data.InventoryFolder);
+ Assert.Equals(Agent1Data.lastname, Agent2Data.lastname);
+ Assert.Equals(Agent1Data.SecureSessionID, Agent2Data.SecureSessionID);
+ Assert.Equals(Agent1Data.SessionID, Agent2Data.SessionID);
+ Assert.Equals(Agent1Data.startpos, Agent2Data.startpos);
/*
Enable this once VisualParams go in the packing method
diff --git a/Tests/OpenSim.Framework.Tests/AgentCircuitManagerTests.cs b/Tests/OpenSim.Framework.Tests/AgentCircuitManagerTests.cs
index de627d33165..419173a8a11 100644
--- a/Tests/OpenSim.Framework.Tests/AgentCircuitManagerTests.cs
+++ b/Tests/OpenSim.Framework.Tests/AgentCircuitManagerTests.cs
@@ -113,19 +113,19 @@ public void AddAgentCircuitTest()
agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(circuitcode1);
- Assert.True((m_agentCircuitData1.AgentID == agent.AgentID));
- Assert.True((m_agentCircuitData1.BaseFolder == agent.BaseFolder));
-
- Assert.True((m_agentCircuitData1.CapsPath == agent.CapsPath));
- Assert.True((m_agentCircuitData1.child == agent.child));
- Assert.True((m_agentCircuitData1.ChildrenCapSeeds.Count == agent.ChildrenCapSeeds.Count));
- Assert.True((m_agentCircuitData1.circuitcode == agent.circuitcode));
- Assert.True((m_agentCircuitData1.firstname == agent.firstname));
- Assert.True((m_agentCircuitData1.InventoryFolder == agent.InventoryFolder));
- Assert.True((m_agentCircuitData1.lastname == agent.lastname));
- Assert.True((m_agentCircuitData1.SecureSessionID == agent.SecureSessionID));
- Assert.True((m_agentCircuitData1.SessionID == agent.SessionID));
- Assert.True((m_agentCircuitData1.startpos == agent.startpos));
+ Assert.That(m_agentCircuitData1.AgentID, Is.EqualTo(agent.AgentID));
+ Assert.That(m_agentCircuitData1.BaseFolder, Is.EqualTo(agent.BaseFolder));
+
+ Assert.That(m_agentCircuitData1.CapsPath, Is.EqualTo(agent.CapsPath));
+ Assert.That(m_agentCircuitData1.child, Is.EqualTo(agent.child));
+ Assert.That(m_agentCircuitData1.ChildrenCapSeeds, Is.EqualTo(agent.ChildrenCapSeeds));
+ Assert.That(m_agentCircuitData1.circuitcode, Is.EqualTo(agent.circuitcode));
+ Assert.That(m_agentCircuitData1.firstname, Is.EqualTo(agent.firstname));
+ Assert.That(m_agentCircuitData1.InventoryFolder, Is.EqualTo(agent.InventoryFolder));
+ Assert.That(m_agentCircuitData1.lastname, Is.EqualTo(agent.lastname));
+ Assert.That(m_agentCircuitData1.SecureSessionID, Is.EqualTo(agent.SecureSessionID));
+ Assert.That(m_agentCircuitData1.SessionID, Is.EqualTo(agent.SessionID));
+ Assert.That(m_agentCircuitData1.startpos, Is.EqualTo(agent.startpos));
}
///
@@ -135,12 +135,13 @@ public void AddAgentCircuitTest()
public void RemoveAgentCircuitTest()
{
AgentCircuitManager agentCircuitManager = new AgentCircuitManager();
+
agentCircuitManager.AddNewCircuit(circuitcode1, m_agentCircuitData1);
agentCircuitManager.AddNewCircuit(circuitcode2, m_agentCircuitData2);
agentCircuitManager.RemoveCircuit(circuitcode2);
AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(circuitcode2);
- Assert.True(agent == null);
+ Assert.That(agent, Is.EqualTo(null));
}
@@ -160,9 +161,9 @@ public void ChangeAgentCircuitCodeTest()
AgentCircuitData agent = agentCircuitManager.GetAgentCircuitData(393930);
AgentCircuitData agent2 = agentCircuitManager.GetAgentCircuitData(circuitcode1);
- Assert.True(agent != null);
- Assert.True(agent2 == null);
- Assert.True(result);
+ Assert.That(agent != null);
+ Assert.That(agent2 == null);
+ Assert.That(result);
}
@@ -180,25 +181,25 @@ public void ValidateLoginTest()
// should be authorized
AuthenticateResponse resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode1);
- Assert.True(resp.Authorised);
+ Assert.That(resp.Authorised);
//should not be authorized
resp = agentCircuitManager.AuthenticateSession(SessionId1, UUID.Random(), circuitcode1);
- Assert.True(!resp.Authorised);
+ Assert.That(!resp.Authorised);
resp = agentCircuitManager.AuthenticateSession(UUID.Random(), AgentId1, circuitcode1);
- Assert.True(!resp.Authorised);
+ Assert.That(!resp.Authorised);
resp = agentCircuitManager.AuthenticateSession(SessionId1, AgentId1, circuitcode2);
- Assert.True(!resp.Authorised);
+ Assert.That(!resp.Authorised);
resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId1, circuitcode2);
- Assert.True(!resp.Authorised);
+ Assert.That(!resp.Authorised);
agentCircuitManager.RemoveCircuit(circuitcode2);
resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId2, circuitcode2);
- Assert.True(!resp.Authorised);
+ Assert.That(!resp.Authorised);
}
}
}
diff --git a/Tests/OpenSim.Framework.Tests/AnimationTests.cs b/Tests/OpenSim.Framework.Tests/AnimationTests.cs
index 759120366ff..23e9cb764de 100644
--- a/Tests/OpenSim.Framework.Tests/AnimationTests.cs
+++ b/Tests/OpenSim.Framework.Tests/AnimationTests.cs
@@ -63,31 +63,31 @@ public void Dispose()
[Test]
public void AnimationOSDTest()
{
- Assert.True(anim1.AnimID==animUUID1 && anim1.ObjectID == objUUID1 && anim1.SequenceNum ==1, "The Animation Constructor didn't set the fields correctly");
+ Assert.That(anim1.AnimID==animUUID1 && anim1.ObjectID == objUUID1 && anim1.SequenceNum ==1, "The Animation Constructor didn't set the fields correctly");
OSD updateMessage = anim1.PackUpdateMessage();
- Assert.True(updateMessage is OSDMap, "Packed UpdateMessage isn't an OSDMap");
+ Assert.That(updateMessage is OSDMap, "Packed UpdateMessage isn't an OSDMap");
OSDMap updateMap = (OSDMap) updateMessage;
- Assert.True(updateMap.ContainsKey("animation"), "Packed Message doesn't contain an animation element");
- Assert.True(updateMap.ContainsKey("object_id"), "Packed Message doesn't contain an object_id element");
- Assert.True(updateMap.ContainsKey("seq_num"), "Packed Message doesn't contain a seq_num element");
- Assert.True(updateMap["animation"].AsUUID() == animUUID1);
- Assert.True(updateMap["object_id"].AsUUID() == objUUID1);
- Assert.True(updateMap["seq_num"].AsInteger() == 1);
+ Assert.That(updateMap.ContainsKey("animation"), "Packed Message doesn't contain an animation element");
+ Assert.That(updateMap.ContainsKey("object_id"), "Packed Message doesn't contain an object_id element");
+ Assert.That(updateMap.ContainsKey("seq_num"), "Packed Message doesn't contain a seq_num element");
+ Assert.That(updateMap["animation"].AsUUID() == animUUID1);
+ Assert.That(updateMap["object_id"].AsUUID() == objUUID1);
+ Assert.That(updateMap["seq_num"].AsInteger() == 1);
Animation anim3 = new Animation(updateMap);
- Assert.True(anim3.ObjectID == anim1.ObjectID && anim3.AnimID == anim1.AnimID && anim3.SequenceNum == anim1.SequenceNum, "OSDMap Constructor failed to set the properties correctly.");
+ Assert.That(anim3.ObjectID == anim1.ObjectID && anim3.AnimID == anim1.AnimID && anim3.SequenceNum == anim1.SequenceNum, "OSDMap Constructor failed to set the properties correctly.");
anim3.UnpackUpdateMessage(anim2.PackUpdateMessage());
- Assert.True(anim3.ObjectID == objUUID2 && anim3.AnimID == animUUID2 && anim3.SequenceNum == 1, "Animation.UnpackUpdateMessage failed to set the properties correctly.");
+ Assert.That(anim3.ObjectID == objUUID2 && anim3.AnimID == animUUID2 && anim3.SequenceNum == 1, "Animation.UnpackUpdateMessage failed to set the properties correctly.");
Animation anim4 = new Animation();
anim4.AnimID = anim2.AnimID;
anim4.ObjectID = anim2.ObjectID;
anim4.SequenceNum = anim2.SequenceNum;
- Assert.True(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly.");
+ Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly.");
}
}
}
\ No newline at end of file
diff --git a/Tests/OpenSim.Framework.Tests/AssetBaseTest.cs b/Tests/OpenSim.Framework.Tests/AssetBaseTest.cs
index 029af9cabb9..5fa885a3f75 100644
--- a/Tests/OpenSim.Framework.Tests/AssetBaseTest.cs
+++ b/Tests/OpenSim.Framework.Tests/AssetBaseTest.cs
@@ -69,7 +69,7 @@ private void CheckContainsReferences(AssetType assetType, bool expected)
{
AssetBase asset = new AssetBase(UUID.Zero, String.Empty, (sbyte)assetType, UUID.Zero.ToString());
bool actual = asset.ContainsReferences;
- Assert.True(expected == actual, $"Expected {assetType}.ContainsReferences to be {expected} but was {actual}.");
+ Assert.That(expected == actual, $"Expected {assetType}.ContainsReferences to be {expected} but was {actual}.");
}
}
}
diff --git a/Tests/OpenSim.Framework.Tests/CacheTests.cs b/Tests/OpenSim.Framework.Tests/CacheTests.cs
index f879c13aa36..043e3821226 100644
--- a/Tests/OpenSim.Framework.Tests/CacheTests.cs
+++ b/Tests/OpenSim.Framework.Tests/CacheTests.cs
@@ -62,8 +62,8 @@ public void TestRetreive()
{
CacheItemBase citem = (CacheItemBase)cache.Get(cacheItemUUID.ToString());
byte[] data = (byte[]) citem.Retrieve();
- Assert.True(data.Length == 1, "Cached Item should have one byte element");
- Assert.True(data[0] == 255, "Cached Item element should be 255");
+ Assert.That(data.Length == 1, "Cached Item should have one byte element");
+ Assert.That(data[0] == 255, "Cached Item element should be 255");
}
[Test]
@@ -75,7 +75,7 @@ public void TestNotInCache()
randomNotIn = UUID.Random();
}
object citem = cache.Get(randomNotIn.ToString());
- Assert.True(citem == null, "Item should not be in Cache");
+ Assert.That(citem == null, "Item should not be in Cache");
}
@@ -91,7 +91,7 @@ public void ExpireItemManually()
cache.Invalidate(cacheItemUUID.ToString());
cache.Get(cacheItemUUID.ToString());
object citem = cache.Get(cacheItemUUID.ToString());
- Assert.True(citem == null, "Item should not be in Cache because we manually invalidated it");
+ Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
}
[Test]
@@ -106,7 +106,7 @@ public void ClearCacheTest()
cache.Clear();
object citem = cache.Get(cacheItemUUID.ToString());
- Assert.True(citem == null, "Item should not be in Cache because we manually invalidated it");
+ Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it");
}
[Test]
@@ -121,10 +121,10 @@ public void CacheItemMundane()
cb1.Store(data);
- Assert.True(cb1.Equals(cb3), "cb1 should equal cb3, their uuids are the same");
- Assert.True(!cb2.Equals(cb1), "cb2 should not equal cb1, their uuids are NOT the same");
- Assert.True(cb1.IsLocked() == false, "CacheItemBase default is false");
- Assert.True(cb1.Retrieve() == null, "Virtual Retrieve method should return null");
+ Assert.That(cb1.Equals(cb3), "cb1 should equal cb3, their uuids are the same");
+ Assert.That(!cb2.Equals(cb1), "cb2 should not equal cb1, their uuids are NOT the same");
+ Assert.That(cb1.IsLocked() == false, "CacheItemBase default is false");
+ Assert.That(cb1.Retrieve() == null, "Virtual Retrieve method should return null");
}
}
}
diff --git a/Tests/OpenSim.Framework.Tests/LocationTest.cs b/Tests/OpenSim.Framework.Tests/LocationTest.cs
index b8e6632967e..9ba52468245 100644
--- a/Tests/OpenSim.Framework.Tests/LocationTest.cs
+++ b/Tests/OpenSim.Framework.Tests/LocationTest.cs
@@ -37,11 +37,11 @@ public void locationRegionHandleRegionHandle()
// 256000
Location TestLocation1 = new Location(1099511628032000);
Location TestLocation2 = new Location(1099511628032000);
- Assert.True(TestLocation1 == TestLocation2);
+ Assert.That(TestLocation1 == TestLocation2);
TestLocation1 = new Location(1099511628032001);
TestLocation2 = new Location(1099511628032000);
- Assert.True(TestLocation1 != TestLocation2);
+ Assert.That(TestLocation1 != TestLocation2);
}
[Test]
@@ -49,36 +49,36 @@ public void locationXYRegionHandle()
{
Location TestLocation1 = new Location(255000,256000);
Location TestLocation2 = new Location(1095216660736000);
- Assert.True(TestLocation1 == TestLocation2);
+ Assert.That(TestLocation1 == TestLocation2);
- Assert.True(TestLocation1.X == 255000 && TestLocation1.Y == 256000, "Test xy location doesn't match position in the constructor");
- Assert.True(TestLocation2.X == 255000 && TestLocation2.Y == 256000, "Test xy location doesn't match regionhandle provided");
+ Assert.That(TestLocation1.X == 255000 && TestLocation1.Y == 256000, "Test xy location doesn't match position in the constructor");
+ Assert.That(TestLocation2.X == 255000 && TestLocation2.Y == 256000, "Test xy location doesn't match regionhandle provided");
- Assert.True(TestLocation2.RegionHandle == 1095216660736000,
+ Assert.That(TestLocation2.RegionHandle == 1095216660736000,
"Location RegionHandle Property didn't match regionhandle provided in constructor");
ulong RegionHandle = TestLocation1.RegionHandle;
- Assert.True(RegionHandle.Equals(1095216660736000), "Equals(regionhandle) failed to match the position in the constructor");
+ Assert.That(RegionHandle.Equals(1095216660736000), "Equals(regionhandle) failed to match the position in the constructor");
TestLocation2 = new Location(RegionHandle);
- Assert.True(TestLocation2.Equals(255000, 256000), "Decoded regionhandle failed to match the original position in the constructor");
+ Assert.That(TestLocation2.Equals(255000, 256000), "Decoded regionhandle failed to match the original position in the constructor");
TestLocation1 = new Location(255001, 256001);
TestLocation2 = new Location(1095216660736000);
- Assert.True(TestLocation1 != TestLocation2);
+ Assert.That(TestLocation1 != TestLocation2);
- Assert.True(TestLocation1.Equals(255001, 256001), "Equals(x,y) failed to match the position in the constructor");
+ Assert.That(TestLocation1.Equals(255001, 256001), "Equals(x,y) failed to match the position in the constructor");
- Assert.True(TestLocation2.GetHashCode() == (TestLocation2.X.GetHashCode() ^ TestLocation2.Y.GetHashCode()), "GetHashCode failed to produce the expected hashcode");
+ Assert.That(TestLocation2.GetHashCode() == (TestLocation2.X.GetHashCode() ^ TestLocation2.Y.GetHashCode()), "GetHashCode failed to produce the expected hashcode");
Location TestLocation3;
object cln = TestLocation2.Clone();
TestLocation3 = (Location) cln;
- Assert.True(TestLocation3.X == TestLocation2.X && TestLocation3.Y == TestLocation2.Y,
+ Assert.That(TestLocation3.X == TestLocation2.X && TestLocation3.Y == TestLocation2.Y,
"Cloned Location values do not match");
- Assert.True(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test");
+ Assert.That(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test");
}
}
diff --git a/Tests/OpenSim.Framework.Tests/MundaneFrameworkTests.cs b/Tests/OpenSim.Framework.Tests/MundaneFrameworkTests.cs
index dddc7023928..d35e10f4337 100644
--- a/Tests/OpenSim.Framework.Tests/MundaneFrameworkTests.cs
+++ b/Tests/OpenSim.Framework.Tests/MundaneFrameworkTests.cs
@@ -39,7 +39,7 @@ public void ChildAgentDataUpdate01()
{
// code coverage
ChildAgentDataUpdate cadu = new ChildAgentDataUpdate();
- Assert.False(cadu.alwaysrun, "Default is false");
+ Assert.That(cadu.alwaysrun is false, "Default is false");
}
[Test]
@@ -93,7 +93,7 @@ public void AgentPositionTest01()
AgentPosition position2 = new AgentPosition();
position2.CopyFrom(cadu, position1.SessionID);
- Assert.True(
+ Assert.That(
position2.AgentID == position1.AgentID
&& position2.Size == position1.Size
&& position2.Position == position1.Position
@@ -105,22 +105,22 @@ public void AgentPositionTest01()
position2 = new AgentPosition();
- Assert.False(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition");
+ Assert.That((position2.AgentID == position1.AgentID) is false, "Test Error, position2 should be a blank uninitialized AgentPosition");
EntityTransferContext ctx = new EntityTransferContext();
position2.Unpack(position1.Pack(ctx), null, ctx);
- Assert.True(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed");
- Assert.True(position2.Position == position1.Position, "Position didn't unpack the same way it packed");
- Assert.True(position2.Velocity == position1.Velocity, "Velocity didn't unpack the same way it packed");
- Assert.True(position2.SessionID == position1.SessionID, "SessionID didn't unpack the same way it packed");
- Assert.True(position2.CircuitCode == position1.CircuitCode, "CircuitCode didn't unpack the same way it packed");
- Assert.True(position2.LeftAxis == position1.LeftAxis, "LeftAxis didn't unpack the same way it packed");
- Assert.True(position2.UpAxis == position1.UpAxis, "UpAxis didn't unpack the same way it packed");
- Assert.True(position2.AtAxis == position1.AtAxis, "AtAxis didn't unpack the same way it packed");
- Assert.True(position2.RegionHandle == position1.RegionHandle, "RegionHandle didn't unpack the same way it packed");
- Assert.True(position2.ChangedGrid == position1.ChangedGrid, "ChangedGrid didn't unpack the same way it packed");
- Assert.True(position2.Center == position1.Center, "Center didn't unpack the same way it packed");
- Assert.True(position2.Size == position1.Size, "Size didn't unpack the same way it packed");
+ Assert.That(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed");
+ Assert.That(position2.Position == position1.Position, "Position didn't unpack the same way it packed");
+ Assert.That(position2.Velocity == position1.Velocity, "Velocity didn't unpack the same way it packed");
+ Assert.That(position2.SessionID == position1.SessionID, "SessionID didn't unpack the same way it packed");
+ Assert.That(position2.CircuitCode == position1.CircuitCode, "CircuitCode didn't unpack the same way it packed");
+ Assert.That(position2.LeftAxis == position1.LeftAxis, "LeftAxis didn't unpack the same way it packed");
+ Assert.That(position2.UpAxis == position1.UpAxis, "UpAxis didn't unpack the same way it packed");
+ Assert.That(position2.AtAxis == position1.AtAxis, "AtAxis didn't unpack the same way it packed");
+ Assert.That(position2.RegionHandle == position1.RegionHandle, "RegionHandle didn't unpack the same way it packed");
+ Assert.That(position2.ChangedGrid == position1.ChangedGrid, "ChangedGrid didn't unpack the same way it packed");
+ Assert.That(position2.Center == position1.Center, "Center didn't unpack the same way it packed");
+ Assert.That(position2.Size == position1.Size, "Size didn't unpack the same way it packed");
}
[Test]
@@ -136,7 +136,7 @@ public void RegionSettingsTest01()
// string id = settings.LoadedCreationID;
// string time = settings.LoadedCreationTime;
- Assert.True(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire");
+ Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire");
}
@@ -149,19 +149,19 @@ internal void RegionSaveFired(RegionSettings settings)
public void InventoryItemBaseConstructorTest01()
{
InventoryItemBase b1 = new InventoryItemBase();
- Assert.True(b1.ID == UUID.Zero, "void constructor should create an inventory item with ID = UUID.Zero");
- Assert.True(b1.Owner == UUID.Zero, "void constructor should create an inventory item with Owner = UUID.Zero");
+ Assert.That(b1.ID == UUID.Zero, "void constructor should create an inventory item with ID = UUID.Zero");
+ Assert.That(b1.Owner == UUID.Zero, "void constructor should create an inventory item with Owner = UUID.Zero");
UUID ItemID = UUID.Random();
UUID OwnerID = UUID.Random();
InventoryItemBase b2 = new InventoryItemBase(ItemID);
- Assert.True(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID");
- Assert.True(b2.Owner == UUID.Zero, "ID constructor should create an inventory item with Owner = UUID.Zero");
+ Assert.That(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID");
+ Assert.That(b2.Owner == UUID.Zero, "ID constructor should create an inventory item with Owner = UUID.Zero");
InventoryItemBase b3 = new InventoryItemBase(ItemID,OwnerID);
- Assert.True(b3.ID == ItemID, "ID,OwnerID constructor should create an inventory item with ID = ItemID");
- Assert.True(b3.Owner == OwnerID, "ID,OwnerID constructor should create an inventory item with Owner = OwnerID");
+ Assert.That(b3.ID == ItemID, "ID,OwnerID constructor should create an inventory item with ID = ItemID");
+ Assert.That(b3.Owner == OwnerID, "ID,OwnerID constructor should create an inventory item with Owner = OwnerID");
}
@@ -170,11 +170,11 @@ public void AssetMetaDataNonNullContentTypeTest01()
{
AssetMetadata assetMetadata = new AssetMetadata();
assetMetadata.ContentType = "image/jp2";
- Assert.True(assetMetadata.Type == (sbyte)AssetType.Texture, "Content type should be AssetType.Texture");
- Assert.True(assetMetadata.ContentType == "image/jp2", "Text of content type should be image/jp2");
+ Assert.That(assetMetadata.Type == (sbyte)AssetType.Texture, "Content type should be AssetType.Texture");
+ Assert.That(assetMetadata.ContentType == "image/jp2", "Text of content type should be image/jp2");
UUID rndID = UUID.Random();
assetMetadata.ID = rndID.ToString();
- Assert.True(assetMetadata.ID.ToLower() == rndID.ToString().ToLower(), "assetMetadata.ID Setter/Getter not Consistent");
+ Assert.That(assetMetadata.ID.ToLower() == rndID.ToString().ToLower(), "assetMetadata.ID Setter/Getter not Consistent");
DateTime fixedTime = DateTime.Now;
assetMetadata.CreationDate = fixedTime;
}
@@ -191,39 +191,39 @@ public void EstateSettingsMundateTests()
BannedHostNameMask = string.Empty,
BannedUserID = bannedUserId}
);
- Assert.True(es.IsBanned(bannedUserId, 32), "User Should be banned but is not.");
- Assert.False(es.IsBanned(UUID.Zero, 32), "User Should not be banned but is.");
+ Assert.That(es.IsBanned(bannedUserId, 32), "User Should be banned but is not.");
+ Assert.That(es.IsBanned(UUID.Zero, 32) is false, "User Should not be banned but is.");
es.RemoveBan(bannedUserId);
- Assert.False(es.IsBanned(bannedUserId, 32), "User Should not be banned but is.");
+ Assert.That(es.IsBanned(bannedUserId, 32) is false, "User Should not be banned but is.");
es.AddEstateManager(UUID.Zero);
es.AddEstateManager(bannedUserId);
- Assert.True(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserId should be EstateManager but isn't.");
+ Assert.That(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserId should be EstateManager but isn't.");
es.RemoveEstateManager(bannedUserId);
- Assert.False(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserID is estateManager but shouldn't be");
+ Assert.That(es.IsEstateManagerOrOwner(bannedUserId) is false, "bannedUserID is estateManager but shouldn't be");
- Assert.False(es.HasAccess(bannedUserId), "bannedUserID has access but shouldn't");
+ Assert.That(es.HasAccess(bannedUserId) is false, "bannedUserID has access but shouldn't");
es.AddEstateUser(bannedUserId);
- Assert.True(es.HasAccess(bannedUserId), "bannedUserID doesn't have access but should");
+ Assert.That(es.HasAccess(bannedUserId), "bannedUserID doesn't have access but should");
es.RemoveEstateUser(bannedUserId);
es.AddEstateManager(bannedUserId);
- Assert.True(es.HasAccess(bannedUserId), "bannedUserID doesn't have access but should");
+ Assert.That(es.HasAccess(bannedUserId), "bannedUserID doesn't have access but should");
- Assert.True(es.EstateGroups.Length == 0, "No Estate Groups Added.. so the array should be 0 length");
+ Assert.That(es.EstateGroups.Length == 0, "No Estate Groups Added.. so the array should be 0 length");
es.AddEstateGroup(bannedUserId);
- Assert.True(es.EstateGroups.Length == 1, "1 Estate Groups Added.. so the array should be 1 length");
+ Assert.That(es.EstateGroups.Length == 1, "1 Estate Groups Added.. so the array should be 1 length");
- Assert.True(es.EstateGroups[0] == bannedUserId,"User ID should be in EstateGroups");
+ Assert.That(es.EstateGroups[0] == bannedUserId,"User ID should be in EstateGroups");
}
@@ -234,30 +234,30 @@ public void InventoryFolderBaseConstructorTest01()
UUID uuid2 = UUID.Random();
InventoryFolderBase fld = new InventoryFolderBase(uuid1);
- Assert.True(fld.ID == uuid1, "ID constructor failed to save value in ID field.");
+ Assert.That(fld.ID == uuid1, "ID constructor failed to save value in ID field.");
fld = new InventoryFolderBase(uuid1, uuid2);
- Assert.True(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field.");
- Assert.True(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field.");
+ Assert.That(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field.");
+ Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field.");
}
[Test]
public void AsssetBaseConstructorTest01()
{
AssetBase abase = new AssetBase();
- Assert.True(abase.Metadata != null, "void constructor of AssetBase should have created a MetaData element but didn't.");
+ Assert.That(abase.Metadata != null, "void constructor of AssetBase should have created a MetaData element but didn't.");
UUID itemID = UUID.Random();
UUID creatorID = UUID.Random();
abase = new AssetBase(itemID.ToString(), "test item", (sbyte) AssetType.Texture, creatorID.ToString());
- Assert.True(abase.Metadata != null, "string,string,sbyte,string constructor of AssetBase should have created a MetaData element but didn't.");
- Assert.True(abase.ID == itemID.ToString(), "string,string,sbyte,string constructor failed to set ID property");
- Assert.True(abase.Metadata.CreatorID == creatorID.ToString(), "string,string,sbyte,string constructor failed to set Creator ID");
+ Assert.That(abase.Metadata != null, "string,string,sbyte,string constructor of AssetBase should have created a MetaData element but didn't.");
+ Assert.That(abase.ID == itemID.ToString(), "string,string,sbyte,string constructor failed to set ID property");
+ Assert.That(abase.Metadata.CreatorID == creatorID.ToString(), "string,string,sbyte,string constructor failed to set Creator ID");
abase = new AssetBase(itemID.ToString(), "test item", -1, creatorID.ToString());
- Assert.True(abase.Metadata != null, "string,string,sbyte,string constructor of AssetBase with unknown type should have created a MetaData element but didn't.");
- Assert.True(abase.Metadata.Type == -1, "Unknown Type passed to string,string,sbyte,string constructor and was a known type when it came out again");
+ Assert.That(abase.Metadata != null, "string,string,sbyte,string constructor of AssetBase with unknown type should have created a MetaData element but didn't.");
+ Assert.That(abase.Metadata.Type == -1, "Unknown Type passed to string,string,sbyte,string constructor and was a known type when it came out again");
AssetMetadata metts = new AssetMetadata();
metts.FullID = itemID;
@@ -265,8 +265,8 @@ public void AsssetBaseConstructorTest01()
metts.Name = "test item";
abase.Metadata = metts;
- Assert.True(abase.ToString() == itemID.ToString(), "ToString is overriden to be fullID.ToString()");
- Assert.True(abase.ID == itemID.ToString(),"ID should be MetaData.FullID.ToString() when string.empty or null is provided to the ID property");
+ Assert.That(abase.ToString() == itemID.ToString(), "ToString is overriden to be fullID.ToString()");
+ Assert.That(abase.ID == itemID.ToString(),"ID should be MetaData.FullID.ToString() when string.empty or null is provided to the ID property");
}
[Test]
@@ -274,7 +274,7 @@ public void CultureSetCultureTest01()
{
CultureInfo ci = new CultureInfo("en-US", false);
Culture.SetCurrentCulture();
- Assert.True(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US");
+ Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US");
}
}
diff --git a/Tests/OpenSim.Framework.Tests/OpenSim.Framework.Tests.csproj b/Tests/OpenSim.Framework.Tests/OpenSim.Framework.Tests.csproj
index 3b39bb5bbb7..30a35078fe4 100644
--- a/Tests/OpenSim.Framework.Tests/OpenSim.Framework.Tests.csproj
+++ b/Tests/OpenSim.Framework.Tests/OpenSim.Framework.Tests.csproj
@@ -28,10 +28,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Framework.Tests/PrimeNumberHelperTests.cs b/Tests/OpenSim.Framework.Tests/PrimeNumberHelperTests.cs
index 7907a4a8f86..d199bc7cd67 100644
--- a/Tests/OpenSim.Framework.Tests/PrimeNumberHelperTests.cs
+++ b/Tests/OpenSim.Framework.Tests/PrimeNumberHelperTests.cs
@@ -33,11 +33,11 @@ public class PrimeNumberHelperTests
public void TestGetPrime()
{
int prime1 = PrimeNumberHelper.GetPrime(7919);
- Assert.True(prime1 == 8419, "Prime Number Get Prime Failed, 7919 is prime");
- Assert.True(PrimeNumberHelper.IsPrime(prime1),"Prime1 should be prime");
- Assert.True(PrimeNumberHelper.IsPrime(7919), "7919 is prime but is falsely failing the prime test");
+ Assert.That(prime1 == 8419, "Prime Number Get Prime Failed, 7919 is prime");
+ Assert.That(PrimeNumberHelper.IsPrime(prime1),"Prime1 should be prime");
+ Assert.That(PrimeNumberHelper.IsPrime(7919), "7919 is prime but is falsely failing the prime test");
prime1 = PrimeNumberHelper.GetPrime(Int32.MaxValue - 1);
- Assert.True(prime1 == -1, "prime1 should have been -1 since there are no primes between Int32.MaxValue-1 and Int32.MaxValue");
+ Assert.That(prime1 == -1, "prime1 should have been -1 since there are no primes between Int32.MaxValue-1 and Int32.MaxValue");
}
@@ -113,7 +113,7 @@ public void Test1000SmallPrimeNumbers()
};
for (int i = 0; i < primes.Length; i++)
{
- Assert.True(PrimeNumberHelper.IsPrime(primes[i]),primes[i] + " is prime but is erroniously failing the prime test");
+ Assert.That(PrimeNumberHelper.IsPrime(primes[i]),primes[i] + " is prime but is erroniously failing the prime test");
}
int[] nonprimes = {
@@ -126,10 +126,10 @@ public void Test1000SmallPrimeNumbers()
};
for (int i = 0; i < nonprimes.Length; i++)
{
- Assert.True(!PrimeNumberHelper.IsPrime(nonprimes[i]), nonprimes[i] + " is not prime but is erroniously passing the prime test");
+ Assert.That(!PrimeNumberHelper.IsPrime(nonprimes[i]), nonprimes[i] + " is not prime but is erroniously passing the prime test");
}
- Assert.True(PrimeNumberHelper.IsPrime(3));
+ Assert.That(PrimeNumberHelper.IsPrime(3));
}
}
}
\ No newline at end of file
diff --git a/Tests/OpenSim.Framework.Tests/UtilTest.cs b/Tests/OpenSim.Framework.Tests/UtilTest.cs
index 941de9b32aa..34d62beb823 100644
--- a/Tests/OpenSim.Framework.Tests/UtilTest.cs
+++ b/Tests/OpenSim.Framework.Tests/UtilTest.cs
@@ -138,15 +138,15 @@ public class UtilTests
[Test]
public void UUIDTests()
{
- Assert.True(Util.isUUID("01234567-89ab-Cdef-0123-456789AbCdEf"),
+ Assert.That(Util.isUUID("01234567-89ab-Cdef-0123-456789AbCdEf") is true,
"A correct UUID wasn't recognized.");
- Assert.False(Util.isUUID("FOOBAR67-89ab-Cdef-0123-456789AbCdEf"),
+ Assert.That(Util.isUUID("FOOBAR67-89ab-Cdef-0123-456789AbCdEf") is false,
"UUIDs with non-hex characters are recognized as correct UUIDs.");
- Assert.False(Util.isUUID("01234567"),
+ Assert.That(Util.isUUID("01234567") is false,
"Too short UUIDs are recognized as correct UUIDs.");
- Assert.False(Util.isUUID("01234567-89ab-Cdef-0123-456789AbCdEf0"),
+ Assert.That(Util.isUUID("01234567-89ab-Cdef-0123-456789AbCdEf0") is false,
"Too long UUIDs are recognized as correct UUIDs.");
- Assert.False(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf"),
+ Assert.That(Util.isUUID("01234567-89ab-Cdef-0123+456789AbCdEf") is false,
"UUIDs with wrong format are recognized as correct UUIDs.");
}
@@ -157,8 +157,8 @@ public void GetHashGuidTests()
string string2 = "This is another";
// Two consecutive runs should equal the same
- Assert.AreEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret1"));
- Assert.AreEqual(Util.GetHashGuid(string2, "secret1"), Util.GetHashGuid(string2, "secret1"));
+ Assert.That(Util.GetHashGuid(string1, "secret1"), Is.EqualTo(Util.GetHashGuid(string1, "secret1")));
+ Assert.That(Util.GetHashGuid(string2, "secret1"), Is.EqualTo(Util.GetHashGuid(string2, "secret1")));
// Varying data should not eqal the same
Assert.That(Util.GetHashGuid(string2, "secret1"), Is.Not.EqualTo(Util.GetHashGuid(string1, "secret1")));
@@ -198,7 +198,7 @@ public void SLUtilTypeConvertTests()
for (int i=0;i
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Permissions.Tests/OpenSim.Tests.Permissions.csproj b/Tests/OpenSim.Permissions.Tests/OpenSim.Tests.Permissions.csproj
index 2eacf2224dd..e50e201115e 100644
--- a/Tests/OpenSim.Permissions.Tests/OpenSim.Tests.Permissions.csproj
+++ b/Tests/OpenSim.Permissions.Tests/OpenSim.Tests.Permissions.csproj
@@ -25,10 +25,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Region.ClientStack.LindenCaps.Tests/OpenSim.Region.ClientStack.LindenCaps.Tests.csproj b/Tests/OpenSim.Region.ClientStack.LindenCaps.Tests/OpenSim.Region.ClientStack.LindenCaps.Tests.csproj
index e1a94725bf7..ff45cf51ecc 100644
--- a/Tests/OpenSim.Region.ClientStack.LindenCaps.Tests/OpenSim.Region.ClientStack.LindenCaps.Tests.csproj
+++ b/Tests/OpenSim.Region.ClientStack.LindenCaps.Tests/OpenSim.Region.ClientStack.LindenCaps.Tests.csproj
@@ -36,10 +36,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Region.ClientStack.LindenUDP.Tests/OpenSim.Region.ClientStack.LindenUDP.Tests.csproj b/Tests/OpenSim.Region.ClientStack.LindenUDP.Tests/OpenSim.Region.ClientStack.LindenUDP.Tests.csproj
index d8b89971d95..ed1fe0a67d0 100644
--- a/Tests/OpenSim.Region.ClientStack.LindenUDP.Tests/OpenSim.Region.ClientStack.LindenUDP.Tests.csproj
+++ b/Tests/OpenSim.Region.ClientStack.LindenUDP.Tests/OpenSim.Region.ClientStack.LindenUDP.Tests.csproj
@@ -29,10 +29,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Region.CoreModules.Tests/OpenSim.Region.CoreModules.Tests.csproj b/Tests/OpenSim.Region.CoreModules.Tests/OpenSim.Region.CoreModules.Tests.csproj
index e82835b27d5..79477a809ae 100644
--- a/Tests/OpenSim.Region.CoreModules.Tests/OpenSim.Region.CoreModules.Tests.csproj
+++ b/Tests/OpenSim.Region.CoreModules.Tests/OpenSim.Region.CoreModules.Tests.csproj
@@ -45,10 +45,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Region.Framework.Tests/OpenSim.Region.Framework.Tests.csproj b/Tests/OpenSim.Region.Framework.Tests/OpenSim.Region.Framework.Tests.csproj
index 1f46e6047be..ef3265347e7 100644
--- a/Tests/OpenSim.Region.Framework.Tests/OpenSim.Region.Framework.Tests.csproj
+++ b/Tests/OpenSim.Region.Framework.Tests/OpenSim.Region.Framework.Tests.csproj
@@ -39,10 +39,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Region.PhysicsModules.BulletS.Tests/OpenSim.Region.PhysicsModule.BulletS.Tests.csproj b/Tests/OpenSim.Region.PhysicsModules.BulletS.Tests/OpenSim.Region.PhysicsModule.BulletS.Tests.csproj
index f6f56e2b478..a2b7b2d97fe 100644
--- a/Tests/OpenSim.Region.PhysicsModules.BulletS.Tests/OpenSim.Region.PhysicsModule.BulletS.Tests.csproj
+++ b/Tests/OpenSim.Region.PhysicsModules.BulletS.Tests/OpenSim.Region.PhysicsModule.BulletS.Tests.csproj
@@ -25,10 +25,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Region.ScriptEngine.Tests/OpenSim.Region.ScriptEngine.Tests.csproj b/Tests/OpenSim.Region.ScriptEngine.Tests/OpenSim.Region.ScriptEngine.Tests.csproj
index bdbe5388eff..b6c2e0c2e2c 100644
--- a/Tests/OpenSim.Region.ScriptEngine.Tests/OpenSim.Region.ScriptEngine.Tests.csproj
+++ b/Tests/OpenSim.Region.ScriptEngine.Tests/OpenSim.Region.ScriptEngine.Tests.csproj
@@ -34,10 +34,16 @@
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
-
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Robust.Tests/Robust.Tests.csproj b/Tests/OpenSim.Robust.Tests/Robust.Tests.csproj
index 64c91f6cde6..01ee023499a 100644
--- a/Tests/OpenSim.Robust.Tests/Robust.Tests.csproj
+++ b/Tests/OpenSim.Robust.Tests/Robust.Tests.csproj
@@ -31,10 +31,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Server.Handlers.Tests/OpenSim.Server.Handlers.Tests.csproj b/Tests/OpenSim.Server.Handlers.Tests/OpenSim.Server.Handlers.Tests.csproj
index 2478614e90e..c2704825dd9 100644
--- a/Tests/OpenSim.Server.Handlers.Tests/OpenSim.Server.Handlers.Tests.csproj
+++ b/Tests/OpenSim.Server.Handlers.Tests/OpenSim.Server.Handlers.Tests.csproj
@@ -36,10 +36,16 @@
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
-
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Services.InventoryService.Tests/OpenSim.Services.InventoryService.Tests.csproj b/Tests/OpenSim.Services.InventoryService.Tests/OpenSim.Services.InventoryService.Tests.csproj
index 65780e43de6..0b2165ebf0a 100644
--- a/Tests/OpenSim.Services.InventoryService.Tests/OpenSim.Services.InventoryService.Tests.csproj
+++ b/Tests/OpenSim.Services.InventoryService.Tests/OpenSim.Services.InventoryService.Tests.csproj
@@ -35,10 +35,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Stress.Tests/OpenSim.Tests.Stress.csproj b/Tests/OpenSim.Stress.Tests/OpenSim.Tests.Stress.csproj
index 1b9a8a64baf..a86bce7e268 100644
--- a/Tests/OpenSim.Stress.Tests/OpenSim.Tests.Stress.csproj
+++ b/Tests/OpenSim.Stress.Tests/OpenSim.Tests.Stress.csproj
@@ -37,10 +37,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Tests.Common/OpenSim.Tests.Common.csproj b/Tests/OpenSim.Tests.Common/OpenSim.Tests.Common.csproj
index 1b349d3bc3a..0bd094a0006 100644
--- a/Tests/OpenSim.Tests.Common/OpenSim.Tests.Common.csproj
+++ b/Tests/OpenSim.Tests.Common/OpenSim.Tests.Common.csproj
@@ -38,10 +38,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Tests/OpenSim.Tests/OpenSim.Tests.csproj b/Tests/OpenSim.Tests/OpenSim.Tests.csproj
index d3067243a43..84181b23cfc 100644
--- a/Tests/OpenSim.Tests/OpenSim.Tests.csproj
+++ b/Tests/OpenSim.Tests/OpenSim.Tests.csproj
@@ -11,10 +11,16 @@
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs b/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs
deleted file mode 100644
index 6eb7b88e565..00000000000
--- a/ThirdParty/SmartThreadPool/CanceledWorkItemsGroup.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace Amib.Threading.Internal
-{
- internal class CanceledWorkItemsGroup
- {
- public readonly static CanceledWorkItemsGroup NotCanceledWorkItemsGroup = new();
-
- public CanceledWorkItemsGroup()
- {
- IsCanceled = false;
- }
-
- public bool IsCanceled { get; set; }
- }
-}
\ No newline at end of file
diff --git a/ThirdParty/SmartThreadPool/Exceptions.cs b/ThirdParty/SmartThreadPool/Exceptions.cs
deleted file mode 100644
index 91f88d54b04..00000000000
--- a/ThirdParty/SmartThreadPool/Exceptions.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-
-namespace Amib.Threading
-{
- #region Exceptions
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been canceled
- ///
- public sealed partial class WorkItemCancelException : Exception
- {
- public WorkItemCancelException()
- {
- }
-
- public WorkItemCancelException(string message)
- : base(message)
- {
- }
-
- public WorkItemCancelException(string message, Exception e)
- : base(message, e)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- public sealed partial class WorkItemTimeoutException : Exception
- {
- public WorkItemTimeoutException()
- {
- }
-
- public WorkItemTimeoutException(string message)
- : base(message)
- {
- }
-
- public WorkItemTimeoutException(string message, Exception e)
- : base(message, e)
- {
- }
- }
-
- ///
- /// Represents an exception in case IWorkItemResult.GetResult has been timed out
- ///
- public sealed partial class WorkItemResultException : Exception
- {
- public WorkItemResultException()
- {
- }
-
- public WorkItemResultException(string message)
- : base(message)
- {
- }
-
- public WorkItemResultException(string message, Exception e)
- : base(message, e)
- {
- }
- }
- #endregion
-}
diff --git a/ThirdParty/SmartThreadPool/Interfaces.cs b/ThirdParty/SmartThreadPool/Interfaces.cs
deleted file mode 100644
index e709aa80c21..00000000000
--- a/ThirdParty/SmartThreadPool/Interfaces.cs
+++ /dev/null
@@ -1,517 +0,0 @@
-using System;
-using System.Threading;
-
-namespace Amib.Threading
-{
- #region Delegates
-
- ///
- /// A delegate that represents the method to run as the work item
- ///
- /// A state object for the method to run
- public delegate object WorkItemCallback(object state);
-
- ///
- /// A delegate to call after the WorkItemCallback completed
- ///
- /// The work item result object
- public delegate void PostExecuteWorkItemCallback(IWorkItemResult wir);
-
- ///
- /// A delegate to call after the WorkItemCallback completed
- ///
- /// The work item result object
- public delegate void PostExecuteWorkItemCallback(IWorkItemResult wir);
-
- ///
- /// A delegate to call when a WorkItemsGroup becomes idle
- ///
- /// A reference to the WorkItemsGroup that became idle
- public delegate void WorkItemsGroupIdleHandler(IWorkItemsGroup workItemsGroup);
-
- ///
- /// A delegate to call after a thread is created, but before
- /// it's first use.
- ///
- public delegate void ThreadInitializationHandler();
-
- ///
- /// A delegate to call when a thread is about to exit, after
- /// it is no longer belong to the pool.
- ///
- public delegate void ThreadTerminationHandler();
-
- #endregion
-
- #region IWorkItemsGroup interface
-
- ///
- /// IWorkItemsGroup interface
- /// Created by SmartThreadPool.CreateWorkItemsGroup()
- ///
- public interface IWorkItemsGroup
- {
- ///
- /// Get/Set the name of the WorkItemsGroup
- ///
- string Name { get; set; }
-
- int localID { get; set; }
-
- ///
- /// Get/Set the maximum number of workitem that execute cocurrency on the thread pool
- ///
- int Concurrency { get; set; }
-
- ///
- /// Get the number of work items waiting in the queue.
- ///
- int WaitingCallbacks { get; }
-
- ///
- /// Get an array with all the state objects of the currently running items.
- /// The array represents a snap shot and impact performance.
- ///
- object[] GetStates();
-
- ///
- /// Get the WorkItemsGroup start information
- ///
- WIGStartInfo WIGStartInfo { get; }
-
- ///
- /// Starts to execute work items
- ///
- void Start();
-
- ///
- /// Cancel all the work items.
- /// Same as Cancel(false)
- ///
- void Cancel();
-
- ///
- /// Cancel all work items using thread abortion
- ///
- /// True to stop work items by raising ThreadAbortException
- void Cancel(bool abortExecution);
-
- ///
- /// Wait for all work item to complete.
- ///
- void WaitForIdle();
-
- ///
- /// Wait for all work item to complete, until timeout expired
- ///
- /// How long to wait for the work items to complete
- /// Returns true if work items completed within the timeout, otherwise false.
- bool WaitForIdle(TimeSpan timeout);
-
- ///
- /// Wait for all work item to complete, until timeout expired
- ///
- /// How long to wait for the work items to complete in milliseconds
- /// Returns true if work items completed within the timeout, otherwise false.
- bool WaitForIdle(int millisecondsTimeout);
-
- ///
- /// IsIdle is true when there are no work items running or queued.
- ///
- bool IsIdle { get; }
-
- ///
- /// This event is fired when all work items are completed.
- /// (When IsIdle changes to true)
- /// This event only work on WorkItemsGroup. On SmartThreadPool
- /// it throws the NotImplementedException.
- ///
- event WorkItemsGroupIdleHandler OnIdle;
-
- #region QueueWorkItem
-
- IWorkItemResult QueueWorkItem(WaitCallback callback);
- IWorkItemResult QueueWorkItem(WaitCallback callback, object state);
- IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WaitCallback callback);
- IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WaitCallback callback, object state);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state);
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- ///
- /// A delegate to call after the callback completion
- ///
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback);
-
-
- ///
- /// Queue a work item
- ///
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- ///
- /// A delegate to call after the callback completion
- ///
- /// Indicates on which cases to call to the post execute callback
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemCallback callback, object state, PostExecuteWorkItemCallback postExecuteWorkItemCallback, CallToPostExecute callToPostExecute);
-
- ///
- /// Queue a work item
- ///
- /// Work item info
- /// A callback to execute
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WorkItemCallback callback);
-
- ///
- /// Queue a work item
- ///
- /// Work item information
- /// A callback to execute
- ///
- /// The context object of the work item. Used for passing arguments to the work item.
- ///
- /// Returns a work item result
- IWorkItemResult QueueWorkItem(WorkItemInfo workItemInfo, WorkItemCallback callback, object state);
-
- #endregion
-
- #region QueueWorkItem(Action<...>)
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T arg);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T1 arg1, T2 arg2);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T1 arg1, T2 arg2, T3 arg3);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult object, but its GetResult() will always return null
- IWorkItemResult QueueWorkItem(Action action, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- #endregion
-
- #region QueueWorkItem(Func<...>)
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T arg);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T1 arg1, T2 arg2);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T1 arg1, T2 arg2, T3 arg3);
-
- ///
- /// Queue a work item.
- ///
- /// Returns a IWorkItemResult<TResult> object.
- /// its GetResult() returns a TResult object
- IWorkItemResult QueueWorkItem(Func func, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-
- #endregion
- }
-
- #endregion
-
- #region CallToPostExecute enumerator
-
- [Flags]
- public enum CallToPostExecute
- {
- ///
- /// Never call to the PostExecute call back
- ///
- Never = 0x00,
-
- ///
- /// Call to the PostExecute only when the work item is cancelled
- ///
- WhenWorkItemCanceled = 0x01,
-
- ///
- /// Call to the PostExecute only when the work item is not cancelled
- ///
- WhenWorkItemNotCanceled = 0x02,
-
- ///
- /// Always call to the PostExecute
- ///
- Always = WhenWorkItemCanceled | WhenWorkItemNotCanceled,
- }
-
- #endregion
-
- #region IWorkItemResult interface
-
- ///
- /// The common interface of IWorkItemResult and IWorkItemResult<T>
- ///
- public interface IWaitableResult
- {
- ///
- /// This method intent is for internal use.
- ///
- ///
- IWorkItemResult GetWorkItemResult();
-
- ///
- /// This method intent is for internal use.
- ///
- ///
- IWorkItemResult GetWorkItemResultT();
- }
-
- ///
- /// IWorkItemResult interface.
- /// Created when a WorkItemCallback work item is queued.
- ///
- public interface IWorkItemResult : IWorkItemResult