aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base/ServerUtils.cs
diff options
context:
space:
mode:
authorMelanie Thielker2017-01-02 17:47:20 +0000
committerMelanie Thielker2017-01-02 17:47:20 +0000
commitf03a6bbc616c3c9ce8dadce6059cf7899ef91b9b (patch)
tree9a1865348dc394b3cadbf0cd0a21adfb2e36ee9c /OpenSim/Server/Base/ServerUtils.cs
parentReplaced OpenMetaverse libs/xmls with new ones. Also added a file in openmeta... (diff)
downloadopensim-SC-f03a6bbc616c3c9ce8dadce6059cf7899ef91b9b.zip
opensim-SC-f03a6bbc616c3c9ce8dadce6059cf7899ef91b9b.tar.gz
opensim-SC-f03a6bbc616c3c9ce8dadce6059cf7899ef91b9b.tar.bz2
opensim-SC-f03a6bbc616c3c9ce8dadce6059cf7899ef91b9b.tar.xz
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>]
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs12
1 files changed, 12 insertions, 0 deletions
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
242 className = parts[2]; 242 className = parts[2];
243 } 243 }
244 244
245 // Handle extra string arguments in a more generic way
246 if (dllName.Contains("@"))
247 {
248 string[] dllNameParts = dllName.Split(new char[] {'@'});
249 dllName = dllNameParts[dllNameParts.Length - 1];
250 List<Object> argList = new List<Object>(args);
251 for (int i = 0 ; i < dllNameParts.Length - 1 ; ++i)
252 argList.Add(dllNameParts[i]);
253
254 args = argList.ToArray();
255 }
256
245 return LoadPlugin<T>(dllName, className, args); 257 return LoadPlugin<T>(dllName, className, args);
246 } 258 }
247 259