diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 2286b5963f..e738d0b54e 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); @@ -72,6 +72,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 /// @@ -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; diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 1a97cd29df..e95acac22c 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -289,7 +289,8 @@ namespace OpenSim.Grid.UserServer } } - protected override InventoryData CreateInventoryData(LLUUID userID) + // See LoginService + protected override InventoryData GetInventorySkeleton(LLUUID userID) { List folders = SynchronousRestObjectPoster.BeginPostObject>( diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 7b30727b39..5af0077261 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -212,7 +212,8 @@ namespace OpenSim.Region.Communications.Local return buddylistreturn; } - protected override InventoryData CreateInventoryData(LLUUID userID) + // See LoginService + protected override InventoryData GetInventorySkeleton(LLUUID userID) { List folders = m_Parent.InventoryService.RequestFirstLevelFolders(userID); if (folders.Count > 0)