Cutover dependencies for the MoneyServer and Robust to IConfiguration and ILogger and prep to use DI for instantiation of classes. Working through the rest of the Robust support and some of the RegionServer Modules remains

This commit is contained in:
Mike Dickson 2024-01-25 23:08:35 -05:00
parent 9719790383
commit a72cf27958
409 changed files with 3271 additions and 4284 deletions

3
.gitignore vendored
View file

@ -32,6 +32,9 @@ bld/
[Ll]og/
[Ll]ogs/
# VS Code
.vscode/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot

38
.vscode/launch.json vendored
View file

@ -3,5 +3,41 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": []
"configurations": [
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
},
{
"name": "C#: OpenSim.Server.MoneyServer Debug",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/Source/OpenSim.Server.MoneyServer/bin/Debug/net6.0/OpenSim.Server.MoneyServer.dll",
"args": ["--console","local","--inifile","${workspaceFolder}/../../Config/MoneyServer.ini"],
"cwd": "${workspaceFolder}",
"stopAtEntry": true,
"console": "integratedTerminal"
},
{
"name": "C#: OpenSim.Server.RobustServer Debug",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/Source/OpenSim.Server.RobustServer/bin/Debug/net6.0/OpenSim.Server.RobustServer.dll",
"args": ["--console","local","--inifile","${workspaceFolder}/../../Config/Robust.Grid.ini"],
"cwd": "${workspaceFolder}",
"stopAtEntry": true,
"console": "integratedTerminal"
},
{
"name": "C#: OpenSim.Server.RegionServer Debug",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/Source/OpenSim.Server.RegionServer/bin/Debug/net6.0/OpenSim.Server.RegionServer.dll",
"args": ["--console","local","--inifile","${workspaceFolder}/../../Config/OpenSim.ini.ini"],
"cwd": "${workspaceFolder}",
"stopAtEntry": true,
"console": "integratedTerminal"
},
]
}

View file

@ -81,7 +81,7 @@ namespace OpenSim.Groups
#region Region Module interfaceBase Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];

View file

@ -59,7 +59,7 @@ namespace OpenSim.Groups
#region Region Module interfaceBase Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];

View file

@ -53,14 +53,14 @@ namespace OpenSim.Groups
private List<Scene> m_Scenes;
private ForeignImporter m_ForeignImporter;
private string m_ServiceLocation;
private IConfigSource m_Config;
private IConfiguration m_Config;
private Dictionary<string, GroupsServiceHGConnector> m_NetworkConnectors = new Dictionary<string, GroupsServiceHGConnector>();
private RemoteConnectorCacheWrapper m_CacheWrapper; // for caching info of external group services
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];
if (groupsConfig == null)

View file

@ -50,13 +50,13 @@ namespace OpenSim.Groups
private string m_ConfigName = "Groups";
// Called by Robust shell
public HGGroupsServiceRobustConnector(IConfigSource config, IHttpServer server, string configName) :
public HGGroupsServiceRobustConnector(IConfiguration config, IHttpServer server, string configName) :
this(config, server, configName, null, null)
{
}
// Called by the sim-bound module
public HGGroupsServiceRobustConnector(IConfigSource config, IHttpServer server, string configName, IOfflineIMService im, IUserAccountService users) :
public HGGroupsServiceRobustConnector(IConfiguration config, IHttpServer server, string configName, IOfflineIMService im, IUserAccountService users) :
base(config, server, configName)
{
if (configName != String.Empty)

View file

@ -52,7 +52,7 @@ namespace OpenSim.Groups
{
}
public GroupsServiceLocalConnectorModule(IConfigSource config, IUserManagement uman)
public GroupsServiceLocalConnectorModule(IConfiguration config, IUserManagement uman)
{
Init(config);
m_UserManagement = uman;
@ -60,7 +60,7 @@ namespace OpenSim.Groups
}
#endregion
private void Init(IConfigSource config)
private void Init(IConfiguration config)
{
m_GroupsService = new GroupsService(config);
m_Scenes = new List<Scene>();
@ -68,7 +68,7 @@ namespace OpenSim.Groups
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];
if (groupsConfig == null)

View file

@ -49,7 +49,7 @@ namespace OpenSim.Groups
private IServiceAuth m_Auth;
private object m_Lock = new object();
public GroupsServiceRemoteConnector(IConfigSource config)
public GroupsServiceRemoteConnector(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];
string url = groupsConfig.GetString("GroupsServerURI", string.Empty);

View file

@ -53,7 +53,7 @@ namespace OpenSim.Groups
{
}
public GroupsServiceRemoteConnectorModule(IConfigSource config, IUserManagement uman)
public GroupsServiceRemoteConnectorModule(IConfiguration config, IUserManagement uman)
{
Init(config);
m_UserManagement = uman;
@ -62,7 +62,7 @@ namespace OpenSim.Groups
}
#endregion
private void Init(IConfigSource config)
private void Init(IConfiguration config)
{
m_GroupsService = new GroupsServiceRemoteConnector(config);
m_Scenes = new List<Scene>();
@ -71,7 +71,7 @@ namespace OpenSim.Groups
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];
if (groupsConfig == null)

View file

@ -50,7 +50,7 @@ namespace OpenSim.Groups
private GroupsService m_GroupsService;
private string m_ConfigName = "Groups";
public GroupsServiceRobustConnector(IConfigSource config, IHttpServer server, string configName) :
public GroupsServiceRobustConnector(IConfiguration config, IHttpServer server, string configName) :
base(config, server, configName)
{
string key = string.Empty;

View file

@ -105,12 +105,12 @@ namespace OpenSim.Groups
private System.Timers.Timer m_CleanupTimer;
public GroupsService(IConfigSource config, string configName)
public GroupsService(IConfiguration config, string configName)
: base(config, configName)
{
}
public GroupsService(IConfigSource config)
public GroupsService(IConfiguration config)
: this(config, string.Empty)
{
// Once a day

View file

@ -40,7 +40,7 @@ namespace OpenSim.Groups
protected IGroupsData m_Database = null;
protected IGridUserData m_GridUserService = null;
public GroupsServiceBase(IConfigSource config, string cName)
public GroupsServiceBase(IConfiguration config, string cName)
: base(config)
{
string dllName = String.Empty;

View file

@ -47,7 +47,7 @@ namespace OpenSim.Groups
private IUserAccountService m_UserAccounts;
private string m_HomeURI;
public HGGroupsService(IConfigSource config, IOfflineIMService im, IUserAccountService users, string homeURI)
public HGGroupsService(IConfiguration config, IOfflineIMService im, IUserAccountService users, string homeURI)
: base(config, string.Empty)
{
m_OfflineIM = im;

View file

@ -46,7 +46,7 @@ namespace OpenSim.OfflineIM
private IOfflineIMService m_OfflineIMService;
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig cnf = config.Configs["Messaging"];
if (cnf == null)

View file

@ -25,11 +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 OpenSim.Framework;
using OpenSim.Framework.ServiceAuth;
@ -38,7 +34,8 @@ using OpenSim.Services.Interfaces;
using OpenMetaverse;
using log4net;
using Nini.Config;
using Microsoft.Extensions.Configuration;
namespace OpenSim.OfflineIM
{
@ -56,16 +53,16 @@ namespace OpenSim.OfflineIM
m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: Offline IM server at {0}", m_ServerURI);
}
public OfflineIMServiceRemoteConnector(IConfigSource config)
public OfflineIMServiceRemoteConnector(IConfiguration config)
{
IConfig cnf = config.Configs["Messaging"];
if (cnf == null)
var cnf = config.GetSection("Messaging");
if (cnf.Exists() is false)
{
m_log.WarnFormat("[OfflineIM.V2.RemoteConnector]: Missing Messaging configuration");
return;
}
m_ServerURI = cnf.GetString("OfflineMessageURL", string.Empty);
m_ServerURI = cnf.GetValue("OfflineMessageURL", string.Empty);
/// This is from BaseServiceConnector
string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", "Messaging" }, "None");
@ -76,6 +73,7 @@ namespace OpenSim.OfflineIM
m_Auth = new BasicHttpAuthentication(config, "Messaging");
break;
}
///
m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: Offline IM server at {0} with auth {1}",
m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString()));

View file

@ -50,7 +50,7 @@ namespace OpenSim.OfflineIM
private IOfflineIMService m_OfflineIMService;
private string m_ConfigName = "Messaging";
public OfflineIMServiceRobustConnector(IConfigSource config, IHttpServer server, string configName) :
public OfflineIMServiceRobustConnector(IConfiguration config, IHttpServer server, string configName) :
base(config, server, configName)
{
if (configName != String.Empty)

View file

@ -52,7 +52,7 @@ namespace OpenSim.OfflineIM
private XmlSerializer m_serializer;
private static bool m_Initialized = false;
public OfflineIMService(IConfigSource config)
public OfflineIMService(IConfiguration config)
: base(config)
{
m_serializer = new XmlSerializer(typeof(GridInstantMessage));

View file

@ -39,7 +39,7 @@ namespace OpenSim.OfflineIM
{
protected IOfflineIMData m_Database = null;
public OfflineIMServiceBase(IConfigSource config)
public OfflineIMServiceBase(IConfiguration config)
: base(config)
{
string dllName = String.Empty;

View file

@ -38,7 +38,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IConfigSource m_configSource;
private IConfiguration m_configSource;
private IOpenSimBase m_application;
@ -47,7 +47,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
m_application = openSim;
}
public void SetIniConfigSource(IConfigSource configSource)
public void SetIniConfigSource(IConfiguration configSource)
{
m_configSource = configSource;
}
@ -92,7 +92,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
m_log.InfoFormat("[ESTATE LOADER FILE SYSTEM]: Loading config file {0}", file);
IConfigSource source = null;
IConfiguration source = null;
try
{
source = new IniConfigSource(file);

View file

@ -31,7 +31,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
public interface IEstateLoader
{
void SetIniConfigSource(IConfigSource configSource);
void SetIniConfigSource(IConfiguration configSource);
void LoadEstates();
}
}

View file

@ -32,7 +32,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
public interface IRegionLoader
{
void SetIniConfigSource(IConfigSource configSource);
void SetIniConfigSource(IConfiguration configSource);
RegionInfo[] LoadRegions();
}
}

View file

@ -43,7 +43,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
private string m_name = "LoadRegionsPlugin";
private string m_version = "0.0";
private IConfigSource _configuration;
private IConfiguration _configuration;
private ILogger<LoadRegionsPlugin> _logger;
public string Version
@ -59,7 +59,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
protected IOpenSimBase m_openSim;
public LoadRegionsPlugin(
IConfigSource configuration,
IConfiguration configuration,
ILogger<LoadRegionsPlugin> logger)
{
_configuration = configuration;

View file

@ -39,9 +39,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IConfigSource m_configSource;
private IConfiguration m_configSource;
public void SetIniConfigSource(IConfigSource configSource)
public void SetIniConfigSource(IConfiguration configSource)
{
m_configSource = configSource;
}
@ -86,7 +86,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
IConfigSource source = new IniConfigSource(file);
IConfiguration source = new IniConfigSource(file);
foreach (IConfig config in source.Configs)
{

View file

@ -40,9 +40,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IConfigSource m_configSource;
private IConfiguration m_configSource;
public void SetIniConfigSource(IConfigSource configSource)
public void SetIniConfigSource(IConfiguration configSource)
{
m_configSource = configSource;
}

View file

@ -26,26 +26,25 @@
*/
using Autofac;
using Autofac.Extensions.DependencyInjection;
using System.Reflection;
using System.Runtime.Loader;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using log4net;
using Nini.Config;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework;
using Microsoft.Extensions.DependencyInjection;
namespace OpenSim.ApplicationPlugins.RegionModulesController
{
public class RegionModulesControllerPlugin : IApplicationPlugin, IRegionModulesController
{
private readonly IServiceProvider _serviceProvider;
private readonly IConfigSource _configuration;
private readonly ILogger<RegionModulesControllerPlugin> _logger;
private readonly IServiceProvider m_serviceProvider;
private readonly IConfiguration m_configuration;
private readonly ILogger<RegionModulesControllerPlugin> m_logger;
// Config access
private IOpenSimBase m_openSim;
@ -65,12 +64,12 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
public RegionModulesControllerPlugin(
IServiceProvider serviceProvider,
IConfigSource configuration,
IConfiguration configuration,
ILogger<RegionModulesControllerPlugin> logger)
{
this._serviceProvider = serviceProvider;
this._configuration = configuration;
this._logger = logger;
this.m_serviceProvider = serviceProvider;
this.m_configuration = configuration;
this.m_logger = logger;
}
#region IDisposable implementation
@ -112,29 +111,27 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
public void Initialise(IOpenSimBase openSim)
{
_logger.LogInformation($"[REGIONMODULES]: Initializing...");
m_logger.LogInformation($"Initializing...");
m_openSim = openSim;
m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
// The [Modules] section in the ini file
IConfig modulesConfig = _configuration.Configs["Modules"];
if (modulesConfig == null)
modulesConfig = _configuration.AddConfig("Modules");
var modulesConfig = m_configuration.GetSection("Modules");
// Who we are
string id = this.Name;
using (var scope = _serviceProvider.CreateScope())
using (var scope = m_serviceProvider.CreateScope())
{
_logger.LogInformation($"[REGIONMODULES]: Initializing ISharedRegionModules");
m_logger.LogInformation($"[REGIONMODULES]: Initializing ISharedRegionModules");
var m_sharedModules = scope.ServiceProvider.GetServices<ISharedRegionModule>();
foreach (var module in m_sharedModules)
{
// Read the config again
string moduleString = modulesConfig.GetString("Setup_" + module.Name, String.Empty);
string moduleString = modulesConfig.GetValue("Setup_" + module.Name, String.Empty);
if (moduleString == "disabled")
continue;
@ -142,26 +139,26 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
// OK, we're up and running
m_sharedInstances.Add(module);
_logger.LogInformation($"[REGIONMODULES]: Initializing: {module.Name}");
module.Initialise(_configuration);
m_logger.LogInformation($"[REGIONMODULES]: Initializing: {module.Name}");
module.Initialise();
}
_logger.LogInformation($"[REGIONMODULES]: Initializing INonSharedRegionModules");
m_logger.LogInformation($"[REGIONMODULES]: Initializing INonSharedRegionModules");
var m_nonSharedModules = scope.ServiceProvider.GetServices<INonSharedRegionModule>();
foreach (var module in m_nonSharedModules)
{
// Read the config again
var moduleString = modulesConfig.GetString("Setup_" + module.Name, String.Empty);
var moduleString = modulesConfig.GetValue("Setup_" + module.Name, String.Empty);
if (moduleString == "disabled")
continue;
// OK, we're up and running
m_nonSharedInstances.Add(module);
_logger.LogInformation($"[REGIONMODULES]: Initializing: {module.Name}");
module.Initialise(_configuration);
m_logger.LogInformation($"[REGIONMODULES]: Initializing: {module.Name}");
module.Initialise();
}
}
}
@ -175,13 +172,13 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
/// <param name="dir">The directory to search for target dlls</param>
/// <param name="match">String to match (possibly with wildcard so 1:M</param>
private void SearchModules(
IConfig modulesConfig,
IConfigurationSection modulesConfig,
AssemblyLoadContext loadContext,
DirectoryInfo dir,
string match
)
{
_logger.LogDebug($"[REGIONMODULES]: Looking for RegionModules in directory: {dir.FullName} that match {match}");
m_logger.LogDebug($"[REGIONMODULES]: Looking for RegionModules in directory: {dir.FullName} that match {match}");
foreach (var fileInfo in dir.GetFiles(match))
{
@ -198,36 +195,36 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
{
if (CheckModuleEnabled(pluginType, modulesConfig))
{
_logger.LogDebug($"[REGIONMODULES]: Found shared region module {pluginType.Name}, class {pluginType}");
m_logger.LogDebug($"[REGIONMODULES]: Found shared region module {pluginType.Name}, class {pluginType}");
m_sharedModules.Add(pluginType);
}
else
{
_logger.LogDebug($"[REGIONMODULES]: Found disabled shared region module {pluginType.Name}, class {pluginType}");
m_logger.LogDebug($"[REGIONMODULES]: Found disabled shared region module {pluginType.Name}, class {pluginType}");
}
}
else if (typeof(INonSharedRegionModule).IsAssignableFrom(pluginType))
{
if (CheckModuleEnabled(pluginType, modulesConfig))
{
_logger.LogDebug($"[REGIONMODULES]: Found non-shared region module {pluginType.Name}, class {pluginType}");
m_logger.LogDebug($"[REGIONMODULES]: Found non-shared region module {pluginType.Name}, class {pluginType}");
m_nonSharedModules.Add(pluginType);
}
else
{
_logger.LogDebug($"[REGIONMODULES]: Found disabled non-shared region module {pluginType.Name}, class {pluginType}");
m_logger.LogDebug($"[REGIONMODULES]: Found disabled non-shared region module {pluginType.Name}, class {pluginType}");
}
}
else
{
_logger.LogDebug($"[REGIONMODULES]: Found unknown type of module {pluginType.Name}, class {pluginType}");
m_logger.LogDebug($"[REGIONMODULES]: Found unknown type of module {pluginType.Name}, class {pluginType}");
}
}
}
}
catch (Exception ex)
{
_logger.LogError($"[REGIONMODULES]: Error loading assembly {fileInfo.FullName} : {ex}");
m_logger.LogError($"[REGIONMODULES]: Error loading assembly {fileInfo.FullName} : {ex}");
continue;
}
}
@ -235,7 +232,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
public void PostInitialise ()
{
_logger.LogDebug("[REGIONMODULES]: PostInitializing...");
m_logger.LogDebug("[REGIONMODULES]: PostInitializing...");
// Immediately run PostInitialise on shared modules
foreach (ISharedRegionModule module in m_sharedInstances)
@ -266,10 +263,10 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
/// <param name="node"></param>
/// <param name="modulesConfig">The config section</param>
/// <returns>true if the module is enabled, false if it is disabled</returns>
protected bool CheckModuleEnabled(Type node, IConfig modulesConfig)
protected bool CheckModuleEnabled(Type node, IConfigurationSection modulesConfig)
{
// Get the config string
string moduleString = modulesConfig.GetString("Setup_" + node.Name, String.Empty);
string moduleString = modulesConfig.GetValue("Setup_" + node.Name, String.Empty);
// We have a selector
if (!String.IsNullOrEmpty(moduleString))
@ -337,16 +334,16 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
if (mii.Invoke(scene, new object[0]) != null)
{
_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
m_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
deferredSharedModules[replaceableInterface] = module;
_logger.LogDebug("[REGIONMODULE]: Deferred load of {0}", module.Name);
m_logger.LogDebug("[REGIONMODULE]: Deferred load of {0}", module.Name);
continue;
}
_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to shared module {1}",
m_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to shared module {1}",
scene.RegionInfo.RegionName, module.Name);
module.AddRegion(scene);
@ -355,8 +352,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
sharedlist.Add(module);
}
IConfig modulesConfig =
_configuration.Configs["Modules"];
var modulesConfig = m_configuration.GetSection("Modules");
// Scan for, and load, nonshared modules
List<INonSharedRegionModule> list = new List<INonSharedRegionModule>();
@ -365,7 +361,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
Object[] ctorArgs = new Object[] {0};
// Read the config
string moduleString = modulesConfig.GetString("Setup_" + node.Name, string.Empty);
string moduleString = modulesConfig.GetValue("Setup_" + node.Name, string.Empty);
// We may not want to load this at all
if (moduleString == "disabled")
@ -400,20 +396,20 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
if (mii.Invoke(scene, new object[0]) != null)
{
_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
m_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
deferredNonSharedModules[replaceableInterface] = module;
_logger.LogDebug("[REGIONMODULE]: Deferred load of {0}", module.Name);
m_logger.LogDebug("[REGIONMODULE]: Deferred load of {0}", module.Name);
continue;
}
_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to non-shared module {1}",
m_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to non-shared module {1}",
scene.RegionInfo.RegionName, module.Name);
// Initialise the module
module.Initialise(_configuration);
module.Initialise( );
list.Add(module);
}
@ -439,11 +435,11 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
if (mii.Invoke(scene, new object[0]) != null)
{
_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
m_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to shared module {1} (deferred)",
m_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to shared module {1} (deferred)",
scene.RegionInfo.RegionName, module.Name);
// Not replaced, load the module
@ -467,15 +463,15 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
if (mii.Invoke(scene, new object[0]) != null)
{
_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
m_logger.LogDebug("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString());
continue;
}
}
_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to non-shared module {1} (deferred)",
m_logger.LogDebug("[REGIONMODULE]: Adding scene {0} to non-shared module {1} (deferred)",
scene.RegionInfo.RegionName, module.Name);
module.Initialise(_configuration);
module.Initialise();
list.Add(module);
deferredlist.Add(module);
@ -515,7 +511,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
{
foreach (IRegionModuleBase module in scene.RegionModules.Values)
{
_logger.LogDebug("[REGIONMODULE]: Removing scene {0} from module {1}",
m_logger.LogDebug("[REGIONMODULE]: Removing scene {0} from module {1}",
scene.RegionInfo.RegionName, module.Name);
module.RemoveRegion(scene);
if (module is INonSharedRegionModule)

View file

@ -67,11 +67,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private string m_version = "0.0";
private string m_openSimVersion;
private IConfigSource _configuration;
private IConfiguration _configuration;
private ILogger<RemoteAdminPlugin> _logger;
public RemoteAdminPlugin(
IConfigSource configuration,
IConfiguration configuration,
ILogger<RemoteAdminPlugin> logger)
{
_configuration = configuration;

View file

@ -46,7 +46,7 @@ namespace OpenSim.Region.ClientStack.Linden
private List<Scene> m_scenes = new List<Scene>();
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.Linden
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -148,7 +148,7 @@ namespace OpenSim.Region.ClientStack.Linden
m_PrimScaleMin = m_ModelCost.PrimScaleMin;
IConfigSource config = m_Scene.Config;
IConfiguration config = m_Scene.Config;
if (config != null)
{
IConfig sconfig = config.Configs["Startup"];

View file

@ -47,7 +47,7 @@ namespace OpenSim.Region.ClientStack.Linden
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -51,7 +51,7 @@ namespace OpenSim.Region.ClientStack.Linden
#region INonSharedRegionModule Members
public void Initialise(IConfigSource pSource)
public void Initialise(IConfiguration pSource)
{
IConfig config = pSource.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -52,7 +52,7 @@ namespace OpenSim.Region.ClientStack.Linden
#region INonSharedRegionModule Members
public void Initialise(IConfigSource pSource)
public void Initialise(IConfiguration pSource)
{
IConfig config = pSource.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -69,7 +69,7 @@ namespace OpenSim.Region.ClientStack.Linden
private readonly Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new();
#region INonSharedRegionModule methods
public virtual void Initialise(IConfigSource config)
public virtual void Initialise(IConfiguration config)
{
}

View file

@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.Linden
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -93,7 +93,7 @@ namespace OpenSim.Region.ClientStack.Linden
ProcessQueuedRequestsAsync = processQueuedResultsAsync;
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -82,7 +82,7 @@ namespace OpenSim.Region.ClientStack.Linden
get { return null; }
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.Linden
Enabled = true;
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["Mesh"];
if (config == null)

View file

@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.Linden
private Scene m_scene;
#region INonSharedRegionModule Members
public void Initialise(IConfigSource pSource)
public void Initialise(IConfiguration pSource)
{
}

View file

@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.Linden
get { return null; }
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.Linden
public event ConsoleMessage OnConsoleMessage;
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
m_commands.AddCommand( "Help", false, "help", "help [<item>]", "Display help on a particular command or on a list of commands in a category", Help);
}

View file

@ -53,7 +53,7 @@ namespace OpenSim.Region.ClientStack.Linden
get { return null; }
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
m_enabled = false; // whatever
IConfig config = source.Configs["ClientStack.LindenCaps"];

View file

@ -75,7 +75,7 @@ namespace OpenSim.Region.ClientStack.Linden
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["SimulatorFeatures"];
m_doScriptSyntax = true;

View file

@ -50,7 +50,7 @@ namespace OpenSim.Region.ClientStack.Linden
private string m_URL;
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -101,7 +101,7 @@ namespace OpenSim.Region.ClientStack.Linden
ProcessQueuedRequestsAsync = processQueuedResultsAsync;
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)

View file

@ -25,17 +25,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Threading;
using log4net;
using Nini.Config;
using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Framework.Monitoring;
@ -43,7 +37,8 @@ using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Interfaces;
using OpenMetaverse;
using TokenBucket = OpenSim.Region.ClientStack.LindenUDP.TokenBucket;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace OpenSim.Region.ClientStack.LindenUDP
@ -53,9 +48,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </summary>
public class LLUDPServerShim : INonSharedRegionModule
{
protected IConfigSource m_Config;
protected IConfiguration m_Config;
protected readonly ILogger<LLUDPServerShim> m_Logger;
protected LLUDPServer m_udpServer;
public LLUDPServerShim(IConfiguration configuration, ILogger<LLUDPServerShim> logger)
{
m_Config = configuration;
m_Logger = logger;
}
#region INonSharedRegionModule
public virtual string Name
{
@ -67,9 +70,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return null; }
}
public virtual void Initialise(IConfigSource source)
public virtual void Initialise()
{
m_Config = source;
}
public virtual void Close()
@ -365,7 +367,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public LLUDPServer(
IPAddress listenIP, uint port, int proxyPortOffsetParm,
IConfigSource configSource, AgentCircuitManager circuitManager)
IConfiguration configSource, AgentCircuitManager circuitManager)
: base(listenIP, (int)port)
{
#region Environment.TickCount Measurement
@ -380,6 +382,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
now = Environment.TickCount;
TickCountResolution += (float)(now - start);
}
m_log.Info($"[LLUDPSERVER]: Average Environment.TickCount resolution: {TickCountResolution * 0.1f}ms");
TickCountResolution = 0f;
@ -401,32 +404,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int sceneThrottleBps = 0;
// bool usePools = false;
IConfig config = configSource.Configs["ClientStack.LindenUDP"];
if (config != null)
var config = configSource.GetSection("ClientStack.LindenUDP");
if (config.Exists())
{
m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0);
sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 6250000);
m_recvBufferSize = config.GetValue<int>("client_socket_rcvbuf_size", 0);
sceneThrottleBps = config.GetValue<int>("scene_throttle_max_bps", 6250000);
TextureSendLimit = config.GetValue<int>("TextureSendLimit", 20);
m_defaultRTO = config.GetValue<int>("DefaultRTO", 0);
m_maxRTO = config.GetValue<int>("MaxRTO", 0);
m_ackTimeout = config.GetValue<int>("AckTimeout", 60) * 1000;
m_pausedAckTimeout = config.GetValue<int>("PausedAckTimeout", 300) * 1000;
TextureSendLimit = config.GetInt("TextureSendLimit", 20);
m_defaultRTO = config.GetInt("DefaultRTO", 0);
m_maxRTO = config.GetInt("MaxRTO", 0);
m_disableFacelights = config.GetBoolean("DisableFacelights", false);
m_ackTimeout = 1000 * config.GetInt("AckTimeout", 60);
m_pausedAckTimeout = 1000 * config.GetInt("PausedAckTimeout", 300);
SupportViewerObjectsCache = config.GetBoolean("SupportViewerObjectsCache", SupportViewerObjectsCache);
m_disableFacelights = config.GetValue<bool>("DisableFacelights", false);
SupportViewerObjectsCache = config.GetValue<bool>("SupportViewerObjectsCache", SupportViewerObjectsCache);
}
else
{
TextureSendLimit = 20;
m_ackTimeout = 1000 * 60; // 1 minute
m_pausedAckTimeout = 1000 * 300; // 5 minutes
m_ackTimeout = 60 * 1000; // 1 minute
m_pausedAckTimeout = 300 * 1000; // 5 minutes
}
// FIXME: This actually only needs to be done once since the PacketPool is shared across all servers.
// However, there is no harm in temporarily doing it multiple times.
IConfig packetConfig = configSource.Configs["PacketPool"];
if (packetConfig != null)
var packetConfig = configSource.GetSection("PacketPool");
if (packetConfig.Exists())
{
//PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
//PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
@ -434,15 +436,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
#region BinaryStats
config = configSource.Configs["Statistics.Binary"];
m_shouldCollectStats = false;
if (config != null)
config = configSource.GetSection("Statistics.Binary");
if (config.Exists())
{
m_shouldCollectStats = config.GetBoolean("Enabled", false);
binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetInt("packet_headers_period_seconds", 300));
binStatsDir = config.GetString("stats_dir", ".");
m_aggregatedBWStats = config.GetBoolean("aggregatedBWStats", false);
m_shouldCollectStats = config.GetValue<bool>("Enabled", m_shouldCollectStats);
binStatsMaxFilesize = TimeSpan.FromSeconds(config.GetValue<int>("packet_headers_period_seconds", 300));
binStatsDir = config.GetValue("stats_dir", ".");
m_aggregatedBWStats = config.GetValue<bool>("aggregatedBWStats", false);
}
#endregion BinaryStats
Throttle = new TokenBucket(null, sceneThrottleBps, sceneThrottleBps * 10e-3f);

View file

@ -28,6 +28,7 @@
using System;
using OpenSim.Framework;
using Nini.Config;
using Microsoft.Extensions.Configuration;
namespace OpenSim.Region.ClientStack.LindenUDP
{
@ -73,14 +74,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Default constructor
/// </summary>
/// <param name="config">Config source to load defaults from</param>
public ThrottleRates(IConfigSource config)
public ThrottleRates(IConfiguration config)
{
try
{
IConfig throttleConfig = config.Configs["ClientStack.LindenUDP"];
if(throttleConfig != null)
var throttleConfig = config.GetSection("ClientStack.LindenUDP");
if (throttleConfig.Exists())
{
ClientMaxRate = throttleConfig.GetInt("client_throttle_max_bps", ClientMaxRate);
ClientMaxRate = throttleConfig.GetValue<int>("client_throttle_max_bps", ClientMaxRate);
if (ClientMaxRate > 1000000)
ClientMaxRate = 1000000; // no more than 8Mbps
else if (ClientMaxRate < 6250)
@ -89,7 +90,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Adaptive is broken
// AdaptiveThrottlesEnabled = throttleConfig.GetBoolean("enable_adaptive_throttles", false);
AdaptiveThrottlesEnabled = false;
MinimumAdaptiveThrottleRate = throttleConfig.GetInt("adaptive_throttle_min_bps", 32000);
MinimumAdaptiveThrottleRate = throttleConfig.GetValue<int>("adaptive_throttle_min_bps", 32000);
}
}
catch (Exception) { }

View file

@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
#region Region Module interface
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig sconfig = source.Configs["Startup"];
if (sconfig != null)

View file

@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
private List<string> m_bans = new List<string>();
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
{
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig startupConfig = source.Configs["Startup"];
if (startupConfig != null)

View file

@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
#region INonSharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
lastTimeTick = (int)Util.GetTimeStampMS() + 30000;
lastFilesExpire = lastTimeTick + 180000;

View file

@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Asset
get { return m_ModuleName; }
}
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig moduleConfig = source.Configs["Modules"];

View file

@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
public string Name { get { return "Attachments Module"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig config = source.Configs["Attachments"];
if (config is not null)

View file

@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
#region Region Module interface
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig appearanceConfig = config.Configs["Appearance"];

View file

@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
private static IServiceAuth m_Auth;
public void Initialise(IConfigSource configSource)
public void Initialise(IConfiguration configSource)
{
IConfig config = configSource.Configs["XBakes"];
if (config == null)

View file

@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
protected object m_syncy = new object();
protected IConfig m_config;
#region ISharedRegionModule Members
public virtual void Initialise(IConfigSource config)
public virtual void Initialise(IConfiguration config)
{
m_config = config.Configs["Chat"];

View file

@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
/// </summary>
/// <param name="scene"></param>
/// <param name="config"></param>
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
}

View file

@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatars.Commands
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
// m_log.DebugFormat("[USER COMMANDS MODULE]: INITIALIZED MODULE");
}

View file

@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
protected Scene m_scene;
public void Initialise(IConfigSource source) { }
public void Initialise(IConfiguration source) { }
public Type ReplaceableInterface { get { return null; } }

View file

@ -44,7 +44,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected List<Scene> m_Scenes = new List<Scene>();
protected bool m_Enabled = true;
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig ccConfig = source.Configs["XCallingCard"];
if (ccConfig != null)

View file

@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig moduleConfig = config.Configs["Modules"];
if (moduleConfig != null)
@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
protected virtual void InitModule(IConfigSource config)
protected virtual void InitModule(IConfiguration config)
{
IConfig friendsConfig = config.Configs["Friends"];
if (friendsConfig != null)

View file

@ -83,7 +83,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
m_StatusNotifier = new HGStatusNotifier(this);
}
protected override void InitModule(IConfigSource config)
protected override void InitModule(IConfiguration config)
{
base.InitModule(config);

View file

@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
protected Scene m_scene;
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
protected Scene m_scene;
protected IDialogModule m_dialogModule;
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
#region ISharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig groupsConfig = config.Configs["Groups"];

View file

@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
public virtual void Initialise(IConfigSource config)
public virtual void Initialise(IConfiguration config)
{
IConfig cnf = config.Configs["Messaging"];
if (cnf != null && cnf.GetString("MessageTransferModule", "MessageTransferModule") != Name)

View file

@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
protected IMessageTransferModule m_TransferModule = null;
public virtual void Initialise(IConfigSource config)
public virtual void Initialise(IConfiguration config)
{
if (config.Configs["Messaging"] != null)
{

View file

@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
public virtual void Initialise(IConfigSource config)
public virtual void Initialise(IConfiguration config)
{
IConfig cnf = config.Configs["Messaging"];
if (cnf != null)

View file

@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
protected IMuteListService m_service = null;
private IUserManagement m_userManagementModule;
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig cnf = config.Configs["Messaging"];
if (cnf == null)

View file

@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private bool m_ForwardOfflineGroupMessages = true;
private Dictionary<IClientAPI, List<UUID>> m_repliesSent= new Dictionary<IClientAPI, List<UUID>>();
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig cnf = config.Configs["Messaging"];
if (cnf == null)

View file

@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
}
}
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
}

View file

@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
#region ISharedRegionModule
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
#region Region Module interface
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
if (config.Configs["Messaging"] != null)
{

View file

@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
private readonly ExpiringCacheOS<UUID, GridInstantMessage> m_PendingLures = new ExpiringCacheOS<UUID, GridInstantMessage>(3600000);
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
if (config.Configs["Messaging"] != null)
{

View file

@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
private IMessageTransferModule m_TransferModule = null;
private bool m_Enabled = false;
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
if (config.Configs["Messaging"] != null)
{

View file

@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
if(config.Configs["UserProfiles"] != null)
return;

View file

@ -209,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
/// <value>
/// The configuration
/// </value>
public IConfigSource Config
public IConfiguration Config
{
get;
set;
@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
/// <param name='source'>
/// Source.
/// </param>
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
Config = source;
ReplaceableInterface = typeof(IProfileModule);

View file

@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Framework
protected Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds
= new Dictionary<UUID, Dictionary<ulong, string>>();
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
}

View file

@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes
public string Name { get { return "DAExample Module"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source) {}
public void Initialise(IConfiguration source) {}
public void AddRegion(Scene scene)
{

View file

@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes
public string Name { get { return "DO"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source) {}
public void Initialise(IConfiguration source) {}
public void AddRegion(Scene scene)
{

View file

@ -236,7 +236,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
get { return "BasicEntityTransferModule"; }
}
public virtual void Initialise(IConfigSource source)
public virtual void Initialise(IConfiguration source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)
@ -254,7 +254,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// Initialize config common for this module and any descendents.
/// </summary>
/// <param name="source"></param>
protected virtual void InitialiseCommon(IConfigSource source)
protected virtual void InitialiseCommon(IConfiguration source)
{
IConfig transferConfig = source.Configs["EntityTransfer"];
if (transferConfig != null)

View file

@ -116,7 +116,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
get { return "HGEntityTransferModule"; }
}
public override void Initialise(IConfigSource source)
public override void Initialise(IConfiguration source)
{
IConfig moduleConfig = source.Configs["Modules"];

View file

@ -71,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
get { return "HGInventoryAccessModule"; }
}
public override void Initialise(IConfigSource source)
public override void Initialise(IConfiguration source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig != null)

View file

@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
get { return "BasicInventoryAccessModule"; }
}
public virtual void Initialise(IConfigSource source)
public virtual void Initialise(IConfiguration source)
{
IConfig moduleConfig = source.Configs["Modules"];
if (moduleConfig is not null)
@ -94,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
/// Common module config for both this and descendant classes.
/// </summary>
/// <param name="source"></param>
protected virtual void InitialiseCommon(IConfigSource source)
protected virtual void InitialiseCommon(IConfiguration source)
{
IConfig inventoryConfig = source.Configs["Inventory"];
CoalesceMultipleObjectsToInventory = inventoryConfig is null || inventoryConfig.GetBoolean("CoalesceMultipleObjectsToInventory", true);

View file

@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
m_Enabled = config.Configs["Modules"].GetBoolean("LibraryModule", m_Enabled);
if (m_Enabled)

View file

@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
#region Implementation of INonSharedRegionModule
public void Initialise(IConfigSource source)
public void Initialise(IConfiguration source)
{
IConfig cnfg = source.Configs["Monitoring"];

View file

@ -53,7 +53,7 @@ namespace OpenSim.Region.CoreModules.Framework.Search
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
string umanmod = config.Configs["Modules"].GetString("SearchModule", Name);
if (umanmod == Name)

View file

@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.Framework.ServiceThrottle
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
m_processorJobEngine = new JobEngine("ServiceThrottle","ServiceThrottle", 5000, 2);
m_processorJobEngine.Start();

View file

@ -42,7 +42,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
#region ISharedRegionModule
public override void Initialise(IConfigSource config)
public override void Initialise(IConfiguration config)
{
string umanmod = config.Configs["Modules"].GetString("UserManagementModule", null);
if (umanmod == Name)

View file

@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
#region ISharedRegionModule
public virtual void Initialise(IConfigSource config)
public virtual void Initialise(IConfiguration config)
{
string umanmod = config.Configs["Modules"].GetString("UserManagementModule", Name);
if (umanmod == Name)
@ -1276,7 +1276,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
#endregion IUserManagement
protected virtual void Init(IConfigSource config)
protected virtual void Init(IConfiguration config)
{
AddSystemUser(UUID.Zero, "Unknown", "User");
AddSystemUser(Constants.m_MrOpenSimID, "Mr", "Opensim");

View file

@ -328,7 +328,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
#region ISharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig texturesConfig = config.Configs["Textures"];
if (texturesConfig != null)

View file

@ -109,7 +109,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
#region ISharedRegionModule
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig startupConfig = config.Configs["Startup"];
if(startupConfig == null)

View file

@ -89,7 +89,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
#region INonSharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
lock (m_mainLock)
{

View file

@ -114,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
get { return "UrlModule"; }
}
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig networkConfig = config.Configs["Network"];
m_enabled = false;

View file

@ -103,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
#region ISharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
m_outboundUrlFilter = new OutboundUrlFilter("Script dynamic texture image module", config);
string proxyurl = config.Configs["Startup"].GetString("HttpProxy");

View file

@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
public event ScriptCommand OnScriptCommand;
#region RegionModuleInterface
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
}

View file

@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
#region ISharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
IConfig cfg = config.Configs["VectorRender"];
if (null != cfg)

View file

@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
#region INonSharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
// wrap this in a try block so that defaults will work if
// the config file doesn't specify otherwise.

View file

@ -98,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
#region ISharedRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
// We need to create these early because the scripts might be calling
// But since this gets called for every region, we need to make sure they

View file

@ -41,12 +41,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static bool m_Enabled = false;
private IConfigSource m_Config;
private IConfiguration m_Config;
bool m_Registered = false;
#region Region Module interface
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
m_Config = config;
IConfig moduleConfig = config.Configs["Modules"];

View file

@ -40,12 +40,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static bool m_Enabled = false;
private IConfigSource m_Config;
private IConfiguration m_Config;
bool m_Registered = false;
#region Region Module interface
public void Initialise(IConfigSource config)
public void Initialise(IConfiguration config)
{
m_Config = config;
IConfig moduleConfig = config.Configs["Modules"];

Some files were not shown because too many files have changed in this diff Show more