aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimMain.cs
diff options
context:
space:
mode:
authorBrian McBee2007-08-03 18:01:55 +0000
committerBrian McBee2007-08-03 18:01:55 +0000
commit599a6d32eebc451f9284db8e6abf2946f236d5e9 (patch)
tree60ca29aaa58b0cf34b5f0514c95229602036895c /OpenSim/Region/Application/OpenSimMain.cs
parentYet another commit related to the SceneObject rewrites. (diff)
downloadopensim-SC_OLD-599a6d32eebc451f9284db8e6abf2946f236d5e9.zip
opensim-SC_OLD-599a6d32eebc451f9284db8e6abf2946f236d5e9.tar.gz
opensim-SC_OLD-599a6d32eebc451f9284db8e6abf2946f236d5e9.tar.bz2
opensim-SC_OLD-599a6d32eebc451f9284db8e6abf2946f236d5e9.tar.xz
Changes to prepare for future possible configuration of separate logdir, configdir, datadir.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs26
1 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index f830978..fbd6790 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -68,7 +68,7 @@ namespace OpenSim
68 protected List<IScene> m_localScenes = new List<IScene>(); 68 protected List<IScene> m_localScenes = new List<IScene>();
69 69
70 private bool m_silent; 70 private bool m_silent;
71 private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log"; 71 private string m_logFilename = ("region-console-" + Guid.NewGuid().ToString() + ".log");
72 72
73 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngineName, bool useConfigFile, bool silent, string configFileName) 73 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngineName, bool useConfigFile, bool silent, string configFileName)
74 :base( ) 74 :base( )
@@ -87,7 +87,11 @@ namespace OpenSim
87 /// </summary> 87 /// </summary>
88 public override void StartUp() 88 public override void StartUp()
89 { 89 {
90 m_log = new LogBase(m_logFilename, "Region", this, m_silent); 90 if (!Directory.Exists(Util.logDir()))
91 {
92 Directory.CreateDirectory(Util.logDir());
93 }
94 m_log = new LogBase(Path.Combine(Util.logDir(),m_logFilename), "Region", this, m_silent);
91 MainLog.Instance = m_log; 95 MainLog.Instance = m_log;
92 96
93 base.StartUp(); 97 base.StartUp();
@@ -106,12 +110,17 @@ namespace OpenSim
106 m_commsManager = new CommunicationsOGS1( m_networkServersInfo, m_httpServer , m_assetCache); 110 m_commsManager = new CommunicationsOGS1( m_networkServersInfo, m_httpServer , m_assetCache);
107 } 111 }
108 112
109 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions"); 113
114 string path = Path.Combine(Util.configDir(), "Regions");
115 if (!Directory.Exists(path))
116 {
117 Directory.CreateDirectory(path);
118 }
110 string[] configFiles = Directory.GetFiles(path, "*.xml"); 119 string[] configFiles = Directory.GetFiles(path, "*.xml");
111 120
112 if (configFiles.Length == 0) 121 if (configFiles.Length == 0)
113 { 122 {
114 string path2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions"); 123 string path2 = Path.Combine(Util.configDir(), "Regions");
115 string path3 = Path.Combine(path2, "default.xml"); 124 string path3 = Path.Combine(path2, "default.xml");
116 125
117 RegionInfo regionInfo = new RegionInfo("DEFAULT REGION CONFIG", path3); 126 RegionInfo regionInfo = new RegionInfo("DEFAULT REGION CONFIG", path3);
@@ -154,14 +163,19 @@ namespace OpenSim
154 163
155 protected override void Initialize() 164 protected override void Initialize()
156 { 165 {
157 m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", "network_servers_information.xml"); 166 m_networkServersInfo = new NetworkServersInfo("NETWORK SERVERS INFO", Path.Combine(Util.configDir(),"network_servers_information.xml"));
158 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 167 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
159 m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); 168 m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
160 } 169 }
161 170
162 protected override LogBase CreateLog() 171 protected override LogBase CreateLog()
163 { 172 {
164 return new LogBase(m_logFilename, "Region", this, m_silent); 173 if (!Directory.Exists(Util.logDir()))
174 {
175 Directory.CreateDirectory(Util.logDir());
176 }
177
178 return new LogBase((Path.Combine(Util.logDir(),m_logFilename)), "Region", this, m_silent);
165 } 179 }
166 180
167 # region Setup methods 181 # region Setup methods