diff options
Diffstat (limited to 'OpenSim/Framework/General/Configuration/AssetConfig.cs')
-rw-r--r-- | OpenSim/Framework/General/Configuration/AssetConfig.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/Configuration/AssetConfig.cs b/OpenSim/Framework/General/Configuration/AssetConfig.cs new file mode 100644 index 0000000..e5f1c88 --- /dev/null +++ b/OpenSim/Framework/General/Configuration/AssetConfig.cs | |||
@@ -0,0 +1,54 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework.Configuration | ||
6 | { | ||
7 | /// <summary> | ||
8 | /// UserConfig -- For User Server Configuration | ||
9 | /// </summary> | ||
10 | public class AssetConfig | ||
11 | { | ||
12 | public string DefaultStartupMsg = ""; | ||
13 | |||
14 | public string DatabaseProvider = ""; | ||
15 | |||
16 | public uint HttpPort = 8003; | ||
17 | |||
18 | private ConfigurationMember configMember; | ||
19 | |||
20 | public AssetConfig(string description, string filename) | ||
21 | { | ||
22 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); | ||
23 | configMember.performConfigurationRetrieve(); | ||
24 | } | ||
25 | |||
26 | public void loadConfigurationOptions() | ||
27 | { | ||
28 | configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS", false); | ||
29 | |||
30 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | ||
31 | |||
32 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", "8003", false); | ||
33 | |||
34 | } | ||
35 | |||
36 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
37 | { | ||
38 | switch (configuration_key) | ||
39 | { | ||
40 | case "default_startup_message": | ||
41 | this.DefaultStartupMsg = (string)configuration_result; | ||
42 | break; | ||
43 | case "database_provider": | ||
44 | this.DatabaseProvider = (string)configuration_result; | ||
45 | break; | ||
46 | case "http_port": | ||
47 | HttpPort = (uint)configuration_result; | ||
48 | break; | ||
49 | } | ||
50 | |||
51 | return true; | ||
52 | } | ||
53 | } | ||
54 | } | ||