From 51488ee7f415950583ba389582692900a2c32831 Mon Sep 17 00:00:00 2001 From: mingchen Date: Sat, 3 Nov 2007 15:09:21 +0000 Subject: *Moved region loading into its own interface IRegionLoader *Added ability to load regioninfo remotely from a webserver from a single file. See share/RegionLoading/HOWTO_REMOTE_REGION_LOADING.txt for more info and an example file. --- .../Filesystem/RegionLoaderFileSystem.cs | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs new file mode 100644 index 0000000..5ebcb64 --- /dev/null +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -0,0 +1,72 @@ +/* +* Copyright (c) Contributors, http://opensimulator.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using Nini.Config; +using OpenSim.Framework; +using System.IO; + +namespace OpenSim.Framework.RegionLoader.Filesystem +{ + public class RegionLoaderFileSystem : IRegionLoader + { + public void SetIniConfigSource(IniConfigSource configSource) + { + } + public RegionInfo[] LoadRegions() + { + string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); + + if (!Directory.Exists(regionConfigPath)) + { + Directory.CreateDirectory(regionConfigPath); + } + + string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + + if (configFiles.Length == 0) + { + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml")); + configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + } + + RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; + for (int i = 0; i < configFiles.Length; i++) + { + + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); + regionInfos[i] = regionInfo; + } + + + return regionInfos; + } + + } +} -- cgit v1.1 From 2d1c255e8c427c8c595be455e6d7f5c4e01c99a6 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 4 Nov 2007 14:34:45 +0000 Subject: normalized line endings --- .../Filesystem/RegionLoaderFileSystem.cs | 144 ++++++++++----------- 1 file changed, 72 insertions(+), 72 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 5ebcb64..7179a7f 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -1,72 +1,72 @@ -/* -* Copyright (c) Contributors, http://opensimulator.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.Collections.Generic; -using System.Text; -using Nini.Config; -using OpenSim.Framework; -using System.IO; - -namespace OpenSim.Framework.RegionLoader.Filesystem -{ - public class RegionLoaderFileSystem : IRegionLoader - { - public void SetIniConfigSource(IniConfigSource configSource) - { - } - public RegionInfo[] LoadRegions() - { - string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); - - if (!Directory.Exists(regionConfigPath)) - { - Directory.CreateDirectory(regionConfigPath); - } - - string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); - - if (configFiles.Length == 0) - { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml")); - configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); - } - - RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; - for (int i = 0; i < configFiles.Length; i++) - { - - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); - regionInfos[i] = regionInfo; - } - - - return regionInfos; - } - - } -} +/* +* Copyright (c) Contributors, http://opensimulator.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using Nini.Config; +using OpenSim.Framework; +using System.IO; + +namespace OpenSim.Framework.RegionLoader.Filesystem +{ + public class RegionLoaderFileSystem : IRegionLoader + { + public void SetIniConfigSource(IniConfigSource configSource) + { + } + public RegionInfo[] LoadRegions() + { + string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); + + if (!Directory.Exists(regionConfigPath)) + { + Directory.CreateDirectory(regionConfigPath); + } + + string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + + if (configFiles.Length == 0) + { + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml")); + configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + } + + RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; + for (int i = 0; i < configFiles.Length; i++) + { + + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); + regionInfos[i] = regionInfo; + } + + + return regionInfos; + } + + } +} -- cgit v1.1 From a45118d35e35c3f46ad165f978efd8d87e0da2b1 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 7 Dec 2007 02:00:35 +0000 Subject: added one more command to the console help. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 7179a7f..068c7c4 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -39,6 +39,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem public void SetIniConfigSource(IniConfigSource configSource) { } + public RegionInfo[] LoadRegions() { string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); @@ -59,14 +60,11 @@ namespace OpenSim.Framework.RegionLoader.Filesystem RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; for (int i = 0; i < configFiles.Length; i++) { - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); regionInfos[i] = regionInfo; } - return regionInfos; } - } } -- cgit v1.1 From af6eb67999875f12270ef19ed33c179556696754 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 10 Dec 2007 05:25:16 +0000 Subject: saved OpenSim source code from the giant rampaging unterminated copyright notice of doom --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 068c7c4..fb50171 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -13,7 +13,7 @@ * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -- cgit v1.1 From efd90b56b761219af6425b1c7a2cdd3b6ffb4de2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 27 Dec 2007 21:41:48 +0000 Subject: * Optimized usings * shortened references * Removed redundant 'this' * Normalized EOF --- .../Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index fb50171..a710f50 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -25,12 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using System; -using System.Collections.Generic; -using System.Text; -using Nini.Config; -using OpenSim.Framework; using System.IO; +using Nini.Config; namespace OpenSim.Framework.RegionLoader.Filesystem { @@ -67,4 +63,4 @@ namespace OpenSim.Framework.RegionLoader.Filesystem return regionInfos; } } -} +} \ No newline at end of file -- cgit v1.1 From 81b4c7be3e84b29e5fcc387f578afdc07b806048 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 4 Jan 2008 14:14:15 +0000 Subject: *Added ability to skip any use of the console when configuring and assume default value. This is useful when the server is running by itself and a new region request is added without sufficient information --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index a710f50..66a6ec8 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -49,14 +49,14 @@ namespace OpenSim.Framework.RegionLoader.Filesystem if (configFiles.Length == 0) { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml")); + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"),false); configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; for (int i = 0; i < configFiles.Length; i++) { - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i],false); regionInfos[i] = regionInfo; } -- cgit v1.1 From 47180080f0f4b93c60232b47ca4e093bd7c73a1d Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 18 Mar 2008 05:16:43 +0000 Subject: Formatting cleanup. --- .../Filesystem/RegionLoaderFileSystem.cs | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 66a6ec8..0902bee 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -1,30 +1,30 @@ /* -* Copyright (c) Contributors, http://opensimulator.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + using System.IO; using Nini.Config; @@ -63,4 +63,4 @@ namespace OpenSim.Framework.RegionLoader.Filesystem return regionInfos; } } -} \ No newline at end of file +} -- cgit v1.1 From 00b8e04eceab48cd1fb10791c3ddb55409ce3169 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 11 Apr 2008 04:21:29 +0000 Subject: * Added a "regionload_regionsdir" option to OpenSim.ini which determines where Region.XML files are stored. If not set, it will default to the usual location. --- .../RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 0902bee..ad8b4a0 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -32,14 +32,27 @@ namespace OpenSim.Framework.RegionLoader.Filesystem { public class RegionLoaderFileSystem : IRegionLoader { + private IniConfigSource m_configSouce; + public void SetIniConfigSource(IniConfigSource configSource) { + m_configSouce = configSource; } public RegionInfo[] LoadRegions() { string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); + try + { + IniConfig startupConfig = (IniConfig)m_configSouce.Configs["Startup"]; + regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); + } + catch (System.Exception) + { + // No INI setting recorded. + } + if (!Directory.Exists(regionConfigPath)) { Directory.CreateDirectory(regionConfigPath); -- cgit v1.1 From fef3b3689492dea63693c964bcdbec9f5137eb5e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 21 Apr 2008 07:09:17 +0000 Subject: * Optimised using statements and namespace references across entire project (this took a while to run). --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index ad8b4a0..cfaaf02 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.IO; using Nini.Config; @@ -48,7 +49,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem IniConfig startupConfig = (IniConfig)m_configSouce.Configs["Startup"]; regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); } - catch (System.Exception) + catch (Exception) { // No INI setting recorded. } -- cgit v1.1 From bf1580fba45df7624180b07599c8170074500c99 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 21 Apr 2008 12:42:56 +0000 Subject: From: Dr Scofield the attached patch set is centered around RemoteAdminPlugin and focuses mainly on making it more robust (i.e. more parameter checking and better error reporting) but also we've re-implemented the LoadTerrain stuff that got disabled during the terrain code reworking: * missing PostInitialize() calls on region modules that were loaded for regions created via RemoteAdmin's CreateRegion XmlRpc call * re-implements RemoteAdmin's LoadTerrain XmlRpc call (probably lost during the TerrainModule rework) * adds lots more parameter checking and error reporting to RemoteAdmin * adds a read-only property to RegionApplicationBase so that we can access the CommsManager * adds Exceptions to TerrainModule so that we get better error case feedback (and can report more meaningful errors in turn) * adds a CheckForTerrainUpdate() call to TerrainModule.LoadFromFile() to make terrain changes effective * adds TryGetCurrentScene(LLUUID) to SceneManager so that we can retrieve Scenes not only by name but also by LLUUID cheers, dr scofield --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index cfaaf02..0c01c5a 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -63,7 +63,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem if (configFiles.Length == 0) { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"),false); + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false); configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } -- cgit v1.1 From 682ec53420ffac9918febc12b7140363602812e5 Mon Sep 17 00:00:00 2001 From: MW Date: Thu, 26 Jun 2008 17:20:08 +0000 Subject: As per the suggestion on the mailing list, added support for a OpenSim.xml config file, instead of a ini file. INI files still work the same as they did before, just now if a ini file isn't found, it looks for a OpenSim.xml file (of course in xml format) and if found uses that. Includes a OpenSim.Example.xml for reference (the default settings saved as a xml file). --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 0c01c5a..c345fce 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -33,9 +33,9 @@ namespace OpenSim.Framework.RegionLoader.Filesystem { public class RegionLoaderFileSystem : IRegionLoader { - private IniConfigSource m_configSouce; + private IConfigSource m_configSouce; - public void SetIniConfigSource(IniConfigSource configSource) + public void SetIniConfigSource(IConfigSource configSource) { m_configSouce = configSource; } @@ -46,7 +46,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem try { - IniConfig startupConfig = (IniConfig)m_configSouce.Configs["Startup"]; + IConfig startupConfig = (IConfig)m_configSouce.Configs["Startup"]; regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); } catch (Exception) -- cgit v1.1 From cf5ee5eaa1505d3af811a5f317c82f151c5c3a4f Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 22 Aug 2008 09:00:32 +0000 Subject: - fixes a bug in RemoteAdminPlugin where CreateRegion would not pay attention to regionload_regionsdir from OpenSim.ini - fixes a type on RegionLoaderFileSystem --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index c345fce..4667070 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -33,11 +33,11 @@ namespace OpenSim.Framework.RegionLoader.Filesystem { public class RegionLoaderFileSystem : IRegionLoader { - private IConfigSource m_configSouce; + private IConfigSource m_configSource; public void SetIniConfigSource(IConfigSource configSource) { - m_configSouce = configSource; + m_configSource = configSource; } public RegionInfo[] LoadRegions() @@ -46,7 +46,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem try { - IConfig startupConfig = (IConfig)m_configSouce.Configs["Startup"]; + IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); } catch (Exception) -- cgit v1.1 From 109aa00150aea01ba32620b4d965edd459827ff7 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 2 Sep 2008 12:07:23 +0000 Subject: fix: PostInitialise() not being called on script engines (nasty one that) cleanup: warnings, readability --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 4667070..a371851 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -70,7 +70,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; for (int i = 0; i < configFiles.Length; i++) { - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i],false); + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false); regionInfos[i] = regionInfo; } -- cgit v1.1 From 7d89e122930be39e84a6d174548fa2d12ac0484a Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 6 Sep 2008 07:52:41 +0000 Subject: * This is the fabled LibOMV update with all of the libOMV types from JHurliman * This is a HUGE OMG update and will definitely have unknown side effects.. so this is really only for the strong hearted at this point. Regular people should let the dust settle. * This has been tested to work with most basic functions. However.. make sure you back up 'everything' before using this. It's that big! * Essentially we're back at square 1 in the testing phase.. so lets identify things that broke. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index a371851..c7d317f 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -59,12 +59,12 @@ namespace OpenSim.Framework.RegionLoader.Filesystem Directory.CreateDirectory(regionConfigPath); } - string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + string[] configFiles = Directory.GetFiles(regionConfigPath, "*.Xml"); if (configFiles.Length == 0) { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false); - configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.Xml"), false); + configFiles = Directory.GetFiles(regionConfigPath, "*.Xml"); } RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; -- cgit v1.1 From 9e545c9984790ddeabba0bf86e229af90da09ad6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 6 Sep 2008 14:58:23 +0000 Subject: Mantis #2133 Thank you, Xugu Madison and ChrisDown, for a patch that fixes linux filename extensions from .Xml back to .xml --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index c7d317f..a371851 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -59,12 +59,12 @@ namespace OpenSim.Framework.RegionLoader.Filesystem Directory.CreateDirectory(regionConfigPath); } - string[] configFiles = Directory.GetFiles(regionConfigPath, "*.Xml"); + string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); if (configFiles.Length == 0) { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.Xml"), false); - configFiles = Directory.GetFiles(regionConfigPath, "*.Xml"); + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false); + configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; -- cgit v1.1 From 0138fdc5fddbe30924484686716465984e8f59c2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 2 Jan 2009 17:41:12 +0000 Subject: Allow some values that are set in OpenSim.ini to be set from region config XML as well. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index a371851..05ccc4d 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -63,14 +63,14 @@ namespace OpenSim.Framework.RegionLoader.Filesystem if (configFiles.Length == 0) { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false); + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false, m_configSource); configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; for (int i = 0; i < configFiles.Length; i++) { - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false); + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false, m_configSource); regionInfos[i] = regionInfo; } -- cgit v1.1 From 840de6c036570d559ec6924cd8405d3f34a99fdd Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 1 Jun 2009 06:37:14 +0000 Subject: Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 05ccc4d..c58c41d 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -9,7 +9,7 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the + * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -- cgit v1.1 From d9528bd06e770d9d0bfc1c34d83abb02e7489e66 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Jun 2009 15:48:54 +0000 Subject: Allow the reading of ini files instead of xml files when reading region definitions from the file system --- .../Filesystem/RegionLoaderFileSystem.cs | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index c58c41d..b4b15e4 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.IO; using Nini.Config; @@ -60,21 +61,37 @@ namespace OpenSim.Framework.RegionLoader.Filesystem } string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); - if (configFiles.Length == 0) + if (configFiles.Length == 0 && iniFiles.Length == 0) { new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false, m_configSource); configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); } - RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; - for (int i = 0; i < configFiles.Length; i++) + List regionInfos = new List(); + + int i = 0; + foreach (string file in iniFiles) + { + IConfigSource source = new IniConfigSource(file); + + foreach (IConfig config in source.Configs) + { + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); + regionInfos.Add(regionInfo); + i++; + } + } + + foreach (string file in configFiles) { - RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false, m_configSource); - regionInfos[i] = regionInfo; + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); + regionInfos.Add(regionInfo); + i++; } - return regionInfos; + return regionInfos.ToArray(); } } } -- cgit v1.1 From 82305b0dea88daef96cecd09a3635814d0dfd6d6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Jun 2009 17:53:03 +0000 Subject: From this version onwards, all new region files created automatically will be created as new style INI files. This doesn't yet affect create region, but it does affect first starts of OpenSim.exe Because master avatars are slated to be replaced by estate owners, this now allows regions to be created without any master avatar data. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index b4b15e4..44f44fe 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -65,8 +65,8 @@ namespace OpenSim.Framework.RegionLoader.Filesystem if (configFiles.Length == 0 && iniFiles.Length == 0) { - new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false, m_configSource); - configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); + new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); + iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); } List regionInfos = new List(); -- cgit v1.1 From 25313c21053edf4cb44fc00d82b7c5456640c1ce Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 6 Sep 2009 21:52:11 +1000 Subject: * Debugging why region loading is occurring so slowly on a setup with 64 regions in a Regions.ini (took 38 minutes on my test box) --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 44f44fe..42f3934 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -78,6 +78,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem foreach (IConfig config in source.Configs) { + m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name); RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); regionInfos.Add(regionInfo); i++; -- cgit v1.1 From 5e4b7be7120b60a133338ea98ef4e7effd321e76 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 6 Sep 2009 21:53:03 +1000 Subject: * Typo in previous commit. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 42f3934..63e09ae 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -78,7 +78,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem foreach (IConfig config in source.Configs) { - m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name); + //m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name); RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); regionInfos.Add(regionInfo); i++; -- cgit v1.1 From ea72745d43c2c6eced8329801ff8765746be7ddd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Mar 2011 23:18:47 +0000 Subject: Log the xml/ini regions config files that opensim loads from, and the regions that it loaded from them This will show up with the lines [REGION LOADER FILE SYSTEM]: Loading config files from ./Regions, etc. --- .../Filesystem/RegionLoaderFileSystem.cs | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 63e09ae..7cbd5ed 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -25,15 +25,19 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using log4net; using System; using System.Collections.Generic; using System.IO; +using System.Reflection; using Nini.Config; namespace OpenSim.Framework.RegionLoader.Filesystem { public class RegionLoaderFileSystem : IRegionLoader { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private IConfigSource m_configSource; public void SetIniConfigSource(IConfigSource configSource) @@ -63,36 +67,48 @@ namespace OpenSim.Framework.RegionLoader.Filesystem string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); + // Create an empty Regions.ini if there are no existing config files. if (configFiles.Length == 0 && iniFiles.Length == 0) - { + { new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); } + + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); List regionInfos = new List(); int i = 0; foreach (string file in iniFiles) { + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); + IConfigSource source = new IniConfigSource(file); foreach (IConfig config in source.Configs) - { - //m_log.Info("[REGIONLOADERFILESYSTEM]: Creating RegionInfo for " + config.Name); + { RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); regionInfos.Add(regionInfo); + + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded region {0}", regionInfo.RegionName); + i++; } } foreach (string file in configFiles) { + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); + RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); regionInfos.Add(regionInfo); + + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded region {0}", regionInfo.RegionName); + i++; } return regionInfos.ToArray(); } } -} +} \ No newline at end of file -- cgit v1.1 From d8e1c380e67512e0476b2a7b7441ae3acbb4606f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Mar 2011 23:36:58 +0000 Subject: minor: make it clearer in the log where we're loading region config files and not the regions themselves --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 7cbd5ed..0aae4ff 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -90,7 +90,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); regionInfos.Add(regionInfo); - m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded region {0}", regionInfo.RegionName); + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); i++; } @@ -103,7 +103,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); regionInfos.Add(regionInfo); - m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded region {0}", regionInfo.RegionName); + m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); i++; } -- cgit v1.1 From 39d7945efc8daa6e5cd0f4728b499e7a624526cd Mon Sep 17 00:00:00 2001 From: Kevin Houlihan & Michelle Argus Date: Wed, 21 Sep 2011 22:46:14 +0100 Subject: Added a setting to [Startup] section of config that will allow the simulator to start up with no regions configured. I added the boolean config setting "allow_regionless", defaulting to false. If set to true, opensim will start up ok if no region configurations are found in the specified region_info_source. It will not ask the user to create a region. --- OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs') diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index 0aae4ff..8332c14 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs @@ -48,11 +48,13 @@ namespace OpenSim.Framework.RegionLoader.Filesystem public RegionInfo[] LoadRegions() { string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); + bool allowRegionless = false; try { IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); + allowRegionless = startupConfig.GetBoolean("allow_regionless", false); } catch (Exception) { @@ -68,7 +70,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); // Create an empty Regions.ini if there are no existing config files. - if (configFiles.Length == 0 && iniFiles.Length == 0) + if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) { new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); -- cgit v1.1