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 | |
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
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 50 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalLoginService.cs | 3 |
3 files changed, 21 insertions, 35 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; |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 1a97cd2..e95acac 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -289,7 +289,8 @@ namespace OpenSim.Grid.UserServer | |||
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | protected override InventoryData CreateInventoryData(LLUUID userID) | 292 | // See LoginService |
293 | protected override InventoryData GetInventorySkeleton(LLUUID userID) | ||
293 | { | 294 | { |
294 | List<InventoryFolderBase> folders | 295 | List<InventoryFolderBase> folders |
295 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | 296 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( |
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 7b30727..5af0077 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -212,7 +212,8 @@ namespace OpenSim.Region.Communications.Local | |||
212 | return buddylistreturn; | 212 | return buddylistreturn; |
213 | } | 213 | } |
214 | 214 | ||
215 | protected override InventoryData CreateInventoryData(LLUUID userID) | 215 | // See LoginService |
216 | protected override InventoryData GetInventorySkeleton(LLUUID userID) | ||
216 | { | 217 | { |
217 | List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); | 218 | List<InventoryFolderBase> folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); |
218 | if (folders.Count > 0) | 219 | if (folders.Count > 0) |