From feaa64507183c6bedac790f5c3986cda191a5c3e Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 20 Mar 2009 06:49:12 +0000 Subject: * De-duplicated login service some more * Normalized m_inventoryService * Pulled AddActiveGestures up --- .../CreateCommsManager/CreateCommsManagerPlugin.cs | 19 ---------- OpenSim/Client/Linden/LLStandaloneLoginService.cs | 40 +++------------------- OpenSim/Framework/Communications/LoginService.cs | 33 +++++++++++++++++- .../Grid/UserServer.Modules/UserLoginService.cs | 29 ---------------- 4 files changed, 36 insertions(+), 85 deletions(-) diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs index 4fc3094..3bf87b3 100644 --- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs +++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs @@ -241,25 +241,6 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); } - //private LocalLoginService CreateLoginService(LibraryRootFolder libraryRootFolder, IInterServiceInventoryServices inventoryService, LocalUserServices userService, LocalBackEndServices backendService) - //{ - // LocalLoginService loginService = - // new LocalLoginService( - // userService, m_openSim.ConfigurationSettings.StandaloneWelcomeMessage, inventoryService, backendService, m_openSim.NetServersInfo, - // m_openSim.ConfigurationSettings.StandaloneAuthenticate, libraryRootFolder); - - // // set up XMLRPC handler for client's initial login request message - // m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod); - - // // provides the web form login - // m_httpServer.AddHTTPHandler("login", loginService.ProcessHTMLLogin); - - // // Provides the LLSD login - // m_httpServer.SetDefaultLLSDHandler(loginService.LLSDLoginMethod); - - // return loginService; - //} - private void CreateGridInfoService() { // provide grid info diff --git a/OpenSim/Client/Linden/LLStandaloneLoginService.cs b/OpenSim/Client/Linden/LLStandaloneLoginService.cs index b596e14..cf63103 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginService.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginService.cs @@ -52,11 +52,6 @@ namespace OpenSim.Client.Linden protected bool m_authUsers = false; /// - /// Used by the login service to make requests to the inventory service. - /// - protected IInterServiceInventoryServices m_interServiceInventoryService; - - /// /// Used to make requests to the local regions. /// protected ILoginServiceToRegionsConnector m_regionsConnector; @@ -74,7 +69,7 @@ namespace OpenSim.Client.Linden m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY; m_authUsers = authenticate; - m_interServiceInventoryService = interServiceInventoryService; + m_inventoryService = interServiceInventoryService; m_regionsConnector = regionsConnector; } @@ -142,33 +137,6 @@ namespace OpenSim.Client.Linden } /// - /// Add active gestures of the user to the login response. - /// - /// - /// A - /// - /// - /// A - /// - protected override void AddActiveGestures(LoginResponse response, UserProfileData theUser) - { - List gestures = m_interServiceInventoryService.GetActiveGestures(theUser.ID); - //m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count); - ArrayList list = new ArrayList(); - if (gestures != null) - { - foreach (InventoryItemBase gesture in gestures) - { - Hashtable item = new Hashtable(); - item["item_id"] = gesture.ID.ToString(); - item["asset_id"] = gesture.AssetID.ToString(); - list.Add(item); - } - } - response.ActiveGestures = list; - } - - /// /// Prepare a login to the given region. This involves both telling the region to expect a connection /// and appropriately customising the response to the user. /// @@ -243,13 +211,13 @@ namespace OpenSim.Client.Linden // See LoginService protected override InventoryData GetInventorySkeleton(UUID userID) { - List folders = m_interServiceInventoryService.GetInventorySkeleton(userID); + List folders = m_inventoryService.GetInventorySkeleton(userID); // If we have user auth but no inventory folders for some reason, create a new set of folders. if (null == folders || 0 == folders.Count) { - m_interServiceInventoryService.CreateNewUserInventory(userID); - folders = m_interServiceInventoryService.GetInventorySkeleton(userID); + m_inventoryService.CreateNewUserInventory(userID); + folders = m_inventoryService.GetInventorySkeleton(userID); } UUID rootID = UUID.Zero; diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 92bf83f..b84f5b6 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -60,6 +60,11 @@ namespace OpenSim.Framework.Communications protected uint m_defaultHomeY; /// + /// Used by the login service to make requests to the inventory service. + /// + protected IInterServiceInventoryServices m_inventoryService; + + /// /// Constructor /// /// @@ -1008,7 +1013,33 @@ namespace OpenSim.Framework.Communications protected abstract RegionInfo RequestClosestRegion(string region); protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle); protected abstract RegionInfo GetRegionInfo(UUID homeRegionId); - protected abstract void AddActiveGestures(LoginResponse response, UserProfileData theUser); protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response); + + /// + /// Add active gestures of the user to the login response. + /// + /// + /// A + /// + /// + /// A + /// + protected void AddActiveGestures(LoginResponse response, UserProfileData theUser) + { + List gestures = m_inventoryService.GetActiveGestures(theUser.ID); + //m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count); + ArrayList list = new ArrayList(); + if (gestures != null) + { + foreach (InventoryItemBase gesture in gestures) + { + Hashtable item = new Hashtable(); + item["item_id"] = gesture.ID.ToString(); + item["asset_id"] = gesture.AssetID.ToString(); + list.Add(item); + } + } + response.ActiveGestures = list; + } } } diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index f7ee8ef..f3287a7 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -53,8 +53,6 @@ namespace OpenSim.Grid.UserServer.Modules { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected IInterServiceInventoryServices m_inventoryService; - public event UserLoggedInAtLocation OnUserLoggedInAtLocation; private UserLoggedInAtLocation handlerUserLoggedInAtLocation; @@ -244,33 +242,6 @@ namespace OpenSim.Grid.UserServer.Modules } } - /// - /// Add active gestures of the user to the login response. - /// - /// - /// A - /// - /// - /// A - /// - protected override void AddActiveGestures(LoginResponse response, UserProfileData theUser) - { - List gestures = m_inventoryService.GetActiveGestures(theUser.ID); - //m_log.DebugFormat("[LOGIN]: AddActiveGestures, found {0}", gestures == null ? 0 : gestures.Count); - ArrayList list = new ArrayList(); - if (gestures != null) - { - foreach (InventoryItemBase gesture in gestures) - { - Hashtable item = new Hashtable(); - item["item_id"] = gesture.ID.ToString(); - item["asset_id"] = gesture.AssetID.ToString(); - list.Add(item); - } - } - response.ActiveGestures = list; - } - protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) { return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response); -- cgit v1.1