aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-11-05 18:24:40 +1000
committerDavid Walter Seikel2016-11-05 18:24:40 +1000
commit09531a03055f0f053bf55d860137c54c7f3a09b3 (patch)
tree7a5dcbe370de811692f19f26990711281f1d8715 /OpenSim
parentFix up maptiles location. (diff)
downloadopensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.zip
opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.tar.gz
opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.tar.bz2
opensim-SC-09531a03055f0f053bf55d860137c54c7f3a09b3.tar.xz
More config path fixes.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs45
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs5
-rw-r--r--OpenSim/Server/Handlers/BakedTextures/XBakes.cs4
3 files changed, 30 insertions, 24 deletions
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs
index 1873a06..130a523 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/RegionLoaderFileSystem.cs
@@ -38,7 +38,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
38 public class RegionLoaderFileSystem : IRegionLoader 38 public class RegionLoaderFileSystem : IRegionLoader
39 { 39 {
40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
41 41
42 private IConfigSource m_configSource; 42 private IConfigSource m_configSource;
43 43
44 public void SetIniConfigSource(IConfigSource configSource) 44 public void SetIniConfigSource(IConfigSource configSource)
@@ -48,7 +48,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
48 48
49 public RegionInfo[] LoadRegions() 49 public RegionInfo[] LoadRegions()
50 { 50 {
51 string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); 51 string regionConfigPath = Util.configDir();
52 bool allowRegionless = false; 52 bool allowRegionless = false;
53 53
54 try 54 try
@@ -68,47 +68,54 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
68 } 68 }
69 69
70 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 70 string[] configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
71 string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); 71//// Causes hangs with the actual .ini files.
72//// string[] iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
72 73
73 // Create an empty Regions.ini if there are no existing config files. 74 // Create an empty Regions.ini if there are no existing config files.
74 if (!allowRegionless && configFiles.Length == 0 && iniFiles.Length == 0) 75 if (!allowRegionless && configFiles.Length == 0 /*&& iniFiles.Length == 0*/)
75 { 76 {
76 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource); 77 new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "Regions.ini"), false, m_configSource);
77 iniFiles = Directory.GetFiles(regionConfigPath, "*.ini"); 78//// iniFiles = Directory.GetFiles(regionConfigPath, "*.ini");
78 } 79 }
79 80
80 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath); 81 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config files from {0}", regionConfigPath);
81 82
82 List<RegionInfo> regionInfos = new List<RegionInfo>(); 83 List<RegionInfo> regionInfos = new List<RegionInfo>();
83 84
84 int i = 0; 85 int i = 0;
86/*
85 foreach (string file in iniFiles) 87 foreach (string file in iniFiles)
86 { 88 {
87 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); 89 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
88 90
89 IConfigSource source = new IniConfigSource(file); 91 IConfigSource source = new IniConfigSource(file);
90 92
91 foreach (IConfig config in source.Configs) 93 foreach (IConfig config in source.Configs)
92 { 94 {
93 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name); 95 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
94 regionInfos.Add(regionInfo); 96 regionInfos.Add(regionInfo);
95 97
96 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); 98 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
97 99
98 i++; 100 i++;
99 } 101 }
100 } 102 }
101 103*/
102 foreach (string file in configFiles) 104 foreach (string file in configFiles)
103 { 105 {
104 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file); 106 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loading config file {0}", file);
105 107
106 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource); 108 IConfigSource source = new XmlConfigSource(file);
107 regionInfos.Add(regionInfo); 109
108 110 foreach (IConfig config in source.Configs)
109 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName); 111 {
110 112 RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), file, false, m_configSource, config.Name);
111 i++; 113 regionInfos.Add(regionInfo);
114
115 m_log.InfoFormat("[REGION LOADER FILE SYSTEM]: Loaded config for region {0}", regionInfo.RegionName);
116
117 i++;
118 }
112 } 119 }
113 120
114 return regionInfos.ToArray(); 121 return regionInfos.ToArray();
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index b19e549..cf7db97 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -154,15 +154,14 @@ namespace OpenSim
154 } 154 }
155 155
156 // Override distro settings with contents of inidirectory 156 // Override distro settings with contents of inidirectory
157 string iniDirName = startupConfig.GetString("inidirectory", "config"); 157 string iniDirPath = Path.GetFullPath(Path.Combine(Util.configDir(), startupConfig.GetString("inidirectory", "config")));
158 string iniDirPath = Path.Combine(Util.configDir(), iniDirName);
159 158
160 if (Directory.Exists(iniDirPath)) 159 if (Directory.Exists(iniDirPath))
161 { 160 {
162 m_log.InfoFormat("[CONFIG]: Searching folder {0} for config ini files", iniDirPath); 161 m_log.InfoFormat("[CONFIG]: Searching folder {0} for config ini files", iniDirPath);
163 List<string> overrideSources = new List<string>(); 162 List<string> overrideSources = new List<string>();
164 163
165 string[] fileEntries = Directory.GetFiles(iniDirName); 164 string[] fileEntries = Directory.GetFiles(iniDirPath);
166 foreach (string filePath in fileEntries) 165 foreach (string filePath in fileEntries)
167 { 166 {
168 if (Path.GetExtension(filePath).ToLower() == ".ini") 167 if (Path.GetExtension(filePath).ToLower() == ".ini")
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakes.cs b/OpenSim/Server/Handlers/BakedTextures/XBakes.cs
index 4e55433..a63c9a1 100644
--- a/OpenSim/Server/Handlers/BakedTextures/XBakes.cs
+++ b/OpenSim/Server/Handlers/BakedTextures/XBakes.cs
@@ -70,9 +70,9 @@ namespace OpenSim.Server.Handlers.BakedTextures
70 m_FSBase = assetConfig.GetString("BaseDirectory", String.Empty); 70 m_FSBase = assetConfig.GetString("BaseDirectory", String.Empty);
71 if (m_FSBase == String.Empty) 71 if (m_FSBase == String.Empty)
72 { 72 {
73 m_log.ErrorFormat("[BAKES]: BaseDirectory not specified"); 73 m_FSBase = "bakes";
74 throw new Exception("Configuration error");
75 } 74 }
75 m_FSBase = "../../caches/" + m_FSBase;
76 76
77 m_log.Info("[BAKES]: XBakes service enabled"); 77 m_log.Info("[BAKES]: XBakes service enabled");
78 } 78 }