aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices.GridServer/GridManager.cs
diff options
context:
space:
mode:
authorgareth2007-05-07 16:32:30 +0000
committergareth2007-05-07 16:32:30 +0000
commit3de3d8bb3ba9b0781a2078c8698816ae5b72f7b1 (patch)
tree5d6b1009685278b214100a7901bd4feaeed584da /OpenGridServices.GridServer/GridManager.cs
parentUpdated to have uniform build number (diff)
downloadopensim-SC_OLD-3de3d8bb3ba9b0781a2078c8698816ae5b72f7b1.zip
opensim-SC_OLD-3de3d8bb3ba9b0781a2078c8698816ae5b72f7b1.tar.gz
opensim-SC_OLD-3de3d8bb3ba9b0781a2078c8698816ae5b72f7b1.tar.bz2
opensim-SC_OLD-3de3d8bb3ba9b0781a2078c8698816ae5b72f7b1.tar.xz
Merged 0.1-prestable back into trunk :(
Diffstat (limited to 'OpenGridServices.GridServer/GridManager.cs')
-rw-r--r--OpenGridServices.GridServer/GridManager.cs43
1 files changed, 23 insertions, 20 deletions
diff --git a/OpenGridServices.GridServer/GridManager.cs b/OpenGridServices.GridServer/GridManager.cs
index 8cff0d3..e41f3d5 100644
--- a/OpenGridServices.GridServer/GridManager.cs
+++ b/OpenGridServices.GridServer/GridManager.cs
@@ -16,6 +16,7 @@ namespace OpenGridServices.GridServer
16 class GridManager 16 class GridManager
17 { 17 {
18 Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); 18 Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
19 public string defaultRecvKey;
19 20
20 /// <summary> 21 /// <summary>
21 /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. 22 /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
@@ -23,27 +24,26 @@ namespace OpenGridServices.GridServer
23 /// <param name="FileName">The filename to the grid server plugin DLL</param> 24 /// <param name="FileName">The filename to the grid server plugin DLL</param>
24 public void AddPlugin(string FileName) 25 public void AddPlugin(string FileName)
25 { 26 {
27 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Attempting to load " + FileName);
26 Assembly pluginAssembly = Assembly.LoadFrom(FileName); 28 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
27 29
30 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
28 foreach (Type pluginType in pluginAssembly.GetTypes()) 31 foreach (Type pluginType in pluginAssembly.GetTypes())
29 { 32 {
30 if (pluginType.IsPublic) 33 if (!pluginType.IsAbstract)
31 { 34 {
32 if (!pluginType.IsAbstract) 35 Type typeInterface = pluginType.GetInterface("IGridData", true);
33 { 36
34 Type typeInterface = pluginType.GetInterface("IGridData", true); 37 if (typeInterface != null)
35 38 {
36 if (typeInterface != null) 39 IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
37 { 40 plug.Initialise();
38 IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 41 this._plugins.Add(plug.getName(), plug);
39 plug.Initialise(); 42 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Added IGridData Interface");
40 this._plugins.Add(plug.getName(),plug); 43 }
41 44
42 } 45 typeInterface = null;
43 46 }
44 typeInterface = null;
45 }
46 }
47 } 47 }
48 48
49 pluginAssembly = null; 49 pluginAssembly = null;
@@ -63,7 +63,7 @@ namespace OpenGridServices.GridServer
63 } 63 }
64 catch (Exception e) 64 catch (Exception e)
65 { 65 {
66 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("getRegionPlugin UUID " + kvp.Key + " is made of fail: " + e.ToString()); 66 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key);
67 } 67 }
68 } 68 }
69 return null; 69 return null;
@@ -84,7 +84,7 @@ namespace OpenGridServices.GridServer
84 } 84 }
85 catch (Exception e) 85 catch (Exception e)
86 { 86 {
87 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("getRegionPlugin Handle " + kvp.Key + " is made of fail: " + e.ToString()); 87 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key);
88 } 88 }
89 } 89 }
90 return null; 90 return null;
@@ -269,6 +269,7 @@ namespace OpenGridServices.GridServer
269 TheSim = new SimProfileData(); 269 TheSim = new SimProfileData();
270 LLUUID UUID = new LLUUID(param); 270 LLUUID UUID = new LLUUID(param);
271 TheSim.UUID = UUID; 271 TheSim.UUID = UUID;
272 TheSim.regionRecvKey = defaultRecvKey;
272 } 273 }
273 274
274 XmlDocument doc = new XmlDocument(); 275 XmlDocument doc = new XmlDocument();
@@ -320,11 +321,13 @@ namespace OpenGridServices.GridServer
320 321
321 try 322 try
322 { 323 {
324 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Attempting to add a new region to the grid - " + _plugins.Count + " storage provider(s) registered.");
323 foreach (KeyValuePair<string, IGridData> kvp in _plugins) 325 foreach (KeyValuePair<string, IGridData> kvp in _plugins)
324 { 326 {
325 try 327 try
326 { 328 {
327 kvp.Value.AddProfile(TheSim); 329 kvp.Value.AddProfile(TheSim);
330 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("New sim added to grid (" + TheSim.regionName + ")");
328 } 331 }
329 catch (Exception e) 332 catch (Exception e)
330 { 333 {