diff options
author | Justin Clarke Casey | 2008-03-28 16:39:38 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-03-28 16:39:38 +0000 |
commit | c8f79eb9b49a4704e32a26ec04aeec3ff4c02754 (patch) | |
tree | 485303a3089f884805df965e24341bceea092891 /OpenSim/Framework/Communications | |
parent | * Remove pointless boolean on AgentInventory.CreateRootFolder() (diff) | |
download | opensim-SC-c8f79eb9b49a4704e32a26ec04aeec3ff4c02754.zip opensim-SC-c8f79eb9b49a4704e32a26ec04aeec3ff4c02754.tar.gz opensim-SC-c8f79eb9b49a4704e32a26ec04aeec3ff4c02754.tar.bz2 opensim-SC-c8f79eb9b49a4704e32a26ec04aeec3ff4c02754.tar.xz |
* Refactor: Rename CreateInventoryData() to GetInventorySkeleton()
* Replace the unused default GetInventorySkeleton() impleemntation with an abstract declaration - less confusing this way imho
* Add some comments
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 2286b59..e738d0b 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs | |||
@@ -41,7 +41,7 @@ using OpenSim.Framework.Statistics; | |||
41 | 41 | ||
42 | namespace OpenSim.Framework.UserManagement | 42 | namespace OpenSim.Framework.UserManagement |
43 | { | 43 | { |
44 | public class LoginService | 44 | public abstract class LoginService |
45 | { | 45 | { |
46 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
@@ -73,6 +73,20 @@ namespace OpenSim.Framework.UserManagement | |||
73 | } | 73 | } |
74 | 74 | ||
75 | /// <summary> | 75 | /// <summary> |
76 | /// Customises the login response and fills in missing values. | ||
77 | /// </summary> | ||
78 | /// <param name="response">The existing response</param> | ||
79 | /// <param name="theUser">The user profile</param> | ||
80 | public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); | ||
81 | |||
82 | /// <summary> | ||
83 | /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. | ||
84 | /// </summary> | ||
85 | /// <param name="userID"></param> | ||
86 | /// <returns></returns> | ||
87 | protected abstract InventoryData GetInventorySkeleton(LLUUID userID); | ||
88 | |||
89 | /// <summary> | ||
76 | /// Called when we receive the client's initial XMLRPC login_to_simulator request message | 90 | /// Called when we receive the client's initial XMLRPC login_to_simulator request message |
77 | /// </summary> | 91 | /// </summary> |
78 | /// <param name="request">The XMLRPC request</param> | 92 | /// <param name="request">The XMLRPC request</param> |
@@ -196,7 +210,7 @@ namespace OpenSim.Framework.UserManagement | |||
196 | LLUUID agentID = userProfile.UUID; | 210 | LLUUID agentID = userProfile.UUID; |
197 | 211 | ||
198 | // Inventory Library Section | 212 | // Inventory Library Section |
199 | InventoryData inventData = CreateInventoryData(agentID); | 213 | InventoryData inventData = GetInventorySkeleton(agentID); |
200 | ArrayList AgentInventoryArray = inventData.InventoryArray; | 214 | ArrayList AgentInventoryArray = inventData.InventoryArray; |
201 | 215 | ||
202 | Hashtable InventoryRootHash = new Hashtable(); | 216 | Hashtable InventoryRootHash = new Hashtable(); |
@@ -338,7 +352,7 @@ namespace OpenSim.Framework.UserManagement | |||
338 | LLUUID agentID = userProfile.UUID; | 352 | LLUUID agentID = userProfile.UUID; |
339 | 353 | ||
340 | // Inventory Library Section | 354 | // Inventory Library Section |
341 | InventoryData inventData = CreateInventoryData(agentID); | 355 | InventoryData inventData = GetInventorySkeleton(agentID); |
342 | ArrayList AgentInventoryArray = inventData.InventoryArray; | 356 | ArrayList AgentInventoryArray = inventData.InventoryArray; |
343 | 357 | ||
344 | Hashtable InventoryRootHash = new Hashtable(); | 358 | Hashtable InventoryRootHash = new Hashtable(); |
@@ -407,15 +421,6 @@ namespace OpenSim.Framework.UserManagement | |||
407 | } | 421 | } |
408 | } | 422 | } |
409 | 423 | ||
410 | /// <summary> | ||
411 | /// Customises the login response and fills in missing values. | ||
412 | /// </summary> | ||
413 | /// <param name="response">The existing response</param> | ||
414 | /// <param name="theUser">The user profile</param> | ||
415 | public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest) | ||
416 | { | ||
417 | } | ||
418 | |||
419 | public Hashtable ProcessHTMLLogin(Hashtable keysvals) | 424 | public Hashtable ProcessHTMLLogin(Hashtable keysvals) |
420 | { | 425 | { |
421 | // Matches all unspecified characters | 426 | // Matches all unspecified characters |
@@ -754,27 +759,6 @@ namespace OpenSim.Framework.UserManagement | |||
754 | return inventoryLibOwner; | 759 | return inventoryLibOwner; |
755 | } | 760 | } |
756 | 761 | ||
757 | protected virtual InventoryData CreateInventoryData(LLUUID userID) | ||
758 | { | ||
759 | AgentInventory userInventory = new AgentInventory(); | ||
760 | userInventory.CreateRootFolder(userID); | ||
761 | |||
762 | ArrayList AgentInventoryArray = new ArrayList(); | ||
763 | Hashtable TempHash; | ||
764 | foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values) | ||
765 | { | ||
766 | TempHash = new Hashtable(); | ||
767 | TempHash["name"] = InvFolder.FolderName; | ||
768 | TempHash["parent_id"] = InvFolder.ParentID.ToString(); | ||
769 | TempHash["version"] = (Int32) InvFolder.Version; | ||
770 | TempHash["type_default"] = (Int32) InvFolder.DefaultType; | ||
771 | TempHash["folder_id"] = InvFolder.FolderID.ToString(); | ||
772 | AgentInventoryArray.Add(TempHash); | ||
773 | } | ||
774 | |||
775 | return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); | ||
776 | } | ||
777 | |||
778 | public class InventoryData | 762 | public class InventoryData |
779 | { | 763 | { |
780 | public ArrayList InventoryArray = null; | 764 | public ArrayList InventoryArray = null; |