diff options
author | mingchen | 2007-07-18 23:15:08 +0000 |
---|---|---|
committer | mingchen | 2007-07-18 23:15:08 +0000 |
commit | 222becc8795d8abd8263c8abf8212de91faa4748 (patch) | |
tree | ac0eb1b420c2f60975b759296c94813f41925798 /OpenSim/Region/Application | |
parent | * Reverting 1371 (diff) | |
download | opensim-SC_OLD-222becc8795d8abd8263c8abf8212de91faa4748.zip opensim-SC_OLD-222becc8795d8abd8263c8abf8212de91faa4748.tar.gz opensim-SC_OLD-222becc8795d8abd8263c8abf8212de91faa4748.tar.bz2 opensim-SC_OLD-222becc8795d8abd8263c8abf8212de91faa4748.tar.xz |
*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 :)
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 38 |
1 files changed, 8 insertions, 30 deletions
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; | |||
37 | using OpenSim.Framework.Interfaces; | 37 | using OpenSim.Framework.Interfaces; |
38 | using OpenSim.Framework.Servers; | 38 | using OpenSim.Framework.Servers; |
39 | using OpenSim.Framework.Types; | 39 | using OpenSim.Framework.Types; |
40 | using OpenSim.GenericConfig; | 40 | using OpenSim.Framework.Configuration; |
41 | using OpenSim.Physics.Manager; | 41 | using OpenSim.Physics.Manager; |
42 | using OpenSim.Region.Caches; | 42 | using OpenSim.Region.Caches; |
43 | using OpenSim.Region.ClientStack; | 43 | using OpenSim.Region.ClientStack; |
@@ -85,6 +85,9 @@ namespace OpenSim | |||
85 | /// </summary> | 85 | /// </summary> |
86 | public override void StartUp() | 86 | public override void StartUp() |
87 | { | 87 | { |
88 | m_log = new LogBase(m_logFilename, "Region", this, m_silent); | ||
89 | MainLog.Instance = m_log; | ||
90 | |||
88 | base.StartUp(); | 91 | base.StartUp(); |
89 | 92 | ||
90 | if (!m_sandbox) | 93 | if (!m_sandbox) |
@@ -108,27 +111,16 @@ namespace OpenSim | |||
108 | { | 111 | { |
109 | string path2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions"); | 112 | string path2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions"); |
110 | string path3 = Path.Combine(path2, "default.xml"); | 113 | string path3 = Path.Combine(path2, "default.xml"); |
111 | Console.WriteLine("Creating default region config file"); | 114 | |
112 | //TODO create default region | 115 | RegionInfo regionInfo = new RegionInfo("DEFAULT REGION CONFIG", path3); |
113 | IGenericConfig defaultConfig = new XmlConfig(path3); | ||
114 | defaultConfig.LoadData(); | ||
115 | defaultConfig.Commit(); | ||
116 | defaultConfig.Close(); | ||
117 | defaultConfig = null; | ||
118 | configFiles = Directory.GetFiles(path, "*.xml"); | 116 | configFiles = Directory.GetFiles(path, "*.xml"); |
119 | } | 117 | } |
120 | 118 | ||
121 | for (int i = 0; i < configFiles.Length; i++) | 119 | for (int i = 0; i < configFiles.Length; i++) |
122 | { | 120 | { |
123 | Console.WriteLine("Loading region config file"); | 121 | Console.WriteLine("Loading region config file"); |
124 | 122 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i]); | |
125 | IGenericConfig regionConfig = new XmlConfig(configFiles[i]); | 123 | |
126 | RegionInfo regionInfo = new RegionInfo(); | ||
127 | regionConfig.LoadData(); | ||
128 | regionInfo.InitConfig(this.m_sandbox, regionConfig); | ||
129 | regionConfig.Close(); | ||
130 | |||
131 | |||
132 | UDPServer udpServer; | 124 | UDPServer udpServer; |
133 | Scene scene = SetupScene(regionInfo, out udpServer); | 125 | Scene scene = SetupScene(regionInfo, out udpServer); |
134 | 126 | ||
@@ -159,21 +151,7 @@ namespace OpenSim | |||
159 | 151 | ||
160 | protected override void Initialize() | 152 | protected override void Initialize() |
161 | { | 153 | { |
162 | IGenericConfig localConfig = new XmlConfig(m_configFileName); | ||
163 | localConfig.LoadData(); | ||
164 | |||
165 | if (m_useConfigFile) | ||
166 | { | ||
167 | SetupFromConfigFile(localConfig); | ||
168 | } | ||
169 | |||
170 | StartLog(); | ||
171 | |||
172 | m_networkServersInfo.InitConfig(m_sandbox, localConfig); | ||
173 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; | 154 | m_httpServerPort = m_networkServersInfo.HttpListenerPort; |
174 | |||
175 | localConfig.Close(); | ||
176 | |||
177 | m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); | 155 | m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey); |
178 | } | 156 | } |
179 | 157 | ||