From 9bdeb8af6f797e35b5322d6856ecc488340c9453 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 6 Aug 2007 10:48:40 +0000 Subject: * SimpleApp works again: * NetworkServersInfo settable without config file * DefaultHomeLoc throws if getted before setted * Removed nonsensical sandbox distinction * Refactored default config file creation * Some more small refactorings on shapes --- OpenSim/Region/Application/OpenSimMain.cs | 33 +++++++++------------- .../Region/ClientStack/RegionApplicationBase.cs | 2 ++ .../Communications/Local/LocalUserServices.cs | 4 +-- OpenSim/Region/Examples/SimpleApp/Program.cs | 5 +--- 4 files changed, 18 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index c68f75e..7fb48b0 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -120,30 +120,19 @@ namespace OpenSim m_httpServer.AddStreamHandler(new SimStatusHandler()); } - if (m_sandbox) - { - m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); - } - else - { - m_commsManager = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache); - } - - - string path = Path.Combine(Util.configDir(), "Regions"); - if (!Directory.Exists(path)) + string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); + + if (!Directory.Exists(regionConfigPath)) { - Directory.CreateDirectory(path); + Directory.CreateDirectory(regionConfigPath); } - string[] configFiles = Directory.GetFiles(path, "*.xml"); + + string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); if (configFiles.Length == 0) { - string path2 = Path.Combine(Util.configDir(), "Regions"); - string path3 = Path.Combine(path2, "default.xml"); - - RegionInfo regionInfo = new RegionInfo("DEFAULT REGION CONFIG", path3); - configFiles = Directory.GetFiles(path, "*.xml"); + CreateDefaultRegionInfoXml(Path.Combine(regionConfigPath, "default.xml")); + configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } for (int i = 0; i < configFiles.Length; i++) @@ -156,7 +145,6 @@ namespace OpenSim m_localScenes.Add(scene); - m_udpServers.Add(udpServer); m_regionData.Add(regionInfo); } @@ -170,6 +158,11 @@ namespace OpenSim } + private static void CreateDefaultRegionInfoXml(string fileName) + { + new RegionInfo("DEFAULT REGION CONFIG", fileName); + } + protected override StorageManager CreateStorageManager(RegionInfo regionInfo) { return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName); diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 008b4c7..5683b31 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -41,6 +41,7 @@ using libsecondlife; using OpenSim.Region.Environment.Scenes; using OpenSim.Framework.Communications; using OpenSim.Framework.Communications.Caches; +using OpenSim.Region.Communications.Local; namespace OpenSim.Region.ClientStack { @@ -78,6 +79,7 @@ namespace OpenSim.Region.ClientStack m_httpServer.Start(); m_inventoryCache = new InventoryCache(); + m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); } protected abstract void Initialize(); diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index c351451..cc80c81 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -16,10 +16,10 @@ namespace OpenSim.Region.Communications.Local private uint defaultHomeX ; private uint defaultHomeY; - public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversData) + public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) { m_Parent = parent; - this.serversInfo = serversData; + this.serversInfo = serversInfo; defaultHomeX = this.serversInfo.DefaultHomeLocX; defaultHomeY = this.serversInfo.DefaultHomeLocY; } diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index a27cc0c..50b0780 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -35,8 +35,7 @@ namespace SimpleApp StartLog(); - m_networkServersInfo = new NetworkServersInfo( ); - + m_networkServersInfo = new NetworkServersInfo( 1000, 1000 ); LocalAssetServer assetServer = new LocalAssetServer(); assetServer.SetServerInfo("http://localhost:8003/", ""); @@ -48,8 +47,6 @@ namespace SimpleApp { base.StartUp(); - m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); - m_log.Notice(m_log.LineInfo); ScenePresence.PhysicsEngineFlying = true; -- cgit v1.1