From c8f79eb9b49a4704e32a26ec04aeec3ff4c02754 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 28 Mar 2008 16:39:38 +0000 Subject: * Refactor: Rename CreateInventoryData() to GetInventorySkeleton() * Replace the unused default GetInventorySkeleton() impleemntation with an abstract declaration - less confusing this way imho * Add some comments --- OpenSim/Framework/Communications/LoginService.cs | 50 ++++++++---------------- 1 file changed, 17 insertions(+), 33 deletions(-) (limited to 'OpenSim/Framework') 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; namespace OpenSim.Framework.UserManagement { - public class LoginService + public abstract class LoginService { private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); @@ -73,6 +73,20 @@ namespace OpenSim.Framework.UserManagement } /// + /// Customises the login response and fills in missing values. + /// + /// The existing response + /// The user profile + public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest); + + /// + /// Get the initial login inventory skeleton (in other words, the folder structure) for the given user. + /// + /// + /// + protected abstract InventoryData GetInventorySkeleton(LLUUID userID); + + /// /// Called when we receive the client's initial XMLRPC login_to_simulator request message /// /// The XMLRPC request @@ -196,7 +210,7 @@ namespace OpenSim.Framework.UserManagement LLUUID agentID = userProfile.UUID; // Inventory Library Section - InventoryData inventData = CreateInventoryData(agentID); + InventoryData inventData = GetInventorySkeleton(agentID); ArrayList AgentInventoryArray = inventData.InventoryArray; Hashtable InventoryRootHash = new Hashtable(); @@ -338,7 +352,7 @@ namespace OpenSim.Framework.UserManagement LLUUID agentID = userProfile.UUID; // Inventory Library Section - InventoryData inventData = CreateInventoryData(agentID); + InventoryData inventData = GetInventorySkeleton(agentID); ArrayList AgentInventoryArray = inventData.InventoryArray; Hashtable InventoryRootHash = new Hashtable(); @@ -407,15 +421,6 @@ namespace OpenSim.Framework.UserManagement } } - /// - /// Customises the login response and fills in missing values. - /// - /// The existing response - /// The user profile - public virtual void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest) - { - } - public Hashtable ProcessHTMLLogin(Hashtable keysvals) { // Matches all unspecified characters @@ -754,27 +759,6 @@ namespace OpenSim.Framework.UserManagement return inventoryLibOwner; } - protected virtual InventoryData CreateInventoryData(LLUUID userID) - { - AgentInventory userInventory = new AgentInventory(); - userInventory.CreateRootFolder(userID); - - ArrayList AgentInventoryArray = new ArrayList(); - Hashtable TempHash; - foreach (InventoryFolder InvFolder in userInventory.InventoryFolders.Values) - { - TempHash = new Hashtable(); - TempHash["name"] = InvFolder.FolderName; - TempHash["parent_id"] = InvFolder.ParentID.ToString(); - TempHash["version"] = (Int32) InvFolder.Version; - TempHash["type_default"] = (Int32) InvFolder.DefaultType; - TempHash["folder_id"] = InvFolder.FolderID.ToString(); - AgentInventoryArray.Add(TempHash); - } - - return new InventoryData(AgentInventoryArray, userInventory.InventoryRoot.FolderID); - } - public class InventoryData { public ArrayList InventoryArray = null; -- cgit v1.1