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/Grid | |
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/Grid')
-rw-r--r-- | OpenSim/Grid/GridServer/GridManager.cs | 2 | ||||
-rw-r--r-- | OpenSim/Grid/GridServer/Main.cs | 42 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 40 |
3 files changed, 8 insertions, 76 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index b3ba4e5..2e7f9f7 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -38,6 +38,8 @@ using OpenSim.Framework.Data; | |||
38 | using OpenSim.Framework.Interfaces; | 38 | using OpenSim.Framework.Interfaces; |
39 | using OpenSim.Framework.Utilities; | 39 | using OpenSim.Framework.Utilities; |
40 | 40 | ||
41 | using OpenSim.Framework.Configuration; | ||
42 | |||
41 | namespace OpenSim.Grid.GridServer | 43 | namespace OpenSim.Grid.GridServer |
42 | { | 44 | { |
43 | class GridManager | 45 | class GridManager |
diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 09aeab5..85bd918 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs | |||
@@ -33,7 +33,8 @@ using System.Timers; | |||
33 | using OpenSim.Framework.Console; | 33 | using OpenSim.Framework.Console; |
34 | using OpenSim.Framework.Interfaces; | 34 | using OpenSim.Framework.Interfaces; |
35 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
36 | using OpenSim.GenericConfig; | 36 | using OpenSim.Framework.Configuration; |
37 | |||
37 | using Timer=System.Timers.Timer; | 38 | using Timer=System.Timers.Timer; |
38 | 39 | ||
39 | namespace OpenSim.Grid.GridServer | 40 | namespace OpenSim.Grid.GridServer |
@@ -47,7 +48,6 @@ namespace OpenSim.Grid.GridServer | |||
47 | public GridConfig Cfg; | 48 | public GridConfig Cfg; |
48 | 49 | ||
49 | public static OpenGrid_Main thegrid; | 50 | public static OpenGrid_Main thegrid; |
50 | protected IGenericConfig localXMLConfig; | ||
51 | 51 | ||
52 | public static bool setuponly; | 52 | public static bool setuponly; |
53 | 53 | ||
@@ -105,14 +105,8 @@ namespace OpenSim.Grid.GridServer | |||
105 | 105 | ||
106 | public void Startup() | 106 | public void Startup() |
107 | { | 107 | { |
108 | this.localXMLConfig = new XmlConfig("GridServerConfig.xml"); | 108 | |
109 | this.localXMLConfig.LoadData(); | 109 | this.Cfg = new GridConfig("GRID SERVER","GridServer_Config.xml"); //Yeah srsly, that's it. |
110 | this.ConfigDB(this.localXMLConfig); | ||
111 | this.localXMLConfig.Close(); | ||
112 | |||
113 | m_console.Verbose( "Main.cs:Startup() - Loading configuration"); | ||
114 | Cfg = this.LoadConfigDll(this.ConfigDll); | ||
115 | Cfg.InitConfig(); | ||
116 | if (setuponly) Environment.Exit(0); | 110 | if (setuponly) Environment.Exit(0); |
117 | 111 | ||
118 | m_console.Verbose( "Main.cs:Startup() - Connecting to Storage Server"); | 112 | m_console.Verbose( "Main.cs:Startup() - Connecting to Storage Server"); |
@@ -148,34 +142,6 @@ namespace OpenSim.Grid.GridServer | |||
148 | simCheckTimer.Enabled = true; | 142 | simCheckTimer.Enabled = true; |
149 | } | 143 | } |
150 | 144 | ||
151 | private GridConfig LoadConfigDll(string dllName) | ||
152 | { | ||
153 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | ||
154 | GridConfig config = null; | ||
155 | |||
156 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
157 | { | ||
158 | if (pluginType.IsPublic) | ||
159 | { | ||
160 | if (!pluginType.IsAbstract) | ||
161 | { | ||
162 | Type typeInterface = pluginType.GetInterface("IGridConfig", true); | ||
163 | |||
164 | if (typeInterface != null) | ||
165 | { | ||
166 | IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
167 | config = plug.GetConfigObject(); | ||
168 | break; | ||
169 | } | ||
170 | |||
171 | typeInterface = null; | ||
172 | } | ||
173 | } | ||
174 | } | ||
175 | pluginAssembly = null; | ||
176 | return config; | ||
177 | } | ||
178 | |||
179 | public void CheckSims(object sender, ElapsedEventArgs e) | 145 | public void CheckSims(object sender, ElapsedEventArgs e) |
180 | { | 146 | { |
181 | /* | 147 | /* |
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 9bdf8d7..b702beb 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -35,7 +35,7 @@ using OpenSim.Framework.Interfaces; | |||
35 | using OpenSim.Framework.Servers; | 35 | using OpenSim.Framework.Servers; |
36 | using OpenSim.Framework.User; | 36 | using OpenSim.Framework.User; |
37 | using OpenSim.Framework.Utilities; | 37 | using OpenSim.Framework.Utilities; |
38 | using OpenSim.GenericConfig; | 38 | using OpenSim.Framework.Configuration; |
39 | 39 | ||
40 | namespace OpenSim.Grid.UserServer | 40 | namespace OpenSim.Grid.UserServer |
41 | { | 41 | { |
@@ -46,7 +46,6 @@ namespace OpenSim.Grid.UserServer | |||
46 | private string ConfigDll = "OpenSim.Grid.UserServer.Config.dll"; | 46 | private string ConfigDll = "OpenSim.Grid.UserServer.Config.dll"; |
47 | private string StorageDll = "OpenSim.Framework.Data.MySQL.dll"; | 47 | private string StorageDll = "OpenSim.Framework.Data.MySQL.dll"; |
48 | private UserConfig Cfg; | 48 | private UserConfig Cfg; |
49 | protected IGenericConfig localXMLConfig; | ||
50 | 49 | ||
51 | public UserManager m_userManager; | 50 | public UserManager m_userManager; |
52 | 51 | ||
@@ -83,14 +82,7 @@ namespace OpenSim.Grid.UserServer | |||
83 | 82 | ||
84 | public void Startup() | 83 | public void Startup() |
85 | { | 84 | { |
86 | this.localXMLConfig = new XmlConfig("UserServerConfig.xml"); | 85 | this.Cfg = new UserConfig("USER SERVER", "UserServer_Config.xml"); |
87 | this.localXMLConfig.LoadData(); | ||
88 | this.ConfigDB(this.localXMLConfig); | ||
89 | this.localXMLConfig.Close(); | ||
90 | |||
91 | MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration"); | ||
92 | Cfg = this.LoadConfigDll(this.ConfigDll); | ||
93 | Cfg.InitConfig(); | ||
94 | 86 | ||
95 | MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); | 87 | MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); |
96 | m_userManager = new UserManager(); | 88 | m_userManager = new UserManager(); |
@@ -179,34 +171,6 @@ namespace OpenSim.Grid.UserServer | |||
179 | } | 171 | } |
180 | } | 172 | } |
181 | 173 | ||
182 | private UserConfig LoadConfigDll(string dllName) | ||
183 | { | ||
184 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | ||
185 | UserConfig config = null; | ||
186 | |||
187 | foreach (Type pluginType in pluginAssembly.GetTypes()) | ||
188 | { | ||
189 | if (pluginType.IsPublic) | ||
190 | { | ||
191 | if (!pluginType.IsAbstract) | ||
192 | { | ||
193 | Type typeInterface = pluginType.GetInterface("IUserConfig", true); | ||
194 | |||
195 | if (typeInterface != null) | ||
196 | { | ||
197 | IUserConfig plug = (IUserConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | ||
198 | config = plug.GetConfigObject(); | ||
199 | break; | ||
200 | } | ||
201 | |||
202 | typeInterface = null; | ||
203 | } | ||
204 | } | ||
205 | } | ||
206 | pluginAssembly = null; | ||
207 | return config; | ||
208 | } | ||
209 | |||
210 | public void Show(string ShowWhat) | 174 | public void Show(string ShowWhat) |
211 | { | 175 | { |
212 | } | 176 | } |