From f03a6bbc616c3c9ce8dadce6059cf7899ef91b9b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 2 Jan 2017 17:47:20 +0000 Subject: 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: [@]...[:] --- OpenSim/Server/Base/ServerUtils.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'OpenSim/Server/Base') diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index 18a4266..57d0a8d 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -242,6 +242,18 @@ namespace OpenSim.Server.Base className = parts[2]; } + // Handle extra string arguments in a more generic way + if (dllName.Contains("@")) + { + string[] dllNameParts = dllName.Split(new char[] {'@'}); + dllName = dllNameParts[dllNameParts.Length - 1]; + List argList = new List(args); + for (int i = 0 ; i < dllNameParts.Length - 1 ; ++i) + argList.Add(dllNameParts[i]); + + args = argList.ToArray(); + } + return LoadPlugin(dllName, className, args); } -- cgit v1.1