diff options
author | lbsa71 | 2007-10-31 07:28:23 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-31 07:28:23 +0000 |
commit | 064404ab409ddd0a3b25027a98582696295c46fd (patch) | |
tree | bd84ec2e23930f76e7cc81c8529ef71936c86dd9 /OpenSim/Framework/GridConfig.cs | |
parent | made illogical bitwise operations logical (diff) | |
download | opensim-SC-064404ab409ddd0a3b25027a98582696295c46fd.zip opensim-SC-064404ab409ddd0a3b25027a98582696295c46fd.tar.gz opensim-SC-064404ab409ddd0a3b25027a98582696295c46fd.tar.bz2 opensim-SC-064404ab409ddd0a3b25027a98582696295c46fd.tar.xz |
* Moved OpenSim/Framework/General to OpenSim/Framework for great justice.
Diffstat (limited to 'OpenSim/Framework/GridConfig.cs')
-rw-r--r-- | OpenSim/Framework/GridConfig.cs | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs new file mode 100644 index 0000000..021e6c5 --- /dev/null +++ b/OpenSim/Framework/GridConfig.cs | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | namespace OpenSim.Framework | ||
30 | { | ||
31 | public class GridConfig | ||
32 | { | ||
33 | public string GridOwner = ""; | ||
34 | public string DefaultAssetServer = ""; | ||
35 | public string AssetSendKey = ""; | ||
36 | public string AssetRecvKey = ""; | ||
37 | |||
38 | public string DefaultUserServer = ""; | ||
39 | public string UserSendKey = ""; | ||
40 | public string UserRecvKey = ""; | ||
41 | |||
42 | public string SimSendKey = ""; | ||
43 | public string SimRecvKey = ""; | ||
44 | |||
45 | public string DatabaseProvider = ""; | ||
46 | |||
47 | public static uint DefaultHttpPort = 8001; | ||
48 | public uint HttpPort = DefaultHttpPort; | ||
49 | |||
50 | private ConfigurationMember configMember; | ||
51 | |||
52 | public GridConfig(string description, string filename) | ||
53 | { | ||
54 | configMember = | ||
55 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration); | ||
56 | configMember.performConfigurationRetrieve(); | ||
57 | } | ||
58 | |||
59 | public void loadConfigurationOptions() | ||
60 | { | ||
61 | configMember.addConfigurationOption("grid_owner", | ||
62 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
63 | "OGS Grid Owner", "OGS development team", false); | ||
64 | configMember.addConfigurationOption("default_asset_server", | ||
65 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
66 | "Default Asset Server URI", | ||
67 | "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/", | ||
68 | false); | ||
69 | configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
70 | "Key to send to asset server", "null", false); | ||
71 | configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
72 | "Key to expect from asset server", "null", false); | ||
73 | |||
74 | configMember.addConfigurationOption("default_user_server", | ||
75 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
76 | "Default User Server URI", | ||
77 | "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false); | ||
78 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
79 | "Key to send to user server", "null", false); | ||
80 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
81 | "Key to expect from user server", "null", false); | ||
82 | |||
83 | configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
84 | "Key to send to a simulator", "null", false); | ||
85 | configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
86 | "Key to expect from a simulator", "null", false); | ||
87 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
88 | "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | ||
89 | |||
90 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
91 | "Http Listener port", DefaultHttpPort.ToString(), false); | ||
92 | } | ||
93 | |||
94 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
95 | { | ||
96 | switch (configuration_key) | ||
97 | { | ||
98 | case "grid_owner": | ||
99 | GridOwner = (string) configuration_result; | ||
100 | break; | ||
101 | case "default_asset_server": | ||
102 | DefaultAssetServer = (string) configuration_result; | ||
103 | break; | ||
104 | case "asset_send_key": | ||
105 | AssetSendKey = (string) configuration_result; | ||
106 | break; | ||
107 | case "asset_recv_key": | ||
108 | AssetRecvKey = (string) configuration_result; | ||
109 | break; | ||
110 | case "default_user_server": | ||
111 | DefaultUserServer = (string) configuration_result; | ||
112 | break; | ||
113 | case "user_send_key": | ||
114 | UserSendKey = (string) configuration_result; | ||
115 | break; | ||
116 | case "user_recv_key": | ||
117 | UserRecvKey = (string) configuration_result; | ||
118 | break; | ||
119 | case "sim_send_key": | ||
120 | SimSendKey = (string) configuration_result; | ||
121 | break; | ||
122 | case "sim_recv_key": | ||
123 | SimRecvKey = (string) configuration_result; | ||
124 | break; | ||
125 | case "database_provider": | ||
126 | DatabaseProvider = (string) configuration_result; | ||
127 | break; | ||
128 | case "http_port": | ||
129 | HttpPort = (uint) configuration_result; | ||
130 | break; | ||
131 | } | ||
132 | |||
133 | return true; | ||
134 | } | ||
135 | } | ||
136 | } \ No newline at end of file | ||