aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/General/Configuration/UserConfig.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/General/Configuration/UserConfig.cs')
-rw-r--r--OpenSim/Framework/General/Configuration/UserConfig.cs55
1 files changed, 55 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/Configuration/UserConfig.cs b/OpenSim/Framework/General/Configuration/UserConfig.cs
new file mode 100644
index 0000000..9d607b3
--- /dev/null
+++ b/OpenSim/Framework/General/Configuration/UserConfig.cs
@@ -0,0 +1,55 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework.Configuration
6{
7 /// <summary>
8 /// UserConfig -- For User Server Configuration
9 /// </summary>
10 public class UserConfig
11 {
12 public string DefaultStartupMsg = "";
13 public string GridServerURL = "";
14 public string GridSendKey = "";
15 public string GridRecvKey = "";
16
17 private ConfigurationMember configMember;
18
19 public UserConfig(string description, string filename)
20 {
21 configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration);
22 configMember.performConfigurationRetrieve();
23 }
24
25 public void loadConfigurationOptions()
26 {
27 configMember.addConfigurationOption("default_startup_message",ConfigurationOption.ConfigurationTypes.TYPE_STRING,"Default Startup Message","Welcome to OGS");
28
29 configMember.addConfigurationOption("default_grid_server",ConfigurationOption.ConfigurationTypes.TYPE_STRING,"Default Grid Server URI","http://127.0.0.1:8001/");
30 configMember.addConfigurationOption("grid_send_key",ConfigurationOption.ConfigurationTypes.TYPE_STRING,"Key to send to grid server","null");
31 configMember.addConfigurationOption("grid_recv_key",ConfigurationOption.ConfigurationTypes.TYPE_STRING,"Key to expect from grid server","null");
32
33
34 }
35
36 public void 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 "default_grid_server":
44 this.GridServerURL = (string)configuration_result;
45 break;
46 case "grid_send_key":
47 this.GridSendKey = (string)configuration_result;
48 break;
49 case "grid_recv_key":
50 this.GridRecvKey = (string)configuration_result;
51 break;
52 }
53 }
54 }
55}