diff options
author | MW | 2007-08-13 13:39:24 +0000 |
---|---|---|
committer | MW | 2007-08-13 13:39:24 +0000 |
commit | 82f8ecf6738aba335c8ff410840a0758673af6f9 (patch) | |
tree | 4a7a92d86db418a49e0352042d8f55653a0e54d2 /OpenSim/Framework | |
parent | Deleted some unused code. (diff) | |
download | opensim-SC_OLD-82f8ecf6738aba335c8ff410840a0758673af6f9.zip opensim-SC_OLD-82f8ecf6738aba335c8ff410840a0758673af6f9.tar.gz opensim-SC_OLD-82f8ecf6738aba335c8ff410840a0758673af6f9.tar.bz2 opensim-SC_OLD-82f8ecf6738aba335c8ff410840a0758673af6f9.tar.xz |
Some work to prepare for inventory server.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/UserManager/UserManagerBase.cs | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index 41744bd..64c3be1 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -418,6 +418,31 @@ namespace OpenSim.Framework.UserManagement | |||
418 | return inventoryLibOwner; | 418 | return inventoryLibOwner; |
419 | } | 419 | } |
420 | 420 | ||
421 | protected virtual AgentInventory GetUsersInventory(LLUUID agentID) | ||
422 | { | ||
423 | AgentInventory userInventory = new AgentInventory(); | ||
424 | userInventory.CreateRootFolder(agentID, false); | ||
425 | |||
426 | return userInventory; | ||
427 | } | ||
428 | |||
429 | protected virtual ArrayList CreateInventoryArray(AgentInventory userInventory) | ||
430 | { | ||
431 | ArrayList AgentInventoryArray = new ArrayList(); | ||
432 | Hashtable TempHash; | ||
433 | foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values) | ||
434 | { | ||
435 | TempHash = new Hashtable(); | ||
436 | TempHash["name"] = InvFolder.FolderName; | ||
437 | TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); | ||
438 | TempHash["version"] = (Int32)InvFolder.Version; | ||
439 | TempHash["type_default"] = (Int32)InvFolder.DefaultType; | ||
440 | TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); | ||
441 | AgentInventoryArray.Add(TempHash); | ||
442 | } | ||
443 | return AgentInventoryArray; | ||
444 | } | ||
445 | |||
421 | /// <summary> | 446 | /// <summary> |
422 | /// Customises the login response and fills in missing values. | 447 | /// Customises the login response and fills in missing values. |
423 | /// </summary> | 448 | /// </summary> |
@@ -481,39 +506,24 @@ namespace OpenSim.Framework.UserManagement | |||
481 | 506 | ||
482 | try | 507 | try |
483 | { | 508 | { |
484 | 509 | LLUUID agentID = userProfile.UUID; | |
485 | LLUUID AgentID = userProfile.UUID; | ||
486 | 510 | ||
487 | // Inventory Library Section | 511 | // Inventory Library Section |
488 | ArrayList AgentInventoryArray = new ArrayList(); | 512 | AgentInventory userInventory = this.GetUsersInventory(agentID); |
489 | Hashtable TempHash; | 513 | ArrayList AgentInventoryArray = this.CreateInventoryArray(userInventory); |
490 | |||
491 | AgentInventory Library = new AgentInventory(); | ||
492 | Library.CreateRootFolder(AgentID, false); | ||
493 | |||
494 | foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values) | ||
495 | { | ||
496 | TempHash = new Hashtable(); | ||
497 | TempHash["name"] = InvFolder.FolderName; | ||
498 | TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated(); | ||
499 | TempHash["version"] = (Int32)InvFolder.Version; | ||
500 | TempHash["type_default"] = (Int32)InvFolder.DefaultType; | ||
501 | TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated(); | ||
502 | AgentInventoryArray.Add(TempHash); | ||
503 | } | ||
504 | 514 | ||
505 | Hashtable InventoryRootHash = new Hashtable(); | 515 | Hashtable InventoryRootHash = new Hashtable(); |
506 | InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated(); | 516 | InventoryRootHash["folder_id"] = userInventory.InventoryRoot.FolderID.ToStringHyphenated(); |
507 | ArrayList InventoryRoot = new ArrayList(); | 517 | ArrayList InventoryRoot = new ArrayList(); |
508 | InventoryRoot.Add(InventoryRootHash); | 518 | InventoryRoot.Add(InventoryRootHash); |
509 | userProfile.rootInventoryFolderID = Library.InventoryRoot.FolderID; | 519 | userProfile.rootInventoryFolderID = userInventory.InventoryRoot.FolderID; |
510 | 520 | ||
511 | // Circuit Code | 521 | // Circuit Code |
512 | uint circode = (uint)(Util.RandomClass.Next()); | 522 | uint circode = (uint)(Util.RandomClass.Next()); |
513 | 523 | ||
514 | logResponse.Lastname = userProfile.surname; | 524 | logResponse.Lastname = userProfile.surname; |
515 | logResponse.Firstname = userProfile.username; | 525 | logResponse.Firstname = userProfile.username; |
516 | logResponse.AgentID = AgentID.ToStringHyphenated(); | 526 | logResponse.AgentID = agentID.ToStringHyphenated(); |
517 | logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated(); | 527 | logResponse.SessionID = userProfile.currentAgent.sessionID.ToStringHyphenated(); |
518 | logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); | 528 | logResponse.SecureSessionID = userProfile.currentAgent.secureSessionID.ToStringHyphenated(); |
519 | logResponse.InventoryRoot = InventoryRoot; | 529 | logResponse.InventoryRoot = InventoryRoot; |