From d0084f08f2d2d591706242227b2825a1e82e902e Mon Sep 17 00:00:00 2001 From: Arthur Valadares Date: Fri, 29 May 2009 22:38:18 +0000 Subject: * Allows standalone region users to skip the "You must wait 5 minutes to log again" message and allow the region to kick the old user and log the new one without reporting any failure. Default is still to show message and fail login --- OpenSim/Client/Linden/LLStandaloneLoginModule.cs | 4 ++++ OpenSim/Client/Linden/LLStandaloneLoginService.cs | 10 +++++++++- .../Framework/Communications/Services/LoginService.cs | 19 +++++++++++++++---- 3 files changed, 28 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs index 6474feb..9cfa3c1 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginModule.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginModule.cs @@ -54,6 +54,7 @@ namespace OpenSim.Client.Linden protected bool m_enabled = false; // Module is only enabled if running in standalone mode protected bool authenticate; + protected bool m_warn_already_logged; protected string welcomeMessage; public bool RegionLoginsEnabled @@ -78,9 +79,11 @@ namespace OpenSim.Client.Linden public void Initialise(IConfigSource source) { IConfig startupConfig = source.Configs["Startup"]; + IConfig stdaloneConfig = source.Configs["StandAlone"]; if (startupConfig != null) { m_enabled = !startupConfig.GetBoolean("gridmode", false); + m_warn_already_logged = stdaloneConfig.GetBoolean("warn_user_already_logged_in", true); } if (m_enabled) @@ -112,6 +115,7 @@ namespace OpenSim.Client.Linden //TODO: fix the casting of the user service, maybe by registering the userManagerBase with scenes, or refactoring so we just need a IUserService reference m_loginService = new LLStandaloneLoginService((UserManagerBase)m_firstScene.CommsManager.UserAdminService, welcomeMessage, m_firstScene.CommsManager.InterServiceInventoryService, m_firstScene.CommsManager.NetworkServersInfo, authenticate, rootFolder, this); + m_loginService.WarnAlreadyLogged = m_warn_already_logged; httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); diff --git a/OpenSim/Client/Linden/LLStandaloneLoginService.cs b/OpenSim/Client/Linden/LLStandaloneLoginService.cs index ea3a74a..d9af24d 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginService.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginService.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -52,6 +52,14 @@ namespace OpenSim.Client.Linden protected NetworkServersInfo m_serversInfo; protected bool m_authUsers = false; + // If true, warns the user that he is already logged, forcing another login. + // If false, skips message and logs in directly, kicking out current user. + public bool WarnAlreadyLogged + { + get { return m_warn_already_logged; } + set { m_warn_already_logged = value; } + } + /// /// Used to make requests to the local regions. /// diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index 2847887..34d24cb 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs @@ -61,6 +61,8 @@ namespace OpenSim.Framework.Communications.Services protected uint m_defaultHomeX; protected uint m_defaultHomeY; + protected bool m_warn_already_logged = true; + /// /// Used by the login service to make requests to the inventory service. /// @@ -181,11 +183,20 @@ namespace OpenSim.Framework.Communications.Services // Reject the login - m_log.InfoFormat( - "[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in", - firstname, lastname); + if (m_warn_already_logged) + { + m_log.InfoFormat( + "[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in", + firstname, lastname); - return logResponse.CreateAlreadyLoggedInResponse(); + return logResponse.CreateAlreadyLoggedInResponse(); + } + else + { + m_log.InfoFormat( + "[LOGIN]: User {0} {1} is already logged in, not notifying user, kicking old presence and starting new login.", + firstname, lastname); + } } // Otherwise... -- cgit v1.1