Create a generic way for passing constructor args to plugins

The old syntax didn't allow for any parameters except for services
listed in the ServiceList. Now, services loaded by other services can
also be made to use different ini sections or have additional paramters.
Syntax is: [<ExtraParam>@]...<DllName>[:<ClassName>]
This commit is contained in:
Melanie Thielker
2017-01-02 17:47:20 +00:00
parent 7abb0477ed
commit f03a6bbc61
4 changed files with 32 additions and 6 deletions

View File

@@ -180,9 +180,14 @@ namespace OpenSim.Services.LLLoginService
string hgInvServicePlugin = m_LoginServerConfig.GetString("HGInventoryServicePlugin", String.Empty);
if (hgInvServicePlugin != string.Empty)
{
// TODO: Remove HGInventoryServiceConstructorArg after 0.9 release
string hgInvServiceArg = m_LoginServerConfig.GetString("HGInventoryServiceConstructorArg", String.Empty);
Object[] args2 = new Object[] { config, hgInvServiceArg };
m_HGInventoryService = ServerUtils.LoadPlugin<IInventoryService>(hgInvServicePlugin, args2);
if (hgInvServiceArg != String.Empty)
{
m_log.Warn("[LLOGIN SERVICE]: You are using HGInventoryServiceConstructorArg, which is deprecated. See example file for correct syntax.");
hgInvServicePlugin = hgInvServiceArg + "@" + hgInvServicePlugin;
}
m_HGInventoryService = ServerUtils.LoadPlugin<IInventoryService>(hgInvServicePlugin, args);
}
//