mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Merged 0.1-prestable back into trunk :(
This commit is contained in:
@@ -16,6 +16,7 @@ namespace OpenGridServices.GridServer
|
||||
class GridManager
|
||||
{
|
||||
Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
|
||||
public string defaultRecvKey;
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
|
||||
@@ -23,27 +24,26 @@ namespace OpenGridServices.GridServer
|
||||
/// <param name="FileName">The filename to the grid server plugin DLL</param>
|
||||
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<string, IGridData> kvp in _plugins)
|
||||
{
|
||||
try
|
||||
{
|
||||
kvp.Value.AddProfile(TheSim);
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("New sim added to grid (" + TheSim.regionName + ")");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user