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/Region/Application/OpenSimMain.cs | 38 +++++----------------- OpenSim/Region/ClientStack/PacketServer.cs | 1 + .../Region/ClientStack/RegionApplicationBase.cs | 4 +-- OpenSim/Region/ClientStack/UDPServer.cs | 1 + OpenSim/Region/Environment/RegionManager.cs | 1 + 5 files changed, 13 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index c333e0e..81523e0 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -37,7 +37,7 @@ using OpenSim.Framework.Data; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; using OpenSim.Framework.Types; -using OpenSim.GenericConfig; +using OpenSim.Framework.Configuration; using OpenSim.Physics.Manager; using OpenSim.Region.Caches; using OpenSim.Region.ClientStack; @@ -85,6 +85,9 @@ namespace OpenSim /// public override void StartUp() { + m_log = new LogBase(m_logFilename, "Region", this, m_silent); + MainLog.Instance = m_log; + base.StartUp(); if (!m_sandbox) @@ -108,27 +111,16 @@ namespace OpenSim { string path2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions"); string path3 = Path.Combine(path2, "default.xml"); - Console.WriteLine("Creating default region config file"); - //TODO create default region - IGenericConfig defaultConfig = new XmlConfig(path3); - defaultConfig.LoadData(); - defaultConfig.Commit(); - defaultConfig.Close(); - defaultConfig = null; + + RegionInfo regionInfo = new RegionInfo("DEFAULT REGION CONFIG", path3); configFiles = Directory.GetFiles(path, "*.xml"); } for (int i = 0; i < configFiles.Length; i++) { Console.WriteLine("Loading region config file"); - - IGenericConfig regionConfig = new XmlConfig(configFiles[i]); - RegionInfo regionInfo = new RegionInfo(); - regionConfig.LoadData(); - regionInfo.InitConfig(this.m_sandbox, regionConfig); - regionConfig.Close(); - - + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); + UDPServer udpServer; Scene scene = SetupScene(regionInfo, out udpServer); @@ -159,21 +151,7 @@ namespace OpenSim protected override void Initialize() { - IGenericConfig localConfig = new XmlConfig(m_configFileName); - localConfig.LoadData(); - - if (m_useConfigFile) - { - SetupFromConfigFile(localConfig); - } - - StartLog(); - - m_networkServersInfo.InitConfig(m_sandbox, localConfig); m_httpServerPort = m_networkServersInfo.HttpListenerPort; - - localConfig.Close(); - m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); } diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs index 41aaf3a..7b15ab4 100644 --- a/OpenSim/Region/ClientStack/PacketServer.cs +++ b/OpenSim/Region/ClientStack/PacketServer.cs @@ -31,6 +31,7 @@ using System.Net.Sockets; using libsecondlife.Packets; using OpenSim.Assets; using OpenSim.Framework; +using OpenSim.Framework.Types; using OpenSim.Framework.Interfaces; using OpenSim.Region.Caches; diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 1bb383f..375306d 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -65,9 +65,9 @@ namespace OpenSim.Region.ClientStack virtual public void StartUp() { + ClientView.TerrainManager = new TerrainManager(new SecondLife()); - m_networkServersInfo = new NetworkServersInfo(); - RegionInfo m_regionInfo = new RegionInfo(); + m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", "network_servers_information.xml"); Initialize(); diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index ac17720..f90a213 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -32,6 +32,7 @@ using System.Net.Sockets; using libsecondlife.Packets; using OpenSim.Assets; using OpenSim.Framework; +using OpenSim.Framework.Types; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; using OpenSim.Region.Caches; diff --git a/OpenSim/Region/Environment/RegionManager.cs b/OpenSim/Region/Environment/RegionManager.cs index e75ee60..255aa45 100644 --- a/OpenSim/Region/Environment/RegionManager.cs +++ b/OpenSim/Region/Environment/RegionManager.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using OpenSim.Framework; +using OpenSim.Framework.Types; using OpenSim.Framework.Communications; using OpenSim.Framework.Servers; using OpenSim.Region.Capabilities; -- cgit v1.1