diff options
Another bit of refactoring to try to make sense of OpenSim.Framework.Communications. Everything that looks like a service, with service handlers, moved to .Services -- i.e. LoginService and Response, and GridInfoService. The rest of the changes were to adapt to the new locations of those files.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/Services/LoginResponse.cs (renamed from OpenSim/Framework/Communications/LoginResponse.cs) | 1624 |
1 files changed, 812 insertions, 812 deletions
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/Services/LoginResponse.cs index 6986369..82515e0 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/Services/LoginResponse.cs | |||
@@ -1,812 +1,812 @@ | |||
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 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using log4net; | 32 | using log4net; |
33 | using Nwc.XmlRpc; | 33 | using Nwc.XmlRpc; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OpenMetaverse.StructuredData; | 35 | using OpenMetaverse.StructuredData; |
36 | 36 | ||
37 | namespace OpenSim.Framework.Communications | 37 | namespace OpenSim.Framework.Communications.Services |
38 | { | 38 | { |
39 | /// <summary> | 39 | /// <summary> |
40 | /// A temp class to handle login response. | 40 | /// A temp class to handle login response. |
41 | /// Should make use of UserProfileManager where possible. | 41 | /// Should make use of UserProfileManager where possible. |
42 | /// </summary> | 42 | /// </summary> |
43 | public class LoginResponse | 43 | public class LoginResponse |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private Hashtable loginFlagsHash; | 47 | private Hashtable loginFlagsHash; |
48 | private Hashtable globalTexturesHash; | 48 | private Hashtable globalTexturesHash; |
49 | private Hashtable loginError; | 49 | private Hashtable loginError; |
50 | private Hashtable uiConfigHash; | 50 | private Hashtable uiConfigHash; |
51 | 51 | ||
52 | private ArrayList loginFlags; | 52 | private ArrayList loginFlags; |
53 | private ArrayList globalTextures; | 53 | private ArrayList globalTextures; |
54 | private ArrayList eventCategories; | 54 | private ArrayList eventCategories; |
55 | private ArrayList uiConfig; | 55 | private ArrayList uiConfig; |
56 | private ArrayList classifiedCategories; | 56 | private ArrayList classifiedCategories; |
57 | private ArrayList inventoryRoot; | 57 | private ArrayList inventoryRoot; |
58 | private ArrayList initialOutfit; | 58 | private ArrayList initialOutfit; |
59 | private ArrayList agentInventory; | 59 | private ArrayList agentInventory; |
60 | private ArrayList inventoryLibraryOwner; | 60 | private ArrayList inventoryLibraryOwner; |
61 | private ArrayList inventoryLibRoot; | 61 | private ArrayList inventoryLibRoot; |
62 | private ArrayList inventoryLibrary; | 62 | private ArrayList inventoryLibrary; |
63 | private ArrayList activeGestures; | 63 | private ArrayList activeGestures; |
64 | 64 | ||
65 | private UserInfo userProfile; | 65 | private UserInfo userProfile; |
66 | 66 | ||
67 | private UUID agentID; | 67 | private UUID agentID; |
68 | private UUID sessionID; | 68 | private UUID sessionID; |
69 | private UUID secureSessionID; | 69 | private UUID secureSessionID; |
70 | 70 | ||
71 | // Login Flags | 71 | // Login Flags |
72 | private string dst; | 72 | private string dst; |
73 | private string stipendSinceLogin; | 73 | private string stipendSinceLogin; |
74 | private string gendered; | 74 | private string gendered; |
75 | private string everLoggedIn; | 75 | private string everLoggedIn; |
76 | private string login; | 76 | private string login; |
77 | private uint simPort; | 77 | private uint simPort; |
78 | private uint simHttpPort; | 78 | private uint simHttpPort; |
79 | private string simAddress; | 79 | private string simAddress; |
80 | private string agentAccess; | 80 | private string agentAccess; |
81 | private Int32 circuitCode; | 81 | private Int32 circuitCode; |
82 | private uint regionX; | 82 | private uint regionX; |
83 | private uint regionY; | 83 | private uint regionY; |
84 | 84 | ||
85 | // Login | 85 | // Login |
86 | private string firstname; | 86 | private string firstname; |
87 | private string lastname; | 87 | private string lastname; |
88 | 88 | ||
89 | // Global Textures | 89 | // Global Textures |
90 | private string sunTexture; | 90 | private string sunTexture; |
91 | private string cloudTexture; | 91 | private string cloudTexture; |
92 | private string moonTexture; | 92 | private string moonTexture; |
93 | 93 | ||
94 | // Error Flags | 94 | // Error Flags |
95 | private string errorReason; | 95 | private string errorReason; |
96 | private string errorMessage; | 96 | private string errorMessage; |
97 | 97 | ||
98 | // Response | 98 | // Response |
99 | private XmlRpcResponse xmlRpcResponse; | 99 | private XmlRpcResponse xmlRpcResponse; |
100 | // private XmlRpcResponse defaultXmlRpcResponse; | 100 | // private XmlRpcResponse defaultXmlRpcResponse; |
101 | 101 | ||
102 | private string welcomeMessage; | 102 | private string welcomeMessage; |
103 | private string startLocation; | 103 | private string startLocation; |
104 | private string allowFirstLife; | 104 | private string allowFirstLife; |
105 | private string home; | 105 | private string home; |
106 | private string seedCapability; | 106 | private string seedCapability; |
107 | private string lookAt; | 107 | private string lookAt; |
108 | 108 | ||
109 | private BuddyList m_buddyList = null; | 109 | private BuddyList m_buddyList = null; |
110 | 110 | ||
111 | public LoginResponse() | 111 | public LoginResponse() |
112 | { | 112 | { |
113 | loginFlags = new ArrayList(); | 113 | loginFlags = new ArrayList(); |
114 | globalTextures = new ArrayList(); | 114 | globalTextures = new ArrayList(); |
115 | eventCategories = new ArrayList(); | 115 | eventCategories = new ArrayList(); |
116 | uiConfig = new ArrayList(); | 116 | uiConfig = new ArrayList(); |
117 | classifiedCategories = new ArrayList(); | 117 | classifiedCategories = new ArrayList(); |
118 | 118 | ||
119 | loginError = new Hashtable(); | 119 | loginError = new Hashtable(); |
120 | uiConfigHash = new Hashtable(); | 120 | uiConfigHash = new Hashtable(); |
121 | 121 | ||
122 | // defaultXmlRpcResponse = new XmlRpcResponse(); | 122 | // defaultXmlRpcResponse = new XmlRpcResponse(); |
123 | userProfile = new UserInfo(); | 123 | userProfile = new UserInfo(); |
124 | inventoryRoot = new ArrayList(); | 124 | inventoryRoot = new ArrayList(); |
125 | initialOutfit = new ArrayList(); | 125 | initialOutfit = new ArrayList(); |
126 | agentInventory = new ArrayList(); | 126 | agentInventory = new ArrayList(); |
127 | inventoryLibrary = new ArrayList(); | 127 | inventoryLibrary = new ArrayList(); |
128 | inventoryLibraryOwner = new ArrayList(); | 128 | inventoryLibraryOwner = new ArrayList(); |
129 | activeGestures = new ArrayList(); | 129 | activeGestures = new ArrayList(); |
130 | 130 | ||
131 | xmlRpcResponse = new XmlRpcResponse(); | 131 | xmlRpcResponse = new XmlRpcResponse(); |
132 | // defaultXmlRpcResponse = new XmlRpcResponse(); | 132 | // defaultXmlRpcResponse = new XmlRpcResponse(); |
133 | 133 | ||
134 | SetDefaultValues(); | 134 | SetDefaultValues(); |
135 | } | 135 | } |
136 | 136 | ||
137 | private void SetDefaultValues() | 137 | private void SetDefaultValues() |
138 | { | 138 | { |
139 | DST = "N"; | 139 | DST = "N"; |
140 | StipendSinceLogin = "N"; | 140 | StipendSinceLogin = "N"; |
141 | Gendered = "Y"; | 141 | Gendered = "Y"; |
142 | EverLoggedIn = "Y"; | 142 | EverLoggedIn = "Y"; |
143 | login = "false"; | 143 | login = "false"; |
144 | firstname = "Test"; | 144 | firstname = "Test"; |
145 | lastname = "User"; | 145 | lastname = "User"; |
146 | agentAccess = "M"; | 146 | agentAccess = "M"; |
147 | startLocation = "last"; | 147 | startLocation = "last"; |
148 | allowFirstLife = "Y"; | 148 | allowFirstLife = "Y"; |
149 | 149 | ||
150 | SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271"; | 150 | SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271"; |
151 | CloudTexture = "dc4b9f0b-d008-45c6-96a4-01dd947ac621"; | 151 | CloudTexture = "dc4b9f0b-d008-45c6-96a4-01dd947ac621"; |
152 | MoonTexture = "ec4b9f0b-d008-45c6-96a4-01dd947ac621"; | 152 | MoonTexture = "ec4b9f0b-d008-45c6-96a4-01dd947ac621"; |
153 | 153 | ||
154 | ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock."; | 154 | ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock."; |
155 | ErrorReason = "key"; | 155 | ErrorReason = "key"; |
156 | welcomeMessage = "Welcome to OpenSim!"; | 156 | welcomeMessage = "Welcome to OpenSim!"; |
157 | seedCapability = String.Empty; | 157 | seedCapability = String.Empty; |
158 | home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" + | 158 | home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" + |
159 | userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + | 159 | userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + |
160 | userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + | 160 | userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + |
161 | userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; | 161 | userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; |
162 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; | 162 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; |
163 | RegionX = (uint) 255232; | 163 | RegionX = (uint) 255232; |
164 | RegionY = (uint) 254976; | 164 | RegionY = (uint) 254976; |
165 | 165 | ||
166 | // Classifieds; | 166 | // Classifieds; |
167 | AddClassifiedCategory((Int32) 1, "Shopping"); | 167 | AddClassifiedCategory((Int32) 1, "Shopping"); |
168 | AddClassifiedCategory((Int32) 2, "Land Rental"); | 168 | AddClassifiedCategory((Int32) 2, "Land Rental"); |
169 | AddClassifiedCategory((Int32) 3, "Property Rental"); | 169 | AddClassifiedCategory((Int32) 3, "Property Rental"); |
170 | AddClassifiedCategory((Int32) 4, "Special Attraction"); | 170 | AddClassifiedCategory((Int32) 4, "Special Attraction"); |
171 | AddClassifiedCategory((Int32) 5, "New Products"); | 171 | AddClassifiedCategory((Int32) 5, "New Products"); |
172 | AddClassifiedCategory((Int32) 6, "Employment"); | 172 | AddClassifiedCategory((Int32) 6, "Employment"); |
173 | AddClassifiedCategory((Int32) 7, "Wanted"); | 173 | AddClassifiedCategory((Int32) 7, "Wanted"); |
174 | AddClassifiedCategory((Int32) 8, "Service"); | 174 | AddClassifiedCategory((Int32) 8, "Service"); |
175 | AddClassifiedCategory((Int32) 9, "Personal"); | 175 | AddClassifiedCategory((Int32) 9, "Personal"); |
176 | 176 | ||
177 | SessionID = UUID.Random(); | 177 | SessionID = UUID.Random(); |
178 | SecureSessionID = UUID.Random(); | 178 | SecureSessionID = UUID.Random(); |
179 | AgentID = UUID.Random(); | 179 | AgentID = UUID.Random(); |
180 | 180 | ||
181 | Hashtable InitialOutfitHash = new Hashtable(); | 181 | Hashtable InitialOutfitHash = new Hashtable(); |
182 | InitialOutfitHash["folder_name"] = "Nightclub Female"; | 182 | InitialOutfitHash["folder_name"] = "Nightclub Female"; |
183 | InitialOutfitHash["gender"] = "female"; | 183 | InitialOutfitHash["gender"] = "female"; |
184 | initialOutfit.Add(InitialOutfitHash); | 184 | initialOutfit.Add(InitialOutfitHash); |
185 | } | 185 | } |
186 | 186 | ||
187 | #region Login Failure Methods | 187 | #region Login Failure Methods |
188 | 188 | ||
189 | public XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) | 189 | public XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) |
190 | { | 190 | { |
191 | // Overwrite any default values; | 191 | // Overwrite any default values; |
192 | xmlRpcResponse = new XmlRpcResponse(); | 192 | xmlRpcResponse = new XmlRpcResponse(); |
193 | 193 | ||
194 | // Ensure Login Failed message/reason; | 194 | // Ensure Login Failed message/reason; |
195 | ErrorMessage = message; | 195 | ErrorMessage = message; |
196 | ErrorReason = reason; | 196 | ErrorReason = reason; |
197 | 197 | ||
198 | loginError["reason"] = ErrorReason; | 198 | loginError["reason"] = ErrorReason; |
199 | loginError["message"] = ErrorMessage; | 199 | loginError["message"] = ErrorMessage; |
200 | loginError["login"] = login; | 200 | loginError["login"] = login; |
201 | xmlRpcResponse.Value = loginError; | 201 | xmlRpcResponse.Value = loginError; |
202 | return (xmlRpcResponse); | 202 | return (xmlRpcResponse); |
203 | } | 203 | } |
204 | 204 | ||
205 | public OSD GenerateFailureResponseLLSD(string reason, string message, string login) | 205 | public OSD GenerateFailureResponseLLSD(string reason, string message, string login) |
206 | { | 206 | { |
207 | OSDMap map = new OSDMap(); | 207 | OSDMap map = new OSDMap(); |
208 | 208 | ||
209 | // Ensure Login Failed message/reason; | 209 | // Ensure Login Failed message/reason; |
210 | ErrorMessage = message; | 210 | ErrorMessage = message; |
211 | ErrorReason = reason; | 211 | ErrorReason = reason; |
212 | 212 | ||
213 | map["reason"] = OSD.FromString(ErrorReason); | 213 | map["reason"] = OSD.FromString(ErrorReason); |
214 | map["message"] = OSD.FromString(ErrorMessage); | 214 | map["message"] = OSD.FromString(ErrorMessage); |
215 | map["login"] = OSD.FromString(login); | 215 | map["login"] = OSD.FromString(login); |
216 | 216 | ||
217 | return map; | 217 | return map; |
218 | } | 218 | } |
219 | 219 | ||
220 | public XmlRpcResponse CreateFailedResponse() | 220 | public XmlRpcResponse CreateFailedResponse() |
221 | { | 221 | { |
222 | return (CreateLoginFailedResponse()); | 222 | return (CreateLoginFailedResponse()); |
223 | } | 223 | } |
224 | 224 | ||
225 | public OSD CreateFailedResponseLLSD() | 225 | public OSD CreateFailedResponseLLSD() |
226 | { | 226 | { |
227 | return CreateLoginFailedResponseLLSD(); | 227 | return CreateLoginFailedResponseLLSD(); |
228 | } | 228 | } |
229 | 229 | ||
230 | public XmlRpcResponse CreateLoginFailedResponse() | 230 | public XmlRpcResponse CreateLoginFailedResponse() |
231 | { | 231 | { |
232 | return | 232 | return |
233 | (GenerateFailureResponse("key", | 233 | (GenerateFailureResponse("key", |
234 | "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", | 234 | "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", |
235 | "false")); | 235 | "false")); |
236 | } | 236 | } |
237 | 237 | ||
238 | public OSD CreateLoginFailedResponseLLSD() | 238 | public OSD CreateLoginFailedResponseLLSD() |
239 | { | 239 | { |
240 | return GenerateFailureResponseLLSD( | 240 | return GenerateFailureResponseLLSD( |
241 | "key", | 241 | "key", |
242 | "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", | 242 | "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", |
243 | "false"); | 243 | "false"); |
244 | } | 244 | } |
245 | 245 | ||
246 | /// <summary> | 246 | /// <summary> |
247 | /// Response to indicate that login failed because the agent's inventory was not available. | 247 | /// Response to indicate that login failed because the agent's inventory was not available. |
248 | /// </summary> | 248 | /// </summary> |
249 | /// <returns></returns> | 249 | /// <returns></returns> |
250 | public XmlRpcResponse CreateLoginInventoryFailedResponse() | 250 | public XmlRpcResponse CreateLoginInventoryFailedResponse() |
251 | { | 251 | { |
252 | return GenerateFailureResponse( | 252 | return GenerateFailureResponse( |
253 | "key", | 253 | "key", |
254 | "The avatar inventory service is not responding. Please notify your login region operator.", | 254 | "The avatar inventory service is not responding. Please notify your login region operator.", |
255 | "false"); | 255 | "false"); |
256 | } | 256 | } |
257 | 257 | ||
258 | public XmlRpcResponse CreateAlreadyLoggedInResponse() | 258 | public XmlRpcResponse CreateAlreadyLoggedInResponse() |
259 | { | 259 | { |
260 | return | 260 | return |
261 | (GenerateFailureResponse("presence", | 261 | (GenerateFailureResponse("presence", |
262 | "You appear to be already logged in. " + | 262 | "You appear to be already logged in. " + |
263 | "If this is not the case please wait for your session to timeout. " + | 263 | "If this is not the case please wait for your session to timeout. " + |
264 | "If this takes longer than a few minutes please contact the grid owner. " + | 264 | "If this takes longer than a few minutes please contact the grid owner. " + |
265 | "Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.", | 265 | "Please wait 5 minutes if you are going to connect to a region nearby to the region you were at previously.", |
266 | "false")); | 266 | "false")); |
267 | } | 267 | } |
268 | 268 | ||
269 | public OSD CreateAlreadyLoggedInResponseLLSD() | 269 | public OSD CreateAlreadyLoggedInResponseLLSD() |
270 | { | 270 | { |
271 | return GenerateFailureResponseLLSD( | 271 | return GenerateFailureResponseLLSD( |
272 | "presence", | 272 | "presence", |
273 | "You appear to be already logged in. " + | 273 | "You appear to be already logged in. " + |
274 | "If this is not the case please wait for your session to timeout. " + | 274 | "If this is not the case please wait for your session to timeout. " + |
275 | "If this takes longer than a few minutes please contact the grid owner", | 275 | "If this takes longer than a few minutes please contact the grid owner", |
276 | "false"); | 276 | "false"); |
277 | } | 277 | } |
278 | 278 | ||
279 | public XmlRpcResponse CreateLoginBlockedResponse() | 279 | public XmlRpcResponse CreateLoginBlockedResponse() |
280 | { | 280 | { |
281 | return | 281 | return |
282 | (GenerateFailureResponse("presence", | 282 | (GenerateFailureResponse("presence", |
283 | "Logins are currently restricted. Please try again later", | 283 | "Logins are currently restricted. Please try again later", |
284 | "false")); | 284 | "false")); |
285 | } | 285 | } |
286 | 286 | ||
287 | public OSD CreateLoginBlockedResponseLLSD() | 287 | public OSD CreateLoginBlockedResponseLLSD() |
288 | { | 288 | { |
289 | return GenerateFailureResponseLLSD( | 289 | return GenerateFailureResponseLLSD( |
290 | "presence", | 290 | "presence", |
291 | "Logins are currently restricted. Please try again later", | 291 | "Logins are currently restricted. Please try again later", |
292 | "false"); | 292 | "false"); |
293 | } | 293 | } |
294 | 294 | ||
295 | public XmlRpcResponse CreateDeadRegionResponse() | 295 | public XmlRpcResponse CreateDeadRegionResponse() |
296 | { | 296 | { |
297 | return | 297 | return |
298 | (GenerateFailureResponse("key", | 298 | (GenerateFailureResponse("key", |
299 | "The region you are attempting to log into is not responding. Please select another region and try again.", | 299 | "The region you are attempting to log into is not responding. Please select another region and try again.", |
300 | "false")); | 300 | "false")); |
301 | } | 301 | } |
302 | 302 | ||
303 | public OSD CreateDeadRegionResponseLLSD() | 303 | public OSD CreateDeadRegionResponseLLSD() |
304 | { | 304 | { |
305 | return GenerateFailureResponseLLSD( | 305 | return GenerateFailureResponseLLSD( |
306 | "key", | 306 | "key", |
307 | "The region you are attempting to log into is not responding. Please select another region and try again.", | 307 | "The region you are attempting to log into is not responding. Please select another region and try again.", |
308 | "false"); | 308 | "false"); |
309 | } | 309 | } |
310 | 310 | ||
311 | public XmlRpcResponse CreateGridErrorResponse() | 311 | public XmlRpcResponse CreateGridErrorResponse() |
312 | { | 312 | { |
313 | return | 313 | return |
314 | (GenerateFailureResponse("key", | 314 | (GenerateFailureResponse("key", |
315 | "Error connecting to grid. Could not percieve credentials from login XML.", | 315 | "Error connecting to grid. Could not percieve credentials from login XML.", |
316 | "false")); | 316 | "false")); |
317 | } | 317 | } |
318 | 318 | ||
319 | public OSD CreateGridErrorResponseLLSD() | 319 | public OSD CreateGridErrorResponseLLSD() |
320 | { | 320 | { |
321 | return GenerateFailureResponseLLSD( | 321 | return GenerateFailureResponseLLSD( |
322 | "key", | 322 | "key", |
323 | "Error connecting to grid. Could not percieve credentials from login XML.", | 323 | "Error connecting to grid. Could not percieve credentials from login XML.", |
324 | "false"); | 324 | "false"); |
325 | } | 325 | } |
326 | 326 | ||
327 | #endregion | 327 | #endregion |
328 | 328 | ||
329 | public virtual XmlRpcResponse ToXmlRpcResponse() | 329 | public virtual XmlRpcResponse ToXmlRpcResponse() |
330 | { | 330 | { |
331 | try | 331 | try |
332 | { | 332 | { |
333 | Hashtable responseData = new Hashtable(); | 333 | Hashtable responseData = new Hashtable(); |
334 | 334 | ||
335 | loginFlagsHash = new Hashtable(); | 335 | loginFlagsHash = new Hashtable(); |
336 | loginFlagsHash["daylight_savings"] = DST; | 336 | loginFlagsHash["daylight_savings"] = DST; |
337 | loginFlagsHash["stipend_since_login"] = StipendSinceLogin; | 337 | loginFlagsHash["stipend_since_login"] = StipendSinceLogin; |
338 | loginFlagsHash["gendered"] = Gendered; | 338 | loginFlagsHash["gendered"] = Gendered; |
339 | loginFlagsHash["ever_logged_in"] = EverLoggedIn; | 339 | loginFlagsHash["ever_logged_in"] = EverLoggedIn; |
340 | loginFlags.Add(loginFlagsHash); | 340 | loginFlags.Add(loginFlagsHash); |
341 | 341 | ||
342 | responseData["first_name"] = Firstname; | 342 | responseData["first_name"] = Firstname; |
343 | responseData["last_name"] = Lastname; | 343 | responseData["last_name"] = Lastname; |
344 | responseData["agent_access"] = agentAccess; | 344 | responseData["agent_access"] = agentAccess; |
345 | 345 | ||
346 | globalTexturesHash = new Hashtable(); | 346 | globalTexturesHash = new Hashtable(); |
347 | globalTexturesHash["sun_texture_id"] = SunTexture; | 347 | globalTexturesHash["sun_texture_id"] = SunTexture; |
348 | globalTexturesHash["cloud_texture_id"] = CloudTexture; | 348 | globalTexturesHash["cloud_texture_id"] = CloudTexture; |
349 | globalTexturesHash["moon_texture_id"] = MoonTexture; | 349 | globalTexturesHash["moon_texture_id"] = MoonTexture; |
350 | globalTextures.Add(globalTexturesHash); | 350 | globalTextures.Add(globalTexturesHash); |
351 | // this.eventCategories.Add(this.eventCategoriesHash); | 351 | // this.eventCategories.Add(this.eventCategoriesHash); |
352 | 352 | ||
353 | AddToUIConfig("allow_first_life", allowFirstLife); | 353 | AddToUIConfig("allow_first_life", allowFirstLife); |
354 | uiConfig.Add(uiConfigHash); | 354 | uiConfig.Add(uiConfigHash); |
355 | 355 | ||
356 | responseData["sim_port"] = (Int32) SimPort; | 356 | responseData["sim_port"] = (Int32) SimPort; |
357 | responseData["sim_ip"] = SimAddress; | 357 | responseData["sim_ip"] = SimAddress; |
358 | responseData["http_port"] = (Int32)SimHttpPort; | 358 | responseData["http_port"] = (Int32)SimHttpPort; |
359 | 359 | ||
360 | responseData["agent_id"] = AgentID.ToString(); | 360 | responseData["agent_id"] = AgentID.ToString(); |
361 | responseData["session_id"] = SessionID.ToString(); | 361 | responseData["session_id"] = SessionID.ToString(); |
362 | responseData["secure_session_id"] = SecureSessionID.ToString(); | 362 | responseData["secure_session_id"] = SecureSessionID.ToString(); |
363 | responseData["circuit_code"] = CircuitCode; | 363 | responseData["circuit_code"] = CircuitCode; |
364 | responseData["seconds_since_epoch"] = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | 364 | responseData["seconds_since_epoch"] = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
365 | responseData["login-flags"] = loginFlags; | 365 | responseData["login-flags"] = loginFlags; |
366 | responseData["global-textures"] = globalTextures; | 366 | responseData["global-textures"] = globalTextures; |
367 | responseData["seed_capability"] = seedCapability; | 367 | responseData["seed_capability"] = seedCapability; |
368 | 368 | ||
369 | responseData["event_categories"] = eventCategories; | 369 | responseData["event_categories"] = eventCategories; |
370 | responseData["event_notifications"] = new ArrayList(); // todo | 370 | responseData["event_notifications"] = new ArrayList(); // todo |
371 | responseData["classified_categories"] = classifiedCategories; | 371 | responseData["classified_categories"] = classifiedCategories; |
372 | responseData["ui-config"] = uiConfig; | 372 | responseData["ui-config"] = uiConfig; |
373 | 373 | ||
374 | responseData["inventory-skeleton"] = agentInventory; | 374 | responseData["inventory-skeleton"] = agentInventory; |
375 | responseData["inventory-skel-lib"] = inventoryLibrary; | 375 | responseData["inventory-skel-lib"] = inventoryLibrary; |
376 | responseData["inventory-root"] = inventoryRoot; | 376 | responseData["inventory-root"] = inventoryRoot; |
377 | responseData["inventory-lib-root"] = inventoryLibRoot; | 377 | responseData["inventory-lib-root"] = inventoryLibRoot; |
378 | responseData["gestures"] = activeGestures; | 378 | responseData["gestures"] = activeGestures; |
379 | responseData["inventory-lib-owner"] = inventoryLibraryOwner; | 379 | responseData["inventory-lib-owner"] = inventoryLibraryOwner; |
380 | responseData["initial-outfit"] = initialOutfit; | 380 | responseData["initial-outfit"] = initialOutfit; |
381 | responseData["start_location"] = startLocation; | 381 | responseData["start_location"] = startLocation; |
382 | responseData["seed_capability"] = seedCapability; | 382 | responseData["seed_capability"] = seedCapability; |
383 | responseData["home"] = home; | 383 | responseData["home"] = home; |
384 | responseData["look_at"] = lookAt; | 384 | responseData["look_at"] = lookAt; |
385 | responseData["message"] = welcomeMessage; | 385 | responseData["message"] = welcomeMessage; |
386 | responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize); | 386 | responseData["region_x"] = (Int32)(RegionX * Constants.RegionSize); |
387 | responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize); | 387 | responseData["region_y"] = (Int32)(RegionY * Constants.RegionSize); |
388 | 388 | ||
389 | //responseData["inventory-lib-root"] = new ArrayList(); // todo | 389 | //responseData["inventory-lib-root"] = new ArrayList(); // todo |
390 | 390 | ||
391 | if (m_buddyList != null) | 391 | if (m_buddyList != null) |
392 | { | 392 | { |
393 | responseData["buddy-list"] = m_buddyList.ToArray(); | 393 | responseData["buddy-list"] = m_buddyList.ToArray(); |
394 | } | 394 | } |
395 | 395 | ||
396 | responseData["login"] = "true"; | 396 | responseData["login"] = "true"; |
397 | xmlRpcResponse.Value = responseData; | 397 | xmlRpcResponse.Value = responseData; |
398 | 398 | ||
399 | return (xmlRpcResponse); | 399 | return (xmlRpcResponse); |
400 | } | 400 | } |
401 | catch (Exception e) | 401 | catch (Exception e) |
402 | { | 402 | { |
403 | m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message); | 403 | m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message); |
404 | 404 | ||
405 | return (GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); | 405 | return (GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); |
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | public OSD ToLLSDResponse() | 409 | public OSD ToLLSDResponse() |
410 | { | 410 | { |
411 | try | 411 | try |
412 | { | 412 | { |
413 | OSDMap map = new OSDMap(); | 413 | OSDMap map = new OSDMap(); |
414 | 414 | ||
415 | map["first_name"] = OSD.FromString(Firstname); | 415 | map["first_name"] = OSD.FromString(Firstname); |
416 | map["last_name"] = OSD.FromString(Lastname); | 416 | map["last_name"] = OSD.FromString(Lastname); |
417 | map["agent_access"] = OSD.FromString(agentAccess); | 417 | map["agent_access"] = OSD.FromString(agentAccess); |
418 | 418 | ||
419 | map["sim_port"] = OSD.FromInteger(SimPort); | 419 | map["sim_port"] = OSD.FromInteger(SimPort); |
420 | map["sim_ip"] = OSD.FromString(SimAddress); | 420 | map["sim_ip"] = OSD.FromString(SimAddress); |
421 | 421 | ||
422 | map["agent_id"] = OSD.FromUUID(AgentID); | 422 | map["agent_id"] = OSD.FromUUID(AgentID); |
423 | map["session_id"] = OSD.FromUUID(SessionID); | 423 | map["session_id"] = OSD.FromUUID(SessionID); |
424 | map["secure_session_id"] = OSD.FromUUID(SecureSessionID); | 424 | map["secure_session_id"] = OSD.FromUUID(SecureSessionID); |
425 | map["circuit_code"] = OSD.FromInteger(CircuitCode); | 425 | map["circuit_code"] = OSD.FromInteger(CircuitCode); |
426 | map["seconds_since_epoch"] = OSD.FromInteger((int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds); | 426 | map["seconds_since_epoch"] = OSD.FromInteger((int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds); |
427 | 427 | ||
428 | #region Login Flags | 428 | #region Login Flags |
429 | 429 | ||
430 | OSDMap loginFlagsLLSD = new OSDMap(); | 430 | OSDMap loginFlagsLLSD = new OSDMap(); |
431 | loginFlagsLLSD["daylight_savings"] = OSD.FromString(DST); | 431 | loginFlagsLLSD["daylight_savings"] = OSD.FromString(DST); |
432 | loginFlagsLLSD["stipend_since_login"] = OSD.FromString(StipendSinceLogin); | 432 | loginFlagsLLSD["stipend_since_login"] = OSD.FromString(StipendSinceLogin); |
433 | loginFlagsLLSD["gendered"] = OSD.FromString(Gendered); | 433 | loginFlagsLLSD["gendered"] = OSD.FromString(Gendered); |
434 | loginFlagsLLSD["ever_logged_in"] = OSD.FromString(EverLoggedIn); | 434 | loginFlagsLLSD["ever_logged_in"] = OSD.FromString(EverLoggedIn); |
435 | map["login-flags"] = WrapOSDMap(loginFlagsLLSD); | 435 | map["login-flags"] = WrapOSDMap(loginFlagsLLSD); |
436 | 436 | ||
437 | #endregion Login Flags | 437 | #endregion Login Flags |
438 | 438 | ||
439 | #region Global Textures | 439 | #region Global Textures |
440 | 440 | ||
441 | OSDMap globalTexturesLLSD = new OSDMap(); | 441 | OSDMap globalTexturesLLSD = new OSDMap(); |
442 | globalTexturesLLSD["sun_texture_id"] = OSD.FromString(SunTexture); | 442 | globalTexturesLLSD["sun_texture_id"] = OSD.FromString(SunTexture); |
443 | globalTexturesLLSD["cloud_texture_id"] = OSD.FromString(CloudTexture); | 443 | globalTexturesLLSD["cloud_texture_id"] = OSD.FromString(CloudTexture); |
444 | globalTexturesLLSD["moon_texture_id"] = OSD.FromString(MoonTexture); | 444 | globalTexturesLLSD["moon_texture_id"] = OSD.FromString(MoonTexture); |
445 | 445 | ||
446 | map["global-textures"] = WrapOSDMap(globalTexturesLLSD); | 446 | map["global-textures"] = WrapOSDMap(globalTexturesLLSD); |
447 | 447 | ||
448 | #endregion Global Textures | 448 | #endregion Global Textures |
449 | 449 | ||
450 | map["seed_capability"] = OSD.FromString(seedCapability); | 450 | map["seed_capability"] = OSD.FromString(seedCapability); |
451 | 451 | ||
452 | map["event_categories"] = ArrayListToOSDArray(eventCategories); | 452 | map["event_categories"] = ArrayListToOSDArray(eventCategories); |
453 | //map["event_notifications"] = new OSDArray(); // todo | 453 | //map["event_notifications"] = new OSDArray(); // todo |
454 | map["classified_categories"] = ArrayListToOSDArray(classifiedCategories); | 454 | map["classified_categories"] = ArrayListToOSDArray(classifiedCategories); |
455 | 455 | ||
456 | #region UI Config | 456 | #region UI Config |
457 | 457 | ||
458 | OSDMap uiConfigLLSD = new OSDMap(); | 458 | OSDMap uiConfigLLSD = new OSDMap(); |
459 | uiConfigLLSD["allow_first_life"] = OSD.FromString(allowFirstLife); | 459 | uiConfigLLSD["allow_first_life"] = OSD.FromString(allowFirstLife); |
460 | map["ui-config"] = WrapOSDMap(uiConfigLLSD); | 460 | map["ui-config"] = WrapOSDMap(uiConfigLLSD); |
461 | 461 | ||
462 | #endregion UI Config | 462 | #endregion UI Config |
463 | 463 | ||
464 | #region Inventory | 464 | #region Inventory |
465 | 465 | ||
466 | map["inventory-skeleton"] = ArrayListToOSDArray(agentInventory); | 466 | map["inventory-skeleton"] = ArrayListToOSDArray(agentInventory); |
467 | 467 | ||
468 | map["inventory-skel-lib"] = ArrayListToOSDArray(inventoryLibrary); | 468 | map["inventory-skel-lib"] = ArrayListToOSDArray(inventoryLibrary); |
469 | map["inventory-root"] = ArrayListToOSDArray(inventoryRoot); ; | 469 | map["inventory-root"] = ArrayListToOSDArray(inventoryRoot); ; |
470 | map["inventory-lib-root"] = ArrayListToOSDArray(inventoryLibRoot); | 470 | map["inventory-lib-root"] = ArrayListToOSDArray(inventoryLibRoot); |
471 | map["inventory-lib-owner"] = ArrayListToOSDArray(inventoryLibraryOwner); | 471 | map["inventory-lib-owner"] = ArrayListToOSDArray(inventoryLibraryOwner); |
472 | 472 | ||
473 | #endregion Inventory | 473 | #endregion Inventory |
474 | 474 | ||
475 | map["gestures"] = ArrayListToOSDArray(activeGestures); | 475 | map["gestures"] = ArrayListToOSDArray(activeGestures); |
476 | 476 | ||
477 | map["initial-outfit"] = ArrayListToOSDArray(initialOutfit); | 477 | map["initial-outfit"] = ArrayListToOSDArray(initialOutfit); |
478 | map["start_location"] = OSD.FromString(startLocation); | 478 | map["start_location"] = OSD.FromString(startLocation); |
479 | 479 | ||
480 | map["seed_capability"] = OSD.FromString(seedCapability); | 480 | map["seed_capability"] = OSD.FromString(seedCapability); |
481 | map["home"] = OSD.FromString(home); | 481 | map["home"] = OSD.FromString(home); |
482 | map["look_at"] = OSD.FromString(lookAt); | 482 | map["look_at"] = OSD.FromString(lookAt); |
483 | map["message"] = OSD.FromString(welcomeMessage); | 483 | map["message"] = OSD.FromString(welcomeMessage); |
484 | map["region_x"] = OSD.FromInteger(RegionX * Constants.RegionSize); | 484 | map["region_x"] = OSD.FromInteger(RegionX * Constants.RegionSize); |
485 | map["region_y"] = OSD.FromInteger(RegionY * Constants.RegionSize); | 485 | map["region_y"] = OSD.FromInteger(RegionY * Constants.RegionSize); |
486 | 486 | ||
487 | if (m_buddyList != null) | 487 | if (m_buddyList != null) |
488 | { | 488 | { |
489 | map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); | 489 | map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); |
490 | } | 490 | } |
491 | 491 | ||
492 | map["login"] = OSD.FromString("true"); | 492 | map["login"] = OSD.FromString("true"); |
493 | 493 | ||
494 | return map; | 494 | return map; |
495 | } | 495 | } |
496 | catch (Exception e) | 496 | catch (Exception e) |
497 | { | 497 | { |
498 | m_log.Warn("[CLIENT]: LoginResponse: Error creating LLSD Response: " + e.Message); | 498 | m_log.Warn("[CLIENT]: LoginResponse: Error creating LLSD Response: " + e.Message); |
499 | 499 | ||
500 | return GenerateFailureResponseLLSD("Internal Error", "Error generating Login Response", "false"); | 500 | return GenerateFailureResponseLLSD("Internal Error", "Error generating Login Response", "false"); |
501 | } | 501 | } |
502 | } | 502 | } |
503 | 503 | ||
504 | public OSDArray ArrayListToOSDArray(ArrayList arrlst) | 504 | public OSDArray ArrayListToOSDArray(ArrayList arrlst) |
505 | { | 505 | { |
506 | OSDArray llsdBack = new OSDArray(); | 506 | OSDArray llsdBack = new OSDArray(); |
507 | foreach (Hashtable ht in arrlst) | 507 | foreach (Hashtable ht in arrlst) |
508 | { | 508 | { |
509 | OSDMap mp = new OSDMap(); | 509 | OSDMap mp = new OSDMap(); |
510 | foreach (DictionaryEntry deHt in ht) | 510 | foreach (DictionaryEntry deHt in ht) |
511 | { | 511 | { |
512 | mp.Add((string)deHt.Key, OSDString.FromObject(deHt.Value)); | 512 | mp.Add((string)deHt.Key, OSDString.FromObject(deHt.Value)); |
513 | } | 513 | } |
514 | llsdBack.Add(mp); | 514 | llsdBack.Add(mp); |
515 | } | 515 | } |
516 | return llsdBack; | 516 | return llsdBack; |
517 | } | 517 | } |
518 | 518 | ||
519 | private static OSDArray WrapOSDMap(OSDMap wrapMe) | 519 | private static OSDArray WrapOSDMap(OSDMap wrapMe) |
520 | { | 520 | { |
521 | OSDArray array = new OSDArray(); | 521 | OSDArray array = new OSDArray(); |
522 | array.Add(wrapMe); | 522 | array.Add(wrapMe); |
523 | return array; | 523 | return array; |
524 | } | 524 | } |
525 | 525 | ||
526 | public void SetEventCategories(string category, string value) | 526 | public void SetEventCategories(string category, string value) |
527 | { | 527 | { |
528 | // this.eventCategoriesHash[category] = value; | 528 | // this.eventCategoriesHash[category] = value; |
529 | //TODO | 529 | //TODO |
530 | } | 530 | } |
531 | 531 | ||
532 | public void AddToUIConfig(string itemName, string item) | 532 | public void AddToUIConfig(string itemName, string item) |
533 | { | 533 | { |
534 | uiConfigHash[itemName] = item; | 534 | uiConfigHash[itemName] = item; |
535 | } | 535 | } |
536 | 536 | ||
537 | public void AddClassifiedCategory(Int32 ID, string categoryName) | 537 | public void AddClassifiedCategory(Int32 ID, string categoryName) |
538 | { | 538 | { |
539 | Hashtable hash = new Hashtable(); | 539 | Hashtable hash = new Hashtable(); |
540 | hash["category_name"] = categoryName; | 540 | hash["category_name"] = categoryName; |
541 | hash["category_id"] = ID; | 541 | hash["category_id"] = ID; |
542 | classifiedCategories.Add(hash); | 542 | classifiedCategories.Add(hash); |
543 | // this.classifiedCategoriesHash.Clear(); | 543 | // this.classifiedCategoriesHash.Clear(); |
544 | } | 544 | } |
545 | 545 | ||
546 | #region Properties | 546 | #region Properties |
547 | 547 | ||
548 | public string Login | 548 | public string Login |
549 | { | 549 | { |
550 | get { return login; } | 550 | get { return login; } |
551 | set { login = value; } | 551 | set { login = value; } |
552 | } | 552 | } |
553 | 553 | ||
554 | public string DST | 554 | public string DST |
555 | { | 555 | { |
556 | get { return dst; } | 556 | get { return dst; } |
557 | set { dst = value; } | 557 | set { dst = value; } |
558 | } | 558 | } |
559 | 559 | ||
560 | public string StipendSinceLogin | 560 | public string StipendSinceLogin |
561 | { | 561 | { |
562 | get { return stipendSinceLogin; } | 562 | get { return stipendSinceLogin; } |
563 | set { stipendSinceLogin = value; } | 563 | set { stipendSinceLogin = value; } |
564 | } | 564 | } |
565 | 565 | ||
566 | public string Gendered | 566 | public string Gendered |
567 | { | 567 | { |
568 | get { return gendered; } | 568 | get { return gendered; } |
569 | set { gendered = value; } | 569 | set { gendered = value; } |
570 | } | 570 | } |
571 | 571 | ||
572 | public string EverLoggedIn | 572 | public string EverLoggedIn |
573 | { | 573 | { |
574 | get { return everLoggedIn; } | 574 | get { return everLoggedIn; } |
575 | set { everLoggedIn = value; } | 575 | set { everLoggedIn = value; } |
576 | } | 576 | } |
577 | 577 | ||
578 | public uint SimPort | 578 | public uint SimPort |
579 | { | 579 | { |
580 | get { return simPort; } | 580 | get { return simPort; } |
581 | set { simPort = value; } | 581 | set { simPort = value; } |
582 | } | 582 | } |
583 | 583 | ||
584 | public uint SimHttpPort | 584 | public uint SimHttpPort |
585 | { | 585 | { |
586 | get { return simHttpPort; } | 586 | get { return simHttpPort; } |
587 | set { simHttpPort = value; } | 587 | set { simHttpPort = value; } |
588 | } | 588 | } |
589 | 589 | ||
590 | public string SimAddress | 590 | public string SimAddress |
591 | { | 591 | { |
592 | get { return simAddress; } | 592 | get { return simAddress; } |
593 | set { simAddress = value; } | 593 | set { simAddress = value; } |
594 | } | 594 | } |
595 | 595 | ||
596 | public UUID AgentID | 596 | public UUID AgentID |
597 | { | 597 | { |
598 | get { return agentID; } | 598 | get { return agentID; } |
599 | set { agentID = value; } | 599 | set { agentID = value; } |
600 | } | 600 | } |
601 | 601 | ||
602 | public UUID SessionID | 602 | public UUID SessionID |
603 | { | 603 | { |
604 | get { return sessionID; } | 604 | get { return sessionID; } |
605 | set { sessionID = value; } | 605 | set { sessionID = value; } |
606 | } | 606 | } |
607 | 607 | ||
608 | public UUID SecureSessionID | 608 | public UUID SecureSessionID |
609 | { | 609 | { |
610 | get { return secureSessionID; } | 610 | get { return secureSessionID; } |
611 | set { secureSessionID = value; } | 611 | set { secureSessionID = value; } |
612 | } | 612 | } |
613 | 613 | ||
614 | public Int32 CircuitCode | 614 | public Int32 CircuitCode |
615 | { | 615 | { |
616 | get { return circuitCode; } | 616 | get { return circuitCode; } |
617 | set { circuitCode = value; } | 617 | set { circuitCode = value; } |
618 | } | 618 | } |
619 | 619 | ||
620 | public uint RegionX | 620 | public uint RegionX |
621 | { | 621 | { |
622 | get { return regionX; } | 622 | get { return regionX; } |
623 | set { regionX = value; } | 623 | set { regionX = value; } |
624 | } | 624 | } |
625 | 625 | ||
626 | public uint RegionY | 626 | public uint RegionY |
627 | { | 627 | { |
628 | get { return regionY; } | 628 | get { return regionY; } |
629 | set { regionY = value; } | 629 | set { regionY = value; } |
630 | } | 630 | } |
631 | 631 | ||
632 | public string SunTexture | 632 | public string SunTexture |
633 | { | 633 | { |
634 | get { return sunTexture; } | 634 | get { return sunTexture; } |
635 | set { sunTexture = value; } | 635 | set { sunTexture = value; } |
636 | } | 636 | } |
637 | 637 | ||
638 | public string CloudTexture | 638 | public string CloudTexture |
639 | { | 639 | { |
640 | get { return cloudTexture; } | 640 | get { return cloudTexture; } |
641 | set { cloudTexture = value; } | 641 | set { cloudTexture = value; } |
642 | } | 642 | } |
643 | 643 | ||
644 | public string MoonTexture | 644 | public string MoonTexture |
645 | { | 645 | { |
646 | get { return moonTexture; } | 646 | get { return moonTexture; } |
647 | set { moonTexture = value; } | 647 | set { moonTexture = value; } |
648 | } | 648 | } |
649 | 649 | ||
650 | public string Firstname | 650 | public string Firstname |
651 | { | 651 | { |
652 | get { return firstname; } | 652 | get { return firstname; } |
653 | set { firstname = value; } | 653 | set { firstname = value; } |
654 | } | 654 | } |
655 | 655 | ||
656 | public string Lastname | 656 | public string Lastname |
657 | { | 657 | { |
658 | get { return lastname; } | 658 | get { return lastname; } |
659 | set { lastname = value; } | 659 | set { lastname = value; } |
660 | } | 660 | } |
661 | 661 | ||
662 | public string AgentAccess | 662 | public string AgentAccess |
663 | { | 663 | { |
664 | get { return agentAccess; } | 664 | get { return agentAccess; } |
665 | set { agentAccess = value; } | 665 | set { agentAccess = value; } |
666 | } | 666 | } |
667 | 667 | ||
668 | public string StartLocation | 668 | public string StartLocation |
669 | { | 669 | { |
670 | get { return startLocation; } | 670 | get { return startLocation; } |
671 | set { startLocation = value; } | 671 | set { startLocation = value; } |
672 | } | 672 | } |
673 | 673 | ||
674 | public string LookAt | 674 | public string LookAt |
675 | { | 675 | { |
676 | get { return lookAt; } | 676 | get { return lookAt; } |
677 | set { lookAt = value; } | 677 | set { lookAt = value; } |
678 | } | 678 | } |
679 | 679 | ||
680 | public string SeedCapability | 680 | public string SeedCapability |
681 | { | 681 | { |
682 | get { return seedCapability; } | 682 | get { return seedCapability; } |
683 | set { seedCapability = value; } | 683 | set { seedCapability = value; } |
684 | } | 684 | } |
685 | 685 | ||
686 | public string ErrorReason | 686 | public string ErrorReason |
687 | { | 687 | { |
688 | get { return errorReason; } | 688 | get { return errorReason; } |
689 | set { errorReason = value; } | 689 | set { errorReason = value; } |
690 | } | 690 | } |
691 | 691 | ||
692 | public string ErrorMessage | 692 | public string ErrorMessage |
693 | { | 693 | { |
694 | get { return errorMessage; } | 694 | get { return errorMessage; } |
695 | set { errorMessage = value; } | 695 | set { errorMessage = value; } |
696 | } | 696 | } |
697 | 697 | ||
698 | public ArrayList InventoryRoot | 698 | public ArrayList InventoryRoot |
699 | { | 699 | { |
700 | get { return inventoryRoot; } | 700 | get { return inventoryRoot; } |
701 | set { inventoryRoot = value; } | 701 | set { inventoryRoot = value; } |
702 | } | 702 | } |
703 | 703 | ||
704 | public ArrayList InventorySkeleton | 704 | public ArrayList InventorySkeleton |
705 | { | 705 | { |
706 | get { return agentInventory; } | 706 | get { return agentInventory; } |
707 | set { agentInventory = value; } | 707 | set { agentInventory = value; } |
708 | } | 708 | } |
709 | 709 | ||
710 | public ArrayList InventoryLibrary | 710 | public ArrayList InventoryLibrary |
711 | { | 711 | { |
712 | get { return inventoryLibrary; } | 712 | get { return inventoryLibrary; } |
713 | set { inventoryLibrary = value; } | 713 | set { inventoryLibrary = value; } |
714 | } | 714 | } |
715 | 715 | ||
716 | public ArrayList InventoryLibraryOwner | 716 | public ArrayList InventoryLibraryOwner |
717 | { | 717 | { |
718 | get { return inventoryLibraryOwner; } | 718 | get { return inventoryLibraryOwner; } |
719 | set { inventoryLibraryOwner = value; } | 719 | set { inventoryLibraryOwner = value; } |
720 | } | 720 | } |
721 | 721 | ||
722 | public ArrayList InventoryLibRoot | 722 | public ArrayList InventoryLibRoot |
723 | { | 723 | { |
724 | get { return inventoryLibRoot; } | 724 | get { return inventoryLibRoot; } |
725 | set { inventoryLibRoot = value; } | 725 | set { inventoryLibRoot = value; } |
726 | } | 726 | } |
727 | 727 | ||
728 | public ArrayList ActiveGestures | 728 | public ArrayList ActiveGestures |
729 | { | 729 | { |
730 | get { return activeGestures; } | 730 | get { return activeGestures; } |
731 | set { activeGestures = value; } | 731 | set { activeGestures = value; } |
732 | } | 732 | } |
733 | 733 | ||
734 | public string Home | 734 | public string Home |
735 | { | 735 | { |
736 | get { return home; } | 736 | get { return home; } |
737 | set { home = value; } | 737 | set { home = value; } |
738 | } | 738 | } |
739 | 739 | ||
740 | public string Message | 740 | public string Message |
741 | { | 741 | { |
742 | get { return welcomeMessage; } | 742 | get { return welcomeMessage; } |
743 | set { welcomeMessage = value; } | 743 | set { welcomeMessage = value; } |
744 | } | 744 | } |
745 | 745 | ||
746 | public BuddyList BuddList | 746 | public BuddyList BuddList |
747 | { | 747 | { |
748 | get { return m_buddyList; } | 748 | get { return m_buddyList; } |
749 | set { m_buddyList = value; } | 749 | set { m_buddyList = value; } |
750 | } | 750 | } |
751 | 751 | ||
752 | #endregion | 752 | #endregion |
753 | 753 | ||
754 | public class UserInfo | 754 | public class UserInfo |
755 | { | 755 | { |
756 | public string firstname; | 756 | public string firstname; |
757 | public string lastname; | 757 | public string lastname; |
758 | public ulong homeregionhandle; | 758 | public ulong homeregionhandle; |
759 | public Vector3 homepos; | 759 | public Vector3 homepos; |
760 | public Vector3 homelookat; | 760 | public Vector3 homelookat; |
761 | } | 761 | } |
762 | 762 | ||
763 | public class BuddyList | 763 | public class BuddyList |
764 | { | 764 | { |
765 | public List<BuddyInfo> Buddies = new List<BuddyInfo>(); | 765 | public List<BuddyInfo> Buddies = new List<BuddyInfo>(); |
766 | 766 | ||
767 | public void AddNewBuddy(BuddyInfo buddy) | 767 | public void AddNewBuddy(BuddyInfo buddy) |
768 | { | 768 | { |
769 | if (!Buddies.Contains(buddy)) | 769 | if (!Buddies.Contains(buddy)) |
770 | { | 770 | { |
771 | Buddies.Add(buddy); | 771 | Buddies.Add(buddy); |
772 | } | 772 | } |
773 | } | 773 | } |
774 | 774 | ||
775 | public ArrayList ToArray() | 775 | public ArrayList ToArray() |
776 | { | 776 | { |
777 | ArrayList buddyArray = new ArrayList(); | 777 | ArrayList buddyArray = new ArrayList(); |
778 | foreach (BuddyInfo buddy in Buddies) | 778 | foreach (BuddyInfo buddy in Buddies) |
779 | { | 779 | { |
780 | buddyArray.Add(buddy.ToHashTable()); | 780 | buddyArray.Add(buddy.ToHashTable()); |
781 | } | 781 | } |
782 | return buddyArray; | 782 | return buddyArray; |
783 | } | 783 | } |
784 | 784 | ||
785 | public class BuddyInfo | 785 | public class BuddyInfo |
786 | { | 786 | { |
787 | public int BuddyRightsHave = 1; | 787 | public int BuddyRightsHave = 1; |
788 | public int BuddyRightsGiven = 1; | 788 | public int BuddyRightsGiven = 1; |
789 | public UUID BuddyID; | 789 | public UUID BuddyID; |
790 | 790 | ||
791 | public BuddyInfo(string buddyID) | 791 | public BuddyInfo(string buddyID) |
792 | { | 792 | { |
793 | BuddyID = new UUID(buddyID); | 793 | BuddyID = new UUID(buddyID); |
794 | } | 794 | } |
795 | 795 | ||
796 | public BuddyInfo(UUID buddyID) | 796 | public BuddyInfo(UUID buddyID) |
797 | { | 797 | { |
798 | BuddyID = buddyID; | 798 | BuddyID = buddyID; |
799 | } | 799 | } |
800 | 800 | ||
801 | public Hashtable ToHashTable() | 801 | public Hashtable ToHashTable() |
802 | { | 802 | { |
803 | Hashtable hTable = new Hashtable(); | 803 | Hashtable hTable = new Hashtable(); |
804 | hTable["buddy_rights_has"] = BuddyRightsHave; | 804 | hTable["buddy_rights_has"] = BuddyRightsHave; |
805 | hTable["buddy_rights_given"] = BuddyRightsGiven; | 805 | hTable["buddy_rights_given"] = BuddyRightsGiven; |
806 | hTable["buddy_id"] = BuddyID.ToString(); | 806 | hTable["buddy_id"] = BuddyID.ToString(); |
807 | return hTable; | 807 | return hTable; |
808 | } | 808 | } |
809 | } | 809 | } |
810 | } | 810 | } |
811 | } | 811 | } |
812 | } | 812 | } |