From 3de3d8bb3ba9b0781a2078c8698816ae5b72f7b1 Mon Sep 17 00:00:00 2001 From: gareth Date: Mon, 7 May 2007 16:32:30 +0000 Subject: Merged 0.1-prestable back into trunk :( --- OpenGridServices.GridServer/GridManager.cs | 43 ++++++++++++++++-------------- OpenGridServices.GridServer/Main.cs | 6 +++-- 2 files changed, 27 insertions(+), 22 deletions(-) (limited to 'OpenGridServices.GridServer') 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 class GridManager { Dictionary _plugins = new Dictionary(); + public string defaultRecvKey; /// /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. @@ -23,27 +24,26 @@ namespace OpenGridServices.GridServer /// The filename to the grid server plugin DLL public void AddPlugin(string FileName) { + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Attempting to load " + FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName); - + + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); foreach (Type pluginType in pluginAssembly.GetTypes()) { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IGridData", true); - - if (typeInterface != null) - { - IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(); - this._plugins.Add(plug.getName(),plug); - - } - - typeInterface = null; - } - } + if (!pluginType.IsAbstract) + { + Type typeInterface = pluginType.GetInterface("IGridData", true); + + if (typeInterface != null) + { + IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); + plug.Initialise(); + this._plugins.Add(plug.getName(), plug); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Added IGridData Interface"); + } + + typeInterface = null; + } } pluginAssembly = null; @@ -63,7 +63,7 @@ namespace OpenGridServices.GridServer } catch (Exception e) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("getRegionPlugin UUID " + kvp.Key + " is made of fail: " + e.ToString()); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); } } return null; @@ -84,7 +84,7 @@ namespace OpenGridServices.GridServer } catch (Exception e) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("getRegionPlugin Handle " + kvp.Key + " is made of fail: " + e.ToString()); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); } } return null; @@ -269,6 +269,7 @@ namespace OpenGridServices.GridServer TheSim = new SimProfileData(); LLUUID UUID = new LLUUID(param); TheSim.UUID = UUID; + TheSim.regionRecvKey = defaultRecvKey; } XmlDocument doc = new XmlDocument(); @@ -320,11 +321,13 @@ namespace OpenGridServices.GridServer try { + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Attempting to add a new region to the grid - " + _plugins.Count + " storage provider(s) registered."); foreach (KeyValuePair kvp in _plugins) { try { kvp.Value.AddProfile(TheSim); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine("New sim added to grid (" + TheSim.regionName + ")"); } catch (Exception e) { diff --git a/OpenGridServices.GridServer/Main.cs b/OpenGridServices.GridServer/Main.cs index f7cfe71..ba6c60d 100644 --- a/OpenGridServices.GridServer/Main.cs +++ b/OpenGridServices.GridServer/Main.cs @@ -47,6 +47,7 @@ namespace OpenGridServices.GridServer public class OpenGrid_Main : BaseServer, conscmd_callback { private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll"; + private string GridDll = "OpenGrid.Framework.Data.DB4o.dll"; public GridConfig Cfg; public static OpenGrid_Main thegrid; @@ -94,9 +95,10 @@ namespace OpenGridServices.GridServer Cfg = this.LoadConfigDll(this.ConfigDll); Cfg.InitConfig(); - m_console.WriteLine("Main.cs:Startup() - Connecting to MySql Server"); + m_console.WriteLine("Main.cs:Startup() - Connecting to Storage Server"); m_gridManager = new GridManager(); - m_gridManager.AddPlugin("OpenGrid.Framework.Data.MySQL.dll"); // Made of win + m_gridManager.AddPlugin(GridDll); // Made of win + m_gridManager.defaultRecvKey = Cfg.SimRecvKey; m_console.WriteLine("Main.cs:Startup() - Starting HTTP process"); BaseHttpServer httpServer = new BaseHttpServer(8001); -- cgit v1.1