diff options
Diffstat (limited to 'OpenSim/Framework/General/Types/NetworkServersInfo.cs')
-rw-r--r-- | OpenSim/Framework/General/Types/NetworkServersInfo.cs | 438 |
1 files changed, 219 insertions, 219 deletions
diff --git a/OpenSim/Framework/General/Types/NetworkServersInfo.cs b/OpenSim/Framework/General/Types/NetworkServersInfo.cs index 900354c..6259d7b 100644 --- a/OpenSim/Framework/General/Types/NetworkServersInfo.cs +++ b/OpenSim/Framework/General/Types/NetworkServersInfo.cs | |||
@@ -1,219 +1,219 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.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 | using System; | 28 | using System; |
29 | using OpenSim.Framework.Console; | 29 | using OpenSim.Framework.Console; |
30 | using OpenSim.Framework.Interfaces; | 30 | using OpenSim.Framework.Interfaces; |
31 | 31 | ||
32 | namespace OpenSim.Framework.Types | 32 | namespace OpenSim.Framework.Types |
33 | { | 33 | { |
34 | public class NetworkServersInfo | 34 | public class NetworkServersInfo |
35 | { | 35 | { |
36 | public string AssetURL = "http://127.0.0.1:8003/"; | 36 | public string AssetURL = "http://127.0.0.1:8003/"; |
37 | public string AssetSendKey = ""; | 37 | public string AssetSendKey = ""; |
38 | 38 | ||
39 | public string GridURL = ""; | 39 | public string GridURL = ""; |
40 | public string GridSendKey = ""; | 40 | public string GridSendKey = ""; |
41 | public string GridRecvKey = ""; | 41 | public string GridRecvKey = ""; |
42 | public string UserURL = ""; | 42 | public string UserURL = ""; |
43 | public string UserSendKey = ""; | 43 | public string UserSendKey = ""; |
44 | public string UserRecvKey = ""; | 44 | public string UserRecvKey = ""; |
45 | public bool isSandbox; | 45 | public bool isSandbox; |
46 | 46 | ||
47 | public uint DefaultHomeLocX = 1000; | 47 | public uint DefaultHomeLocX = 1000; |
48 | public uint DefaultHomeLocY = 1000; | 48 | public uint DefaultHomeLocY = 1000; |
49 | 49 | ||
50 | public int HttpListenerPort = 9000; | 50 | public int HttpListenerPort = 9000; |
51 | public int RemotingListenerPort = 8895; | 51 | public int RemotingListenerPort = 8895; |
52 | 52 | ||
53 | public void InitConfig(bool sandboxMode, IGenericConfig configData) | 53 | public void InitConfig(bool sandboxMode, IGenericConfig configData) |
54 | { | 54 | { |
55 | this.isSandbox = sandboxMode; | 55 | this.isSandbox = sandboxMode; |
56 | 56 | ||
57 | try | 57 | try |
58 | { | 58 | { |
59 | string attri = ""; | 59 | string attri = ""; |
60 | 60 | ||
61 | attri = ""; | 61 | attri = ""; |
62 | attri = configData.GetAttribute("HttpListenerPort"); | 62 | attri = configData.GetAttribute("HttpListenerPort"); |
63 | if (attri == "") | 63 | if (attri == "") |
64 | { | 64 | { |
65 | string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); | 65 | string location = MainLog.Instance.CmdPrompt("Http Listener Port", "9000"); |
66 | configData.SetAttribute("HttpListenerPort", location); | 66 | configData.SetAttribute("HttpListenerPort", location); |
67 | this.HttpListenerPort = Convert.ToInt32(location); | 67 | this.HttpListenerPort = Convert.ToInt32(location); |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
71 | this.HttpListenerPort = Convert.ToInt32(attri); | 71 | this.HttpListenerPort = Convert.ToInt32(attri); |
72 | } | 72 | } |
73 | 73 | ||
74 | attri = ""; | 74 | attri = ""; |
75 | attri = configData.GetAttribute("RemotingListenerPort"); | 75 | attri = configData.GetAttribute("RemotingListenerPort"); |
76 | if (attri == "") | 76 | if (attri == "") |
77 | { | 77 | { |
78 | string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); | 78 | string location = MainLog.Instance.CmdPrompt("Remoting Listener Port", "8895"); |
79 | configData.SetAttribute("RemotingListenerPort", location); | 79 | configData.SetAttribute("RemotingListenerPort", location); |
80 | this.RemotingListenerPort = Convert.ToInt32(location); | 80 | this.RemotingListenerPort = Convert.ToInt32(location); |
81 | } | 81 | } |
82 | else | 82 | else |
83 | { | 83 | { |
84 | this.RemotingListenerPort = Convert.ToInt32(attri); | 84 | this.RemotingListenerPort = Convert.ToInt32(attri); |
85 | } | 85 | } |
86 | 86 | ||
87 | if (sandboxMode) | 87 | if (sandboxMode) |
88 | { | 88 | { |
89 | // default home location X | 89 | // default home location X |
90 | attri = ""; | 90 | attri = ""; |
91 | attri = configData.GetAttribute("DefaultLocationX"); | 91 | attri = configData.GetAttribute("DefaultLocationX"); |
92 | if (attri == "") | 92 | if (attri == "") |
93 | { | 93 | { |
94 | string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); | 94 | string location = MainLog.Instance.CmdPrompt("Default Home Location X", "1000"); |
95 | configData.SetAttribute("DefaultLocationX", location); | 95 | configData.SetAttribute("DefaultLocationX", location); |
96 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); | 96 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(location); |
97 | } | 97 | } |
98 | else | 98 | else |
99 | { | 99 | { |
100 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); | 100 | this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri); |
101 | } | 101 | } |
102 | 102 | ||
103 | // default home location Y | 103 | // default home location Y |
104 | attri = ""; | 104 | attri = ""; |
105 | attri = configData.GetAttribute("DefaultLocationY"); | 105 | attri = configData.GetAttribute("DefaultLocationY"); |
106 | if (attri == "") | 106 | if (attri == "") |
107 | { | 107 | { |
108 | string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); | 108 | string location = MainLog.Instance.CmdPrompt("Default Home Location Y", "1000"); |
109 | configData.SetAttribute("DefaultLocationY", location); | 109 | configData.SetAttribute("DefaultLocationY", location); |
110 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); | 110 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(location); |
111 | } | 111 | } |
112 | else | 112 | else |
113 | { | 113 | { |
114 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); | 114 | this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | if (!isSandbox) | 117 | if (!isSandbox) |
118 | { | 118 | { |
119 | //Grid Server | 119 | //Grid Server |
120 | attri = ""; | 120 | attri = ""; |
121 | attri = configData.GetAttribute("GridServerURL"); | 121 | attri = configData.GetAttribute("GridServerURL"); |
122 | if (attri == "") | 122 | if (attri == "") |
123 | { | 123 | { |
124 | this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); | 124 | this.GridURL = MainLog.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/"); |
125 | configData.SetAttribute("GridServerURL", this.GridURL); | 125 | configData.SetAttribute("GridServerURL", this.GridURL); |
126 | } | 126 | } |
127 | else | 127 | else |
128 | { | 128 | { |
129 | this.GridURL = attri; | 129 | this.GridURL = attri; |
130 | } | 130 | } |
131 | 131 | ||
132 | //Grid Send Key | 132 | //Grid Send Key |
133 | attri = ""; | 133 | attri = ""; |
134 | attri = configData.GetAttribute("GridSendKey"); | 134 | attri = configData.GetAttribute("GridSendKey"); |
135 | if (attri == "") | 135 | if (attri == "") |
136 | { | 136 | { |
137 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); | 137 | this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server", "null"); |
138 | configData.SetAttribute("GridSendKey", this.GridSendKey); | 138 | configData.SetAttribute("GridSendKey", this.GridSendKey); |
139 | } | 139 | } |
140 | else | 140 | else |
141 | { | 141 | { |
142 | this.GridSendKey = attri; | 142 | this.GridSendKey = attri; |
143 | } | 143 | } |
144 | 144 | ||
145 | //Grid Receive Key | 145 | //Grid Receive Key |
146 | attri = ""; | 146 | attri = ""; |
147 | attri = configData.GetAttribute("GridRecvKey"); | 147 | attri = configData.GetAttribute("GridRecvKey"); |
148 | if (attri == "") | 148 | if (attri == "") |
149 | { | 149 | { |
150 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); | 150 | this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server", "null"); |
151 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); | 151 | configData.SetAttribute("GridRecvKey", this.GridRecvKey); |
152 | } | 152 | } |
153 | else | 153 | else |
154 | { | 154 | { |
155 | this.GridRecvKey = attri; | 155 | this.GridRecvKey = attri; |
156 | } | 156 | } |
157 | 157 | ||
158 | //Grid Server | 158 | //Grid Server |
159 | attri = ""; | 159 | attri = ""; |
160 | attri = configData.GetAttribute("UserServerURL"); | 160 | attri = configData.GetAttribute("UserServerURL"); |
161 | if (attri == "") | 161 | if (attri == "") |
162 | { | 162 | { |
163 | this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); | 163 | this.UserURL= MainLog.Instance.CmdPrompt("User server URL", "http://127.0.0.1:8002/"); |
164 | configData.SetAttribute("UserServerURL", this.UserURL); | 164 | configData.SetAttribute("UserServerURL", this.UserURL); |
165 | } | 165 | } |
166 | else | 166 | else |
167 | { | 167 | { |
168 | this.UserURL = attri; | 168 | this.UserURL = attri; |
169 | } | 169 | } |
170 | 170 | ||
171 | //Grid Send Key | 171 | //Grid Send Key |
172 | attri = ""; | 172 | attri = ""; |
173 | attri = configData.GetAttribute("UserSendKey"); | 173 | attri = configData.GetAttribute("UserSendKey"); |
174 | if (attri == "") | 174 | if (attri == "") |
175 | { | 175 | { |
176 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); | 176 | this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server", "null"); |
177 | configData.SetAttribute("UserSendKey", this.UserSendKey); | 177 | configData.SetAttribute("UserSendKey", this.UserSendKey); |
178 | } | 178 | } |
179 | else | 179 | else |
180 | { | 180 | { |
181 | this.UserSendKey = attri; | 181 | this.UserSendKey = attri; |
182 | } | 182 | } |
183 | 183 | ||
184 | //Grid Receive Key | 184 | //Grid Receive Key |
185 | attri = ""; | 185 | attri = ""; |
186 | attri = configData.GetAttribute("UserRecvKey"); | 186 | attri = configData.GetAttribute("UserRecvKey"); |
187 | if (attri == "") | 187 | if (attri == "") |
188 | { | 188 | { |
189 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); | 189 | this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server", "null"); |
190 | configData.SetAttribute("UserRecvKey", this.UserRecvKey); | 190 | configData.SetAttribute("UserRecvKey", this.UserRecvKey); |
191 | } | 191 | } |
192 | else | 192 | else |
193 | { | 193 | { |
194 | this.UserRecvKey = attri; | 194 | this.UserRecvKey = attri; |
195 | } | 195 | } |
196 | 196 | ||
197 | attri = ""; | 197 | attri = ""; |
198 | attri = configData.GetAttribute("AssetServerURL"); | 198 | attri = configData.GetAttribute("AssetServerURL"); |
199 | if (attri == "") | 199 | if (attri == "") |
200 | { | 200 | { |
201 | this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); | 201 | this.AssetURL = MainLog.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/"); |
202 | configData.SetAttribute("AssetServerURL", this.GridURL); | 202 | configData.SetAttribute("AssetServerURL", this.GridURL); |
203 | } | 203 | } |
204 | else | 204 | else |
205 | { | 205 | { |
206 | this.AssetURL = attri; | 206 | this.AssetURL = attri; |
207 | } | 207 | } |
208 | 208 | ||
209 | } | 209 | } |
210 | configData.Commit(); | 210 | configData.Commit(); |
211 | } | 211 | } |
212 | catch (Exception e) | 212 | catch (Exception e) |
213 | { | 213 | { |
214 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); | 214 | MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); |
215 | MainLog.Instance.Warn(e.ToString()); | 215 | MainLog.Instance.Warn(e.ToString()); |
216 | } | 216 | } |
217 | } | 217 | } |
218 | } | 218 | } |
219 | } | 219 | } |