diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/General/GridConfig.cs (renamed from OpenSim/Framework/General/Configuration/GridConfig.cs) | 242 |
1 files changed, 121 insertions, 121 deletions
diff --git a/OpenSim/Framework/General/Configuration/GridConfig.cs b/OpenSim/Framework/General/GridConfig.cs index 9020404..64ce3b1 100644 --- a/OpenSim/Framework/General/Configuration/GridConfig.cs +++ b/OpenSim/Framework/General/GridConfig.cs | |||
@@ -1,121 +1,121 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | 32 | ||
33 | namespace OpenSim.Framework.Configuration | 33 | namespace OpenSim.Framework |
34 | { | 34 | { |
35 | public class GridConfig | 35 | public class GridConfig |
36 | { | 36 | { |
37 | public string GridOwner = ""; | 37 | public string GridOwner = ""; |
38 | public string DefaultAssetServer = ""; | 38 | public string DefaultAssetServer = ""; |
39 | public string AssetSendKey = ""; | 39 | public string AssetSendKey = ""; |
40 | public string AssetRecvKey = ""; | 40 | public string AssetRecvKey = ""; |
41 | 41 | ||
42 | public string DefaultUserServer = ""; | 42 | public string DefaultUserServer = ""; |
43 | public string UserSendKey = ""; | 43 | public string UserSendKey = ""; |
44 | public string UserRecvKey = ""; | 44 | public string UserRecvKey = ""; |
45 | 45 | ||
46 | public string SimSendKey = ""; | 46 | public string SimSendKey = ""; |
47 | public string SimRecvKey = ""; | 47 | public string SimRecvKey = ""; |
48 | 48 | ||
49 | public string DatabaseProvider = ""; | 49 | public string DatabaseProvider = ""; |
50 | 50 | ||
51 | public static uint DefaultHttpPort = 8001; | 51 | public static uint DefaultHttpPort = 8001; |
52 | public uint HttpPort = DefaultHttpPort; | 52 | public uint HttpPort = DefaultHttpPort; |
53 | 53 | ||
54 | private ConfigurationMember configMember; | 54 | private ConfigurationMember configMember; |
55 | public GridConfig(string description, string filename) | 55 | public GridConfig(string description, string filename) |
56 | { | 56 | { |
57 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); | 57 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); |
58 | configMember.performConfigurationRetrieve(); | 58 | configMember.performConfigurationRetrieve(); |
59 | } | 59 | } |
60 | 60 | ||
61 | public void loadConfigurationOptions() | 61 | public void loadConfigurationOptions() |
62 | { | 62 | { |
63 | configMember.addConfigurationOption("grid_owner", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "OGS Grid Owner", "OGS development team", false); | 63 | configMember.addConfigurationOption("grid_owner", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "OGS Grid Owner", "OGS development team", false); |
64 | configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/", false); | 64 | configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString() + "/", false); |
65 | configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to asset server", "null", false); | 65 | configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to asset server", "null", false); |
66 | configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from asset server", "null", false); | 66 | configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from asset server", "null", false); |
67 | 67 | ||
68 | configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false); | 68 | configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false); |
69 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); | 69 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); |
70 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); | 70 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); |
71 | 71 | ||
72 | configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to a simulator", "null", false); | 72 | configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to a simulator", "null", false); |
73 | configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from a simulator", "null", false); | 73 | configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from a simulator", "null", false); |
74 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | 74 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); |
75 | 75 | ||
76 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", DefaultHttpPort.ToString(), false); | 76 | configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "Http Listener port", DefaultHttpPort.ToString(), false); |
77 | } | 77 | } |
78 | 78 | ||
79 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 79 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
80 | { | 80 | { |
81 | switch (configuration_key) | 81 | switch (configuration_key) |
82 | { | 82 | { |
83 | case "grid_owner": | 83 | case "grid_owner": |
84 | this.GridOwner = (string)configuration_result; | 84 | this.GridOwner = (string)configuration_result; |
85 | break; | 85 | break; |
86 | case "default_asset_server": | 86 | case "default_asset_server": |
87 | this.DefaultAssetServer = (string)configuration_result; | 87 | this.DefaultAssetServer = (string)configuration_result; |
88 | break; | 88 | break; |
89 | case "asset_send_key": | 89 | case "asset_send_key": |
90 | this.AssetSendKey = (string)configuration_result; | 90 | this.AssetSendKey = (string)configuration_result; |
91 | break; | 91 | break; |
92 | case "asset_recv_key": | 92 | case "asset_recv_key": |
93 | this.AssetRecvKey = (string)configuration_result; | 93 | this.AssetRecvKey = (string)configuration_result; |
94 | break; | 94 | break; |
95 | case "default_user_server": | 95 | case "default_user_server": |
96 | this.DefaultUserServer = (string)configuration_result; | 96 | this.DefaultUserServer = (string)configuration_result; |
97 | break; | 97 | break; |
98 | case "user_send_key": | 98 | case "user_send_key": |
99 | this.UserSendKey = (string)configuration_result; | 99 | this.UserSendKey = (string)configuration_result; |
100 | break; | 100 | break; |
101 | case "user_recv_key": | 101 | case "user_recv_key": |
102 | this.UserRecvKey = (string)configuration_result; | 102 | this.UserRecvKey = (string)configuration_result; |
103 | break; | 103 | break; |
104 | case "sim_send_key": | 104 | case "sim_send_key": |
105 | this.SimSendKey = (string)configuration_result; | 105 | this.SimSendKey = (string)configuration_result; |
106 | break; | 106 | break; |
107 | case "sim_recv_key": | 107 | case "sim_recv_key": |
108 | this.SimRecvKey = (string)configuration_result; | 108 | this.SimRecvKey = (string)configuration_result; |
109 | break; | 109 | break; |
110 | case "database_provider": | 110 | case "database_provider": |
111 | this.DatabaseProvider = (string)configuration_result; | 111 | this.DatabaseProvider = (string)configuration_result; |
112 | break; | 112 | break; |
113 | case "http_port": | 113 | case "http_port": |
114 | HttpPort = (uint)configuration_result; | 114 | HttpPort = (uint)configuration_result; |
115 | break; | 115 | break; |
116 | } | 116 | } |
117 | 117 | ||
118 | return true; | 118 | return true; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |