aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Common/OpenGrid.Framework.Communications/IUserServices.cs4
-rw-r--r--Common/OpenGrid.Framework.UserManager/LoginResponse.cs656
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj3
-rw-r--r--Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build1
-rw-r--r--Common/OpenGrid.Framework.UserManager/UserManagerBase.cs318
-rw-r--r--Common/OpenSim.Framework/Types/NetworkServersInfo.cs35
-rw-r--r--Common/OpenSim.Framework/Types/PrimData.cs1
-rw-r--r--Common/OpenSim.Servers/LoginResponse.cs58
-rw-r--r--Common/OpenSim.Servers/LoginServer.cs31
9 files changed, 837 insertions, 270 deletions
diff --git a/Common/OpenGrid.Framework.Communications/IUserServices.cs b/Common/OpenGrid.Framework.Communications/IUserServices.cs
index 4cb66e7..3d8e791 100644
--- a/Common/OpenGrid.Framework.Communications/IUserServices.cs
+++ b/Common/OpenGrid.Framework.Communications/IUserServices.cs
@@ -36,9 +36,9 @@ namespace OpenGrid.Framework.Communications
36{ 36{
37 public interface IUserServices 37 public interface IUserServices
38 { 38 {
39 UserProfileData GetUserProfile(string first_name, string last_name); 39 UserProfileData GetUserProfile(string firstName, string lastName);
40 UserProfileData GetUserProfile(string name); 40 UserProfileData GetUserProfile(string name);
41 UserProfileData GetUserProfile(LLUUID avatar_id); 41 UserProfileData GetUserProfile(LLUUID avatarID);
42 42
43 } 43 }
44} 44}
diff --git a/Common/OpenGrid.Framework.UserManager/LoginResponse.cs b/Common/OpenGrid.Framework.UserManager/LoginResponse.cs
new file mode 100644
index 0000000..1c51aeb
--- /dev/null
+++ b/Common/OpenGrid.Framework.UserManager/LoginResponse.cs
@@ -0,0 +1,656 @@
1using System;
2using System.Text;
3using System.Text.RegularExpressions;
4using System.Threading;
5using System.Collections;
6using System.Xml;
7using libsecondlife;
8using OpenSim.Framework.Utilities;
9using OpenSim.Framework.Interfaces;
10using Nwc.XmlRpc;
11
12namespace OpenGrid.Framework.UserManagement
13{
14
15 /// <summary>
16 /// A temp class to handle login response.
17 /// Should make use of UserProfileManager where possible.
18 /// </summary>
19
20 public class LoginResponse
21 {
22 private Hashtable loginFlagsHash;
23 private Hashtable globalTexturesHash;
24 private Hashtable loginError;
25 private Hashtable eventCategoriesHash;
26 private Hashtable uiConfigHash;
27 private Hashtable classifiedCategoriesHash;
28
29 private ArrayList loginFlags;
30 private ArrayList globalTextures;
31 private ArrayList eventCategories;
32 private ArrayList uiConfig;
33 private ArrayList classifiedCategories;
34 private ArrayList inventoryRoot;
35 private ArrayList initialOutfit;
36 private ArrayList agentInventory;
37
38 private UserInfo userProfile;
39
40 private LLUUID agentID;
41 private LLUUID sessionID;
42 private LLUUID secureSessionID;
43 private LLUUID baseFolderID;
44 private LLUUID inventoryFolderID;
45
46 // Login Flags
47 private string dst;
48 private string stipendSinceLogin;
49 private string gendered;
50 private string everLoggedIn;
51 private string login;
52 private int simPort;
53 private string simAddress;
54 private string agentAccess;
55 private Int32 circuitCode;
56 private uint regionX;
57 private uint regionY;
58
59 // Login
60 private string firstname;
61 private string lastname;
62
63 // Global Textures
64 private string sunTexture;
65 private string cloudTexture;
66 private string moonTexture;
67
68 // Error Flags
69 private string errorReason;
70 private string errorMessage;
71
72 // Response
73 private XmlRpcResponse xmlRpcResponse;
74 private XmlRpcResponse defaultXmlRpcResponse;
75
76 private string welcomeMessage;
77 private string startLocation;
78 private string allowFirstLife;
79 private string home;
80 private string seedCapability;
81 private string lookAt;
82
83 public LoginResponse()
84 {
85 this.loginFlags = new ArrayList();
86 this.globalTextures = new ArrayList();
87 this.eventCategories = new ArrayList();
88 this.uiConfig = new ArrayList();
89 this.classifiedCategories = new ArrayList();
90
91 this.loginError = new Hashtable();
92 this.eventCategoriesHash = new Hashtable();
93 this.classifiedCategoriesHash = new Hashtable();
94 this.uiConfigHash = new Hashtable();
95
96 this.defaultXmlRpcResponse = new XmlRpcResponse();
97 this.userProfile = new UserInfo();
98 this.inventoryRoot = new ArrayList();
99 this.initialOutfit = new ArrayList();
100 this.agentInventory = new ArrayList();
101
102 this.xmlRpcResponse = new XmlRpcResponse();
103 this.defaultXmlRpcResponse = new XmlRpcResponse();
104
105 this.SetDefaultValues();
106 } // LoginServer
107
108 public void SetDefaultValues()
109 {
110 try
111 {
112 this.DST = "N";
113 this.StipendSinceLogin = "N";
114 this.Gendered = "Y";
115 this.EverLoggedIn = "Y";
116 this.login = "false";
117 this.firstname = "Test";
118 this.lastname = "User";
119 this.agentAccess = "M";
120 this.startLocation = "last";
121 this.allowFirstLife = "Y";
122
123 this.SunTexture = "cce0f112-878f-4586-a2e2-a8f104bba271";
124 this.CloudTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
125 this.MoonTexture = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
126
127 this.ErrorMessage = "You have entered an invalid name/password combination. Check Caps/lock.";
128 this.ErrorReason = "key";
129 this.welcomeMessage = "Welcome to OpenSim!";
130 this.seedCapability = "";
131 this.home = "{'region_handle':[r" + (997 * 256).ToString() + ",r" + (996 * 256).ToString() + "], 'position':[r" + this.userProfile.homepos.X.ToString() + ",r" + this.userProfile.homepos.Y.ToString() + ",r" + this.userProfile.homepos.Z.ToString() + "], 'look_at':[r" + this.userProfile.homelookat.X.ToString() + ",r" + this.userProfile.homelookat.Y.ToString() + ",r" + this.userProfile.homelookat.Z.ToString() + "]}";
132 this.lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]";
133 this.RegionX = (uint)255232;
134 this.RegionY = (uint)254976;
135
136 // Classifieds;
137 this.AddClassifiedCategory((Int32)1, "Shopping");
138 this.AddClassifiedCategory((Int32)2, "Land Rental");
139 this.AddClassifiedCategory((Int32)3, "Property Rental");
140 this.AddClassifiedCategory((Int32)4, "Special Attraction");
141 this.AddClassifiedCategory((Int32)5, "New Products");
142 this.AddClassifiedCategory((Int32)6, "Employment");
143 this.AddClassifiedCategory((Int32)7, "Wanted");
144 this.AddClassifiedCategory((Int32)8, "Service");
145 this.AddClassifiedCategory((Int32)9, "Personal");
146
147
148 this.SessionID = LLUUID.Random();
149 this.SecureSessionID = LLUUID.Random();
150 this.AgentID = LLUUID.Random();
151
152 Hashtable InitialOutfitHash = new Hashtable();
153 InitialOutfitHash["folder_name"] = "Nightclub Female";
154 InitialOutfitHash["gender"] = "female";
155 this.initialOutfit.Add(InitialOutfitHash);
156 }
157 catch (Exception e)
158 {
159 OpenSim.Framework.Console.MainLog.Instance.WriteLine(
160 OpenSim.Framework.Console.LogPriority.LOW,
161 "LoginResponse: Unable to set default values: " + e.Message
162 );
163 }
164
165 } // SetDefaultValues
166
167 #region Login Failure Methods
168 public XmlRpcResponse GenerateFailureResponse(string reason, string message, string login)
169 {
170 // Overwrite any default values;
171 this.xmlRpcResponse = new XmlRpcResponse();
172
173 // Ensure Login Failed message/reason;
174 this.ErrorMessage = message;
175 this.ErrorReason = reason;
176
177 this.loginError["reason"] = this.ErrorReason;
178 this.loginError["message"] = this.ErrorMessage;
179 this.loginError["login"] = login;
180 this.xmlRpcResponse.Value = this.loginError;
181 return (this.xmlRpcResponse);
182 } // GenerateResponse
183
184 public XmlRpcResponse CreateFailedResponse()
185 {
186 return (this.CreateLoginFailedResponse());
187 } // CreateErrorConnectingToGridResponse()
188
189 public XmlRpcResponse CreateLoginFailedResponse()
190 {
191 return (this.GenerateFailureResponse("key", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false"));
192 } // LoginFailedResponse
193
194 public XmlRpcResponse CreateAlreadyLoggedInResponse()
195 {
196 return (this.GenerateFailureResponse("presence", "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner", "false"));
197 } // CreateAlreadyLoggedInResponse()
198
199 public XmlRpcResponse CreateDeadRegionResponse()
200 {
201 return (this.GenerateFailureResponse("key", "The region you are attempting to log into is not responding. Please select another region and try again.", "false"));
202 }
203
204 public XmlRpcResponse CreateGridErrorResponse()
205 {
206 return (this.GenerateFailureResponse("key", "Error connecting to grid. Could not percieve credentials from login XML.", "false"));
207 }
208
209 #endregion
210
211 public XmlRpcResponse ToXmlRpcResponse()
212 {
213 try
214 {
215
216 Hashtable responseData = new Hashtable();
217
218 this.loginFlagsHash = new Hashtable();
219 this.loginFlagsHash["daylight_savings"] = this.DST;
220 this.loginFlagsHash["stipend_since_login"] = this.StipendSinceLogin;
221 this.loginFlagsHash["gendered"] = this.Gendered;
222 this.loginFlagsHash["ever_logged_in"] = this.EverLoggedIn;
223 this.loginFlags.Add(this.loginFlagsHash);
224
225 responseData["first_name"] = this.Firstname;
226 responseData["last_name"] = this.Lastname;
227 responseData["agent_access"] = this.agentAccess;
228
229 this.globalTexturesHash = new Hashtable();
230 this.globalTexturesHash["sun_texture_id"] = this.SunTexture;
231 this.globalTexturesHash["cloud_texture_id"] = this.CloudTexture;
232 this.globalTexturesHash["moon_texture_id"] = this.MoonTexture;
233 this.globalTextures.Add(this.globalTexturesHash);
234 this.eventCategories.Add(this.eventCategoriesHash);
235
236 this.AddToUIConfig("allow_first_life", this.allowFirstLife);
237 this.uiConfig.Add(this.uiConfigHash);
238
239 responseData["sim_port"] =(Int32) this.SimPort;
240 responseData["sim_ip"] = this.SimAddress;
241 responseData["agent_id"] = this.AgentID.ToStringHyphenated();
242 responseData["session_id"] = this.SessionID.ToStringHyphenated();
243 responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated();
244 responseData["circuit_code"] = this.CircuitCode;
245 responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
246 responseData["login-flags"] = this.loginFlags;
247 responseData["global-textures"] = this.globalTextures;
248 responseData["seed_capability"] = this.seedCapability;
249
250 responseData["event_categories"] = this.eventCategories;
251 responseData["event_notifications"] = new ArrayList(); // todo
252 responseData["classified_categories"] = this.classifiedCategories;
253 responseData["ui-config"] = this.uiConfig;
254
255 responseData["inventory-skeleton"] = this.agentInventory;
256 responseData["inventory-skel-lib"] = new ArrayList(); // todo
257 responseData["inventory-root"] = this.inventoryRoot;
258 responseData["gestures"] = new ArrayList(); // todo
259 responseData["inventory-lib-owner"] = new ArrayList(); // todo
260 responseData["initial-outfit"] = this.initialOutfit;
261 responseData["start_location"] = this.startLocation;
262 responseData["seed_capability"] = this.seedCapability;
263 responseData["home"] = this.home;
264 responseData["look_at"] = this.lookAt;
265 responseData["message"] = this.welcomeMessage;
266 responseData["region_x"] = (Int32)this.RegionX * 256;
267 responseData["region_y"] = (Int32)this.RegionY * 256;
268
269 //responseData["inventory-lib-root"] = new ArrayList(); // todo
270 //responseData["buddy-list"] = new ArrayList(); // todo
271
272 responseData["login"] = "true";
273 this.xmlRpcResponse.Value = responseData;
274
275 return (this.xmlRpcResponse);
276 }
277 catch (Exception e)
278 {
279 OpenSim.Framework.Console.MainLog.Instance.WriteLine(
280 OpenSim.Framework.Console.LogPriority.LOW,
281 "LoginResponse: Error creating XML-RPC Response: " + e.Message
282 );
283 return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));
284
285 }
286
287 } // ToXmlRpcResponse
288
289 public void SetEventCategories(string category, string value)
290 {
291 this.eventCategoriesHash[category] = value;
292 } // SetEventCategories
293
294 public void AddToUIConfig(string itemName, string item)
295 {
296 this.uiConfigHash[itemName] = item;
297 } // SetUIConfig
298
299 public void AddClassifiedCategory(Int32 ID, string categoryName)
300 {
301 this.classifiedCategoriesHash["category_name"] = categoryName;
302 this.classifiedCategoriesHash["category_id"] = ID;
303 this.classifiedCategories.Add(this.classifiedCategoriesHash);
304 // this.classifiedCategoriesHash.Clear();
305 } // SetClassifiedCategory
306
307 #region Properties
308 public string Login
309 {
310 get
311 {
312 return this.login;
313 }
314 set
315 {
316 this.login = value;
317 }
318 } // Login
319
320 public string DST
321 {
322 get
323 {
324 return this.dst;
325 }
326 set
327 {
328 this.dst = value;
329 }
330 } // DST
331
332 public string StipendSinceLogin
333 {
334 get
335 {
336 return this.stipendSinceLogin;
337 }
338 set
339 {
340 this.stipendSinceLogin = value;
341 }
342 } // StipendSinceLogin
343
344 public string Gendered
345 {
346 get
347 {
348 return this.gendered;
349 }
350 set
351 {
352 this.gendered = value;
353 }
354 } // Gendered
355
356 public string EverLoggedIn
357 {
358 get
359 {
360 return this.everLoggedIn;
361 }
362 set
363 {
364 this.everLoggedIn = value;
365 }
366 } // EverLoggedIn
367
368 public int SimPort
369 {
370 get
371 {
372 return this.simPort;
373 }
374 set
375 {
376 this.simPort = value;
377 }
378 } // SimPort
379
380 public string SimAddress
381 {
382 get
383 {
384 return this.simAddress;
385 }
386 set
387 {
388 this.simAddress = value;
389 }
390 } // SimAddress
391
392 public LLUUID AgentID
393 {
394 get
395 {
396 return this.agentID;
397 }
398 set
399 {
400 this.agentID = value;
401 }
402 } // AgentID
403
404 public LLUUID SessionID
405 {
406 get
407 {
408 return this.sessionID;
409 }
410 set
411 {
412 this.sessionID = value;
413 }
414 } // SessionID
415
416 public LLUUID SecureSessionID
417 {
418 get
419 {
420 return this.secureSessionID;
421 }
422 set
423 {
424 this.secureSessionID = value;
425 }
426 } // SecureSessionID
427
428 public Int32 CircuitCode
429 {
430 get
431 {
432 return this.circuitCode;
433 }
434 set
435 {
436 this.circuitCode = value;
437 }
438 } // CircuitCode
439
440 public uint RegionX
441 {
442 get
443 {
444 return this.regionX;
445 }
446 set
447 {
448 this.regionX = value;
449 }
450 } // RegionX
451
452 public uint RegionY
453 {
454 get
455 {
456 return this.regionY;
457 }
458 set
459 {
460 this.regionY = value;
461 }
462 } // RegionY
463
464 public string SunTexture
465 {
466 get
467 {
468 return this.sunTexture;
469 }
470 set
471 {
472 this.sunTexture = value;
473 }
474 } // SunTexture
475
476 public string CloudTexture
477 {
478 get
479 {
480 return this.cloudTexture;
481 }
482 set
483 {
484 this.cloudTexture = value;
485 }
486 } // CloudTexture
487
488 public string MoonTexture
489 {
490 get
491 {
492 return this.moonTexture;
493 }
494 set
495 {
496 this.moonTexture = value;
497 }
498 } // MoonTexture
499
500 public string Firstname
501 {
502 get
503 {
504 return this.firstname;
505 }
506 set
507 {
508 this.firstname = value;
509 }
510 } // Firstname
511
512 public string Lastname
513 {
514 get
515 {
516 return this.lastname;
517 }
518 set
519 {
520 this.lastname = value;
521 }
522 } // Lastname
523
524 public string AgentAccess
525 {
526 get
527 {
528 return this.agentAccess;
529 }
530 set
531 {
532 this.agentAccess = value;
533 }
534 }
535
536 public string StartLocation
537 {
538 get
539 {
540 return this.startLocation;
541 }
542 set
543 {
544 this.startLocation = value;
545 }
546 } // StartLocation
547
548 public string LookAt
549 {
550 get
551 {
552 return this.lookAt;
553 }
554 set
555 {
556 this.lookAt = value;
557 }
558 }
559
560 public string SeedCapability
561 {
562 get
563 {
564 return this.seedCapability;
565 }
566 set
567 {
568 this.seedCapability = value;
569 }
570 } // SeedCapability
571
572 public string ErrorReason
573 {
574 get
575 {
576 return this.errorReason;
577 }
578 set
579 {
580 this.errorReason = value;
581 }
582 } // ErrorReason
583
584 public string ErrorMessage
585 {
586 get
587 {
588 return this.errorMessage;
589 }
590 set
591 {
592 this.errorMessage = value;
593 }
594 } // ErrorMessage
595
596 public ArrayList InventoryRoot
597 {
598 get
599 {
600 return this.inventoryRoot;
601 }
602 set
603 {
604 this.inventoryRoot = value;
605 }
606 }
607
608 public ArrayList InventorySkeleton
609 {
610 get
611 {
612 return this.agentInventory;
613 }
614 set
615 {
616 this.agentInventory = value;
617 }
618 }
619
620 public string Home
621 {
622 get
623 {
624 return this.home;
625 }
626 set
627 {
628 this.home = value;
629 }
630 }
631
632 public string Message
633 {
634 get
635 {
636 return this.welcomeMessage;
637 }
638 set
639 {
640 this.welcomeMessage = value;
641 }
642 }
643 #endregion
644
645
646 public class UserInfo
647 {
648 public string firstname;
649 public string lastname;
650 public ulong homeregionhandle;
651 public LLVector3 homepos;
652 public LLVector3 homelookat;
653 }
654 }
655}
656
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj
index 232712b..9a3cdba 100644
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj
+++ b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.csproj
@@ -108,6 +108,9 @@
108 </ProjectReference> 108 </ProjectReference>
109 </ItemGroup> 109 </ItemGroup>
110 <ItemGroup> 110 <ItemGroup>
111 <Compile Include="LoginResponse.cs">
112 <SubType>Code</SubType>
113 </Compile>
111 <Compile Include="UserManagerBase.cs"> 114 <Compile Include="UserManagerBase.cs">
112 <SubType>Code</SubType> 115 <SubType>Code</SubType>
113 </Compile> 116 </Compile>
diff --git a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build
index a2f5d13..9dc2383 100644
--- a/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build
+++ b/Common/OpenGrid.Framework.UserManager/OpenGrid.Framework.UserManagement.dll.build
@@ -11,6 +11,7 @@
11 <resources prefix="OpenGrid.Framework.UserManagement" dynamicprefix="true" > 11 <resources prefix="OpenGrid.Framework.UserManagement" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="LoginResponse.cs" />
14 <include name="UserManagerBase.cs" /> 15 <include name="UserManagerBase.cs" />
15 </sources> 16 </sources>
16 <references basedir="${project::get-base-directory()}"> 17 <references basedir="${project::get-base-directory()}">
diff --git a/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs b/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs
index eaa53dd..01fbf3a 100644
--- a/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs
+++ b/Common/OpenGrid.Framework.UserManager/UserManagerBase.cs
@@ -79,37 +79,7 @@ namespace OpenGrid.Framework.UserManagement
79 pluginAssembly = null; 79 pluginAssembly = null;
80 } 80 }
81 81
82 /// <summary> 82 #region Get UserProfile
83 ///
84 /// </summary>
85 /// <param name="user"></param>
86 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
87 {
88 UserProfileData user = new UserProfileData();
89 user.homeLocation = new LLVector3(128, 128, 100);
90 user.UUID = LLUUID.Random();
91 user.username = firstName;
92 user.surname = lastName;
93 user.passwordHash = pass;
94 user.passwordSalt = "";
95 user.created = Util.UnixTimeSinceEpoch();
96 user.homeLookAt = new LLVector3(100, 100, 100);
97 user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
98
99 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
100 {
101 try
102 {
103 plugin.Value.addNewUserProfile(user);
104
105 }
106 catch (Exception e)
107 {
108 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
109 }
110 }
111 }
112
113 /// <summary> 83 /// <summary>
114 /// Loads a user profile from a database by UUID 84 /// Loads a user profile from a database by UUID
115 /// </summary> 85 /// </summary>
@@ -190,7 +160,9 @@ namespace OpenGrid.Framework.UserManagement
190 160
191 return null; 161 return null;
192 } 162 }
163 #endregion
193 164
165 #region Get UserAgent
194 /// <summary> 166 /// <summary>
195 /// Loads a user agent by uuid (not called directly) 167 /// Loads a user agent by uuid (not called directly)
196 /// </summary> 168 /// </summary>
@@ -258,94 +230,9 @@ namespace OpenGrid.Framework.UserManagement
258 return null; 230 return null;
259 } 231 }
260 232
261 /// <summary> 233 #endregion
262 /// Creates a error response caused by invalid XML
263 /// </summary>
264 /// <returns>An XMLRPC response</returns>
265 private static XmlRpcResponse CreateErrorConnectingToGridResponse()
266 {
267 XmlRpcResponse response = new XmlRpcResponse();
268 Hashtable ErrorRespData = new Hashtable();
269 ErrorRespData["reason"] = "key";
270 ErrorRespData["message"] = "Error connecting to grid. Could not percieve credentials from login XML.";
271 ErrorRespData["login"] = "false";
272 response.Value = ErrorRespData;
273 return response;
274 }
275
276 /// <summary>
277 /// Creates an error response caused by bad login credentials
278 /// </summary>
279 /// <returns>An XMLRPC response</returns>
280 private static XmlRpcResponse CreateLoginErrorResponse()
281 {
282 XmlRpcResponse response = new XmlRpcResponse();
283 Hashtable ErrorRespData = new Hashtable();
284 ErrorRespData["reason"] = "key";
285 ErrorRespData["message"] = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.";
286 ErrorRespData["login"] = "false";
287 response.Value = ErrorRespData;
288 return response;
289 }
290
291 /// <summary>
292 /// Creates an error response caused by being logged in already
293 /// </summary>
294 /// <returns>An XMLRPC Response</returns>
295 private static XmlRpcResponse CreateAlreadyLoggedInResponse()
296 {
297 XmlRpcResponse response = new XmlRpcResponse();
298 Hashtable PresenceErrorRespData = new Hashtable();
299 PresenceErrorRespData["reason"] = "presence";
300 PresenceErrorRespData["message"] = "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner";
301 PresenceErrorRespData["login"] = "false";
302 response.Value = PresenceErrorRespData;
303 return response;
304 }
305
306 /// <summary>
307 /// Creates an error response caused by target region being down
308 /// </summary>
309 /// <returns>An XMLRPC Response</returns>
310 private static XmlRpcResponse CreateDeadRegionResponse()
311 {
312 XmlRpcResponse response = new XmlRpcResponse();
313 Hashtable PresenceErrorRespData = new Hashtable();
314 PresenceErrorRespData["reason"] = "key";
315 PresenceErrorRespData["message"] = "The region you are attempting to log into is not responding. Please select another region and try again.";
316 PresenceErrorRespData["login"] = "false";
317 response.Value = PresenceErrorRespData;
318 return response;
319 }
320
321 /// <summary>
322 /// Customises the login response and fills in missing values.
323 /// </summary>
324 /// <param name="response">The existing response</param>
325 /// <param name="theUser">The user profile</param>
326 public virtual void CustomiseResponse(ref Hashtable response, ref UserProfileData theUser)
327 {
328
329 }
330
331 /// <summary>
332 /// Checks a user against it's password hash
333 /// </summary>
334 /// <param name="profile">The users profile</param>
335 /// <param name="password">The supplied password</param>
336 /// <returns>Authenticated?</returns>
337 public bool AuthenticateUser(ref UserProfileData profile, string password)
338 {
339 OpenSim.Framework.Console.MainLog.Instance.Verbose(
340 "Authenticating " + profile.username + " " + profile.surname);
341
342 password = password.Remove(0, 3); //remove $1$
343
344 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
345
346 return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
347 }
348 234
235 #region CreateAgent
349 /// <summary> 236 /// <summary>
350 /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB 237 /// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB
351 /// </summary> 238 /// </summary>
@@ -390,7 +277,7 @@ namespace OpenGrid.Framework.UserManagement
390 { 277 {
391 string[] parts = startLoc.Remove(0, 4).Split('&'); 278 string[] parts = startLoc.Remove(0, 4).Split('&');
392 string region = parts[0]; 279 string region = parts[0];
393 280
394 //////////////////////////////////////////////////// 281 ////////////////////////////////////////////////////
395 //SimProfile SimInfo = new SimProfile(); 282 //SimProfile SimInfo = new SimProfile();
396 //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey); 283 //SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
@@ -424,6 +311,58 @@ namespace OpenGrid.Framework.UserManagement
424 return true; 311 return true;
425 } 312 }
426 313
314 #endregion
315
316 /// <summary>
317 /// Checks a user against it's password hash
318 /// </summary>
319 /// <param name="profile">The users profile</param>
320 /// <param name="password">The supplied password</param>
321 /// <returns>Authenticated?</returns>
322 public virtual bool AuthenticateUser(ref UserProfileData profile, string password)
323 {
324 OpenSim.Framework.Console.MainLog.Instance.Verbose(
325 "Authenticating " + profile.username + " " + profile.surname);
326
327 password = password.Remove(0, 3); //remove $1$
328
329 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
330
331 return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
332 }
333
334 #region Xml Response
335
336 /// <summary>
337 ///
338 /// </summary>
339 /// <param name="firstname"></param>
340 /// <param name="lastname"></param>
341 /// <returns></returns>
342 public virtual UserProfileData GetTheUser(string firstname, string lastname)
343 {
344 return getUserProfile(firstname, lastname);
345 }
346
347 /// <summary>
348 ///
349 /// </summary>
350 /// <returns></returns>
351 public virtual string GetMessage()
352 {
353 return _config.DefaultStartupMsg;
354 }
355
356 /// <summary>
357 /// Customises the login response and fills in missing values.
358 /// </summary>
359 /// <param name="response">The existing response</param>
360 /// <param name="theUser">The user profile</param>
361 public virtual void CustomiseResponse(ref LoginResponse response, ref UserProfileData theUser)
362 {
363
364 }
365
427 /// <summary> 366 /// <summary>
428 /// Main user login function 367 /// Main user login function
429 /// </summary> 368 /// </summary>
@@ -441,6 +380,7 @@ namespace OpenGrid.Framework.UserManagement
441 string passwd = ""; 380 string passwd = "";
442 381
443 UserProfileData TheUser; 382 UserProfileData TheUser;
383 LoginResponse logResponse = new LoginResponse();
444 384
445 if (GoodXML) 385 if (GoodXML)
446 { 386 {
@@ -448,20 +388,20 @@ namespace OpenGrid.Framework.UserManagement
448 lastname = (string)requestData["last"]; 388 lastname = (string)requestData["last"];
449 passwd = (string)requestData["passwd"]; 389 passwd = (string)requestData["passwd"];
450 390
451 TheUser = getUserProfile(firstname, lastname); 391 TheUser = GetTheUser(firstname, lastname);
452 if (TheUser == null) 392 if (TheUser == null)
453 return CreateLoginErrorResponse(); 393 return logResponse.CreateLoginFailedResponse();
454 394
455 GoodLogin = AuthenticateUser(ref TheUser, passwd); 395 GoodLogin = AuthenticateUser(ref TheUser, passwd);
456 } 396 }
457 else 397 else
458 { 398 {
459 return CreateErrorConnectingToGridResponse(); 399 return logResponse.CreateGridErrorResponse();
460 } 400 }
461 401
462 if (!GoodLogin) 402 if (!GoodLogin)
463 { 403 {
464 return CreateLoginErrorResponse(); 404 return logResponse.CreateLoginFailedResponse();
465 } 405 }
466 else 406 else
467 { 407 {
@@ -469,7 +409,7 @@ namespace OpenGrid.Framework.UserManagement
469 if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline) 409 if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline)
470 { 410 {
471 // Reject the login 411 // Reject the login
472 return CreateAlreadyLoggedInResponse(); 412 return logResponse.CreateAlreadyLoggedInResponse();
473 } 413 }
474 // Otherwise... 414 // Otherwise...
475 // Create a new agent session 415 // Create a new agent session
@@ -477,39 +417,8 @@ namespace OpenGrid.Framework.UserManagement
477 417
478 try 418 try
479 { 419 {
480 Hashtable responseData = new Hashtable();
481 420
482 LLUUID AgentID = TheUser.UUID; 421 LLUUID AgentID = TheUser.UUID;
483
484 // Global Texture Section
485 Hashtable GlobalT = new Hashtable();
486 GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
487 GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
488 GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
489 ArrayList GlobalTextures = new ArrayList();
490 GlobalTextures.Add(GlobalT);
491
492 // Login Flags Section
493 Hashtable LoginFlagsHash = new Hashtable();
494 LoginFlagsHash["daylight_savings"] = "N";
495 LoginFlagsHash["stipend_since_login"] = "N";
496 LoginFlagsHash["gendered"] = "Y"; // Needs to be combined with below...
497 LoginFlagsHash["ever_logged_in"] = "Y"; // Should allow male/female av selection
498 ArrayList LoginFlags = new ArrayList();
499 LoginFlags.Add(LoginFlagsHash);
500
501 // UI Customisation Section
502 Hashtable uiconfig = new Hashtable();
503 uiconfig["allow_first_life"] = "Y";
504 ArrayList ui_config = new ArrayList();
505 ui_config.Add(uiconfig);
506
507 // Classified Categories Section
508 Hashtable ClassifiedCategoriesHash = new Hashtable();
509 ClassifiedCategoriesHash["category_name"] = "Generic";
510 ClassifiedCategoriesHash["category_id"] = (Int32)1;
511 ArrayList ClassifiedCategories = new ArrayList();
512 ClassifiedCategories.Add(ClassifiedCategoriesHash);
513 422
514 // Inventory Library Section 423 // Inventory Library Section
515 ArrayList AgentInventoryArray = new ArrayList(); 424 ArrayList AgentInventoryArray = new ArrayList();
@@ -534,62 +443,37 @@ namespace OpenGrid.Framework.UserManagement
534 ArrayList InventoryRoot = new ArrayList(); 443 ArrayList InventoryRoot = new ArrayList();
535 InventoryRoot.Add(InventoryRootHash); 444 InventoryRoot.Add(InventoryRootHash);
536 445
537 Hashtable InitialOutfitHash = new Hashtable();
538 InitialOutfitHash["folder_name"] = "Nightclub Female";
539 InitialOutfitHash["gender"] = "female";
540 ArrayList InitialOutfit = new ArrayList();
541 InitialOutfit.Add(InitialOutfitHash);
542
543 // Circuit Code 446 // Circuit Code
544 uint circode = (uint)(Util.RandomClass.Next()); 447 uint circode = (uint)(Util.RandomClass.Next());
545 448
546 // Generics 449 logResponse.Lastname = TheUser.surname;
547 responseData["last_name"] = TheUser.surname; 450 logResponse.Firstname = TheUser.username;
548 responseData["ui-config"] = ui_config; 451 logResponse.AgentID = AgentID.ToStringHyphenated();
549 responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString(); 452 logResponse.SessionID = TheUser.currentAgent.sessionID.ToStringHyphenated();
550 responseData["login-flags"] = LoginFlags; 453 logResponse.SecureSessionID = TheUser.currentAgent.secureSessionID.ToStringHyphenated();
551 responseData["global-textures"] = GlobalTextures; 454 logResponse.InventoryRoot = InventoryRoot;
552 responseData["classified_categories"] = ClassifiedCategories; 455 logResponse.InventorySkeleton = AgentInventoryArray;
553 responseData["event_categories"] = new ArrayList(); 456 logResponse.CircuitCode = (Int32)circode;
554 responseData["inventory-skeleton"] = AgentInventoryArray; 457 logResponse.RegionX = 0; //overwritten
555 responseData["inventory-skel-lib"] = new ArrayList(); 458 logResponse.RegionY = 0; //overwritten
556 responseData["inventory-root"] = InventoryRoot; 459 logResponse.Home = "!!null temporary value {home}!!"; // Overwritten
557 responseData["event_notifications"] = new ArrayList(); 460 //logResponse.LookAt = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
558 responseData["gestures"] = new ArrayList(); 461 logResponse.SimAddress = "127.0.0.1"; //overwritten
559 responseData["inventory-lib-owner"] = new ArrayList(); 462 logResponse.SimPort = 0; //overwritten
560 responseData["initial-outfit"] = InitialOutfit; 463 logResponse.Message = this.GetMessage();
561 responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 464
562 responseData["start_location"] = "last";
563 responseData["home"] = "!!null temporary value {home}!!"; // Overwritten
564 responseData["message"] = _config.DefaultStartupMsg;
565 responseData["first_name"] = TheUser.username;
566 responseData["circuit_code"] = (Int32)circode;
567 responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port;
568 responseData["secure_session_id"] = TheUser.currentAgent.secureSessionID.ToStringHyphenated();
569 responseData["look_at"] = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
570 responseData["agent_id"] = AgentID.ToStringHyphenated();
571 responseData["region_y"] = (Int32)0; // Overwritten
572 responseData["region_x"] = (Int32)0; // Overwritten
573 responseData["seed_capability"] = "";
574 responseData["agent_access"] = "M";
575 responseData["session_id"] = TheUser.currentAgent.sessionID.ToStringHyphenated();
576 responseData["login"] = "true";
577
578 try 465 try
579 { 466 {
580 this.CustomiseResponse(ref responseData, ref TheUser); 467 this.CustomiseResponse(ref logResponse, ref TheUser);
581 } 468 }
582 catch (Exception e) 469 catch (Exception e)
583 { 470 {
584 Console.WriteLine(e.ToString()); 471 Console.WriteLine(e.ToString());
585 return CreateDeadRegionResponse(); 472 return logResponse.CreateDeadRegionResponse();
586 } 473 }
587
588 CommitAgent(ref TheUser); 474 CommitAgent(ref TheUser);
589 475
590 response.Value = responseData; 476 return logResponse.ToXmlRpcResponse();
591 // TheUser.SendDataToSim(SimInfo);
592 return response;
593 477
594 } 478 }
595 catch (Exception E) 479 catch (Exception E)
@@ -602,6 +486,8 @@ namespace OpenGrid.Framework.UserManagement
602 486
603 } 487 }
604 488
489 #endregion
490
605 /// <summary> 491 /// <summary>
606 /// Deletes an active agent session 492 /// Deletes an active agent session
607 /// </summary> 493 /// </summary>
@@ -617,6 +503,37 @@ namespace OpenGrid.Framework.UserManagement
617 } 503 }
618 504
619 /// <summary> 505 /// <summary>
506 ///
507 /// </summary>
508 /// <param name="user"></param>
509 public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
510 {
511 UserProfileData user = new UserProfileData();
512 user.homeLocation = new LLVector3(128, 128, 100);
513 user.UUID = LLUUID.Random();
514 user.username = firstName;
515 user.surname = lastName;
516 user.passwordHash = pass;
517 user.passwordSalt = "";
518 user.created = Util.UnixTimeSinceEpoch();
519 user.homeLookAt = new LLVector3(100, 100, 100);
520 user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
521
522 foreach (KeyValuePair<string, IUserData> plugin in _plugins)
523 {
524 try
525 {
526 plugin.Value.addNewUserProfile(user);
527
528 }
529 catch (Exception e)
530 {
531 OpenSim.Framework.Console.MainLog.Instance.Verbose("Unable to add user via " + plugin.Key + "(" + e.ToString() + ")");
532 }
533 }
534 }
535
536 /// <summary>
620 /// Returns an error message that the user could not be found in the database 537 /// Returns an error message that the user could not be found in the database
621 /// </summary> 538 /// </summary>
622 /// <returns>XML string consisting of a error element containing individual error(s)</returns> 539 /// <returns>XML string consisting of a error element containing individual error(s)</returns>
@@ -693,6 +610,8 @@ namespace OpenGrid.Framework.UserManagement
693 return sw.ToString(); 610 return sw.ToString();
694 } 611 }
695 612
613 #region REST Methods
614 //should most likely move out of here and into the grid's userserver sub class
696 public string RestGetUserMethodName(string request, string path, string param) 615 public string RestGetUserMethodName(string request, string path, string param)
697 { 616 {
698 UserProfileData userProfile = getUserProfile(param.Trim()); 617 UserProfileData userProfile = getUserProfile(param.Trim());
@@ -716,6 +635,7 @@ namespace OpenGrid.Framework.UserManagement
716 635
717 return ProfileToXml(userProfile); 636 return ProfileToXml(userProfile);
718 } 637 }
638 #endregion
719 639
720 } 640 }
721} 641}
diff --git a/Common/OpenSim.Framework/Types/NetworkServersInfo.cs b/Common/OpenSim.Framework/Types/NetworkServersInfo.cs
index 0cf0ea6..709b7dd 100644
--- a/Common/OpenSim.Framework/Types/NetworkServersInfo.cs
+++ b/Common/OpenSim.Framework/Types/NetworkServersInfo.cs
@@ -45,16 +45,47 @@ namespace OpenSim.Framework.Types
45 public string UserRecvKey = ""; 45 public string UserRecvKey = "";
46 public bool isSandbox; 46 public bool isSandbox;
47 47
48 public uint DefaultHomeLocX = 0;
49 public uint DefaultHomeLocY = 0;
50
48 public void InitConfig(bool sandboxMode, IGenericConfig configData) 51 public void InitConfig(bool sandboxMode, IGenericConfig configData)
49 { 52 {
50 this.isSandbox = sandboxMode; 53 this.isSandbox = sandboxMode;
51 54
52 try 55 try
53 { 56 {
57 string attri = "";
58 // default home location X
59 attri = "";
60 attri = configData.GetAttribute("DefaultLocationX");
61 if (attri == "")
62 {
63 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location X", "1000");
64 configData.SetAttribute("DefaultLocationX", location);
65 this.DefaultHomeLocX = (uint)Convert.ToUInt32(location);
66 }
67 else
68 {
69 this.DefaultHomeLocX = (uint)Convert.ToUInt32(attri);
70 }
71
72 // default home location Y
73 attri = "";
74 attri = configData.GetAttribute("DefaultLocationY");
75 if (attri == "")
76 {
77 string location = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default Home Location Y", "1000");
78 configData.SetAttribute("DefaultLocationY", location);
79 this.DefaultHomeLocY = (uint)Convert.ToUInt32(location);
80 }
81 else
82 {
83 this.DefaultHomeLocY = (uint)Convert.ToUInt32(attri);
84 }
85
54 if (!isSandbox) 86 if (!isSandbox)
55 { 87 {
56 string attri = ""; 88 //Grid Server
57 //Grid Server URL
58 attri = ""; 89 attri = "";
59 attri = configData.GetAttribute("GridServerURL"); 90 attri = configData.GetAttribute("GridServerURL");
60 if (attri == "") 91 if (attri == "")
diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs
index 836b8fb..56d41b3 100644
--- a/Common/OpenSim.Framework/Types/PrimData.cs
+++ b/Common/OpenSim.Framework/Types/PrimData.cs
@@ -60,7 +60,6 @@ namespace OpenSim.Framework.Types
60 public sbyte PathTwistBegin; 60 public sbyte PathTwistBegin;
61 public byte[] Texture; 61 public byte[] Texture;
62 62
63
64 public Int32 CreationDate; 63 public Int32 CreationDate;
65 public uint OwnerMask = FULL_MASK_PERMISSIONS; 64 public uint OwnerMask = FULL_MASK_PERMISSIONS;
66 public uint NextOwnerMask = FULL_MASK_PERMISSIONS; 65 public uint NextOwnerMask = FULL_MASK_PERMISSIONS;
diff --git a/Common/OpenSim.Servers/LoginResponse.cs b/Common/OpenSim.Servers/LoginResponse.cs
index debfe43..dc4732c 100644
--- a/Common/OpenSim.Servers/LoginResponse.cs
+++ b/Common/OpenSim.Servers/LoginResponse.cs
@@ -72,7 +72,7 @@ namespace OpenSim.UserServer
72 private ArrayList initialOutfit; 72 private ArrayList initialOutfit;
73 private ArrayList agentInventory; 73 private ArrayList agentInventory;
74 74
75 private UserProfile userProfile; 75 private UserInfo userProfile;
76 76
77 private LLUUID agentID; 77 private LLUUID agentID;
78 private LLUUID sessionID; 78 private LLUUID sessionID;
@@ -131,7 +131,7 @@ namespace OpenSim.UserServer
131 this.uiConfigHash = new Hashtable(); 131 this.uiConfigHash = new Hashtable();
132 132
133 this.defaultXmlRpcResponse = new XmlRpcResponse(); 133 this.defaultXmlRpcResponse = new XmlRpcResponse();
134 this.userProfile = new UserProfile(); 134 this.userProfile = new UserInfo();
135 this.inventoryRoot = new ArrayList(); 135 this.inventoryRoot = new ArrayList();
136 this.initialOutfit = new ArrayList(); 136 this.initialOutfit = new ArrayList();
137 this.agentInventory = new ArrayList(); 137 this.agentInventory = new ArrayList();
@@ -181,28 +181,9 @@ namespace OpenSim.UserServer
181 this.AddClassifiedCategory((Int32)8, "Service"); 181 this.AddClassifiedCategory((Int32)8, "Service");
182 this.AddClassifiedCategory((Int32)9, "Personal"); 182 this.AddClassifiedCategory((Int32)9, "Personal");
183 183
184 int SessionRand = Util.RandomClass.Next(1, 999); 184 this.SessionID = LLUUID.Random();
185 this.SessionID = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797");
186 this.SecureSessionID = LLUUID.Random(); 185 this.SecureSessionID = LLUUID.Random();
187 186 this.AgentID = LLUUID.Random();
188 this.userProfile.Inventory.CreateRootFolder(this.userProfile.UUID, true);
189 this.baseFolderID = this.userProfile.Inventory.GetFolderID("Textures");
190 this.inventoryFolderID = this.userProfile.Inventory.GetFolderID("My Inventory-");
191 Hashtable InventoryRootHash = new Hashtable();
192 InventoryRootHash["folder_id"] = this.userProfile.Inventory.InventoryRoot.FolderID.ToStringHyphenated();
193 this.inventoryRoot.Add(InventoryRootHash);
194
195 Hashtable TempHash;
196 foreach (InventoryFolder InvFolder in this.userProfile.Inventory.InventoryFolders.Values)
197 {
198 TempHash = new Hashtable();
199 TempHash["name"] = InvFolder.FolderName;
200 TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
201 TempHash["version"] = (Int32)InvFolder.Version;
202 TempHash["type_default"] = (Int32)InvFolder.DefaultType;
203 TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
204 this.agentInventory.Add(TempHash);
205 }
206 187
207 Hashtable InitialOutfitHash = new Hashtable(); 188 Hashtable InitialOutfitHash = new Hashtable();
208 InitialOutfitHash["folder_name"] = "Nightclub Female"; 189 InitialOutfitHash["folder_name"] = "Nightclub Female";
@@ -219,15 +200,6 @@ namespace OpenSim.UserServer
219 200
220 } // SetDefaultValues 201 } // SetDefaultValues
221 202
222 protected virtual LLUUID GetAgentId()
223 {
224 // todo
225 LLUUID Agent;
226 int AgentRand = Util.RandomClass.Next(1, 9999);
227 Agent = new LLUUID("99998888-0100-" + AgentRand.ToString("0000") + "-8ec1-0b1d5cd6aead");
228 return Agent;
229 } // GetAgentId
230
231 private XmlRpcResponse GenerateFailureResponse(string reason, string message, string login) 203 private XmlRpcResponse GenerateFailureResponse(string reason, string message, string login)
232 { 204 {
233 // Overwrite any default values; 205 // Overwrite any default values;
@@ -287,9 +259,6 @@ namespace OpenSim.UserServer
287 this.AddToUIConfig("allow_first_life", this.allowFirstLife); 259 this.AddToUIConfig("allow_first_life", this.allowFirstLife);
288 this.uiConfig.Add(this.uiConfigHash); 260 this.uiConfig.Add(this.uiConfigHash);
289 261
290 // Create a agent and session LLUUID
291 this.agentID = this.GetAgentId();
292
293 responseData["sim_port"] = this.SimPort; 262 responseData["sim_port"] = this.SimPort;
294 responseData["sim_ip"] = this.SimAddress; 263 responseData["sim_ip"] = this.SimAddress;
295 responseData["agent_id"] = this.AgentID.ToStringHyphenated(); 264 responseData["agent_id"] = this.AgentID.ToStringHyphenated();
@@ -320,6 +289,9 @@ namespace OpenSim.UserServer
320 responseData["region_x"] = (Int32)this.RegionX * 256; 289 responseData["region_x"] = (Int32)this.RegionX * 256;
321 responseData["region_y"] = (Int32)this.RegionY * 256; 290 responseData["region_y"] = (Int32)this.RegionY * 256;
322 291
292 //responseData["inventory-lib-root"] = new ArrayList(); // todo
293 //responseData["buddy-list"] = new ArrayList(); // todo
294
323 responseData["login"] = "true"; 295 responseData["login"] = "true";
324 this.xmlRpcResponse.Value = responseData; 296 this.xmlRpcResponse.Value = responseData;
325 297
@@ -355,6 +327,7 @@ namespace OpenSim.UserServer
355 // this.classifiedCategoriesHash.Clear(); 327 // this.classifiedCategoriesHash.Clear();
356 } // SetClassifiedCategory 328 } // SetClassifiedCategory
357 329
330 #region Properties
358 public string Login 331 public string Login
359 { 332 {
360 get 333 get
@@ -667,5 +640,16 @@ namespace OpenSim.UserServer
667 } 640 }
668 } // ErrorMessage 641 } // ErrorMessage
669 642
670 } // LoginResponse 643 #endregion
671} // namespace OpenSim.UserServer \ No newline at end of file 644
645
646 public class UserInfo
647 {
648 public string firstname;
649 public string lastname;
650 public ulong homeregionhandle;
651 public LLVector3 homepos;
652 public LLVector3 homelookat;
653 }
654 }
655} \ No newline at end of file
diff --git a/Common/OpenSim.Servers/LoginServer.cs b/Common/OpenSim.Servers/LoginServer.cs
index 1243147..e5373dd 100644
--- a/Common/OpenSim.Servers/LoginServer.cs
+++ b/Common/OpenSim.Servers/LoginServer.cs
@@ -148,36 +148,14 @@ namespace OpenSim.UserServer
148 148
149 NumClients++; 149 NumClients++;
150 150
151 // Create a agent and session LLUUID
152 // Agent = GetAgentId(first, last);
153 // int SessionRand = Util.RandomClass.Next(1, 999);
154 // Session = new LLUUID("aaaabbbb-0200-" + SessionRand.ToString("0000") + "-8664-58f53e442797");
155 // LLUUID secureSess = LLUUID.Random();
156
157 loginResponse.SimPort = m_simPort.ToString(); 151 loginResponse.SimPort = m_simPort.ToString();
158 loginResponse.SimAddress = m_simAddr.ToString(); 152 loginResponse.SimAddress = m_simAddr.ToString();
159 // loginResponse.AgentID = Agent.ToStringHyphenated(); 153
160 // loginResponse.SessionID = Session.ToStringHyphenated();
161 // loginResponse.SecureSessionID = secureSess.ToStringHyphenated();
162 loginResponse.CircuitCode = (Int32)(Util.RandomClass.Next()); 154 loginResponse.CircuitCode = (Int32)(Util.RandomClass.Next());
163 XmlRpcResponse response = loginResponse.ToXmlRpcResponse(); 155 XmlRpcResponse response = loginResponse.ToXmlRpcResponse();
164 Hashtable responseData = (Hashtable)response.Value; 156 Hashtable responseData = (Hashtable)response.Value;
165 157
166 //inventory 158
167 /* ArrayList InventoryList = (ArrayList)responseData["inventory-skeleton"];
168 Hashtable Inventory1 = (Hashtable)InventoryList[0];
169 Hashtable Inventory2 = (Hashtable)InventoryList[1];
170 LLUUID BaseFolderID = LLUUID.Random();
171 LLUUID InventoryFolderID = LLUUID.Random();
172 Inventory2["name"] = "Textures";
173 Inventory2["folder_id"] = BaseFolderID.ToStringHyphenated();
174 Inventory2["type_default"] = 0;
175 Inventory1["folder_id"] = InventoryFolderID.ToStringHyphenated();
176
177 ArrayList InventoryRoot = (ArrayList)responseData["inventory-root"];
178 Hashtable Inventoryroot = (Hashtable)InventoryRoot[0];
179 Inventoryroot["folder_id"] = InventoryFolderID.ToStringHyphenated();
180 */
181 CustomiseLoginResponse(responseData, first, last); 159 CustomiseLoginResponse(responseData, first, last);
182 160
183 Login _login = new Login(); 161 Login _login = new Login();
@@ -191,11 +169,6 @@ namespace OpenSim.UserServer
191 _login.BaseFolder = loginResponse.BaseFolderID; 169 _login.BaseFolder = loginResponse.BaseFolderID;
192 _login.InventoryFolder = loginResponse.InventoryFolderID; 170 _login.InventoryFolder = loginResponse.InventoryFolderID;
193 171
194 //working on local computer if so lets add to the gridserver's list of sessions?
195 /* if (m_gridServer.GetName() == "Local")
196 {
197 ((LocalGridBase)m_gridServer).AddNewSession(_login);
198 }*/
199 ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256)); 172 ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256));
200 AddSession(reghand,_login); 173 AddSession(reghand,_login);
201 174