From 222becc8795d8abd8263c8abf8212de91faa4748 Mon Sep 17 00:00:00 2001 From: mingchen Date: Wed, 18 Jul 2007 23:15:08 +0000 Subject: *New Configuration System, much easier and less buggy compared to the original system in place *View RegionInfo.cs for an example on how it works! *This hopefully copies all the files over, but who knows :) --- OpenSim/Grid/GridServer/GridManager.cs | 2 ++ OpenSim/Grid/GridServer/Main.cs | 42 ++++------------------------------ 2 files changed, 6 insertions(+), 38 deletions(-) (limited to 'OpenSim/Grid/GridServer') diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index b3ba4e5..2e7f9f7 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -38,6 +38,8 @@ using OpenSim.Framework.Data; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Utilities; +using OpenSim.Framework.Configuration; + namespace OpenSim.Grid.GridServer { class GridManager diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 09aeab5..85bd918 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -33,7 +33,8 @@ using System.Timers; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; -using OpenSim.GenericConfig; +using OpenSim.Framework.Configuration; + using Timer=System.Timers.Timer; namespace OpenSim.Grid.GridServer @@ -47,7 +48,6 @@ namespace OpenSim.Grid.GridServer public GridConfig Cfg; public static OpenGrid_Main thegrid; - protected IGenericConfig localXMLConfig; public static bool setuponly; @@ -105,14 +105,8 @@ namespace OpenSim.Grid.GridServer public void Startup() { - this.localXMLConfig = new XmlConfig("GridServerConfig.xml"); - this.localXMLConfig.LoadData(); - this.ConfigDB(this.localXMLConfig); - this.localXMLConfig.Close(); - - m_console.Verbose( "Main.cs:Startup() - Loading configuration"); - Cfg = this.LoadConfigDll(this.ConfigDll); - Cfg.InitConfig(); + + this.Cfg = new GridConfig("GRID SERVER","GridServer_Config.xml"); //Yeah srsly, that's it. if (setuponly) Environment.Exit(0); m_console.Verbose( "Main.cs:Startup() - Connecting to Storage Server"); @@ -148,34 +142,6 @@ namespace OpenSim.Grid.GridServer simCheckTimer.Enabled = true; } - private GridConfig LoadConfigDll(string dllName) - { - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - GridConfig config = null; - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - if (!pluginType.IsAbstract) - { - Type typeInterface = pluginType.GetInterface("IGridConfig", true); - - if (typeInterface != null) - { - IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - config = plug.GetConfigObject(); - break; - } - - typeInterface = null; - } - } - } - pluginAssembly = null; - return config; - } - public void CheckSims(object sender, ElapsedEventArgs e) { /* -- cgit v1.1