* Making silent logoff of old hung sessions for new connections default for

StandAlone users. Not touching grid.
0.6.6-post-fixes
Arthur Valadares 2009-06-01 18:34:40 +00:00
parent 412295ccde
commit eb330f71be
5 changed files with 7 additions and 19 deletions

View File

@ -54,7 +54,6 @@ namespace OpenSim.Client.Linden
protected bool m_enabled = false; // Module is only enabled if running in standalone mode protected bool m_enabled = false; // Module is only enabled if running in standalone mode
protected bool authenticate; protected bool authenticate;
protected bool m_warn_already_logged;
protected string welcomeMessage; protected string welcomeMessage;
public bool RegionLoginsEnabled public bool RegionLoginsEnabled
@ -79,11 +78,9 @@ namespace OpenSim.Client.Linden
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
IConfig startupConfig = source.Configs["Startup"]; IConfig startupConfig = source.Configs["Startup"];
IConfig stdaloneConfig = source.Configs["StandAlone"];
if (startupConfig != null) if (startupConfig != null)
{ {
m_enabled = !startupConfig.GetBoolean("gridmode", false); m_enabled = !startupConfig.GetBoolean("gridmode", false);
m_warn_already_logged = stdaloneConfig.GetBoolean("warn_user_already_logged_in", true);
} }
if (m_enabled) if (m_enabled)
@ -115,7 +112,6 @@ 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 //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 = 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); httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);

View File

@ -52,14 +52,6 @@ namespace OpenSim.Client.Linden
protected NetworkServersInfo m_serversInfo; protected NetworkServersInfo m_serversInfo;
protected bool m_authUsers = false; 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; }
}
/// <summary> /// <summary>
/// Used to make requests to the local regions. /// Used to make requests to the local regions.
/// </summary> /// </summary>
@ -79,6 +71,8 @@ namespace OpenSim.Client.Linden
m_inventoryService = interServiceInventoryService; m_inventoryService = interServiceInventoryService;
m_regionsConnector = regionsConnector; m_regionsConnector = regionsConnector;
// Standard behavior: In StandAlone, silent logout of last hung session
m_warn_already_logged = false;
} }
public override UserProfileData GetTheUser(string firstname, string lastname) public override UserProfileData GetTheUser(string firstname, string lastname)

View File

@ -181,10 +181,9 @@ namespace OpenSim.Framework.Communications.Services
// try to tell the region that their user is dead. // try to tell the region that their user is dead.
LogOffUser(userProfile, " XMLRPC You were logged off because you logged in from another location"); LogOffUser(userProfile, " XMLRPC You were logged off because you logged in from another location");
// Reject the login
if (m_warn_already_logged) if (m_warn_already_logged)
{ {
// This is behavior for for grid, reject login
m_log.InfoFormat( m_log.InfoFormat(
"[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in", "[LOGIN END]: XMLRPC Notifying user {0} {1} that they are already logged in",
firstname, lastname); firstname, lastname);
@ -193,6 +192,7 @@ namespace OpenSim.Framework.Communications.Services
} }
else else
{ {
// This is behavior for standalone (silent logout of last hung session)
m_log.InfoFormat( m_log.InfoFormat(
"[LOGIN]: User {0} {1} is already logged in, not notifying user, kicking old presence and starting new login.", "[LOGIN]: User {0} {1} is already logged in, not notifying user, kicking old presence and starting new login.",
firstname, lastname); firstname, lastname);

View File

@ -304,7 +304,9 @@ namespace OpenSim.Framework.Communications.Tests
} }
[Test] // [Test]
// Commenting out test now that LLStandAloneLoginService no longer replies with message in this case.
// Kept the code for future test with grid mode, which will keep this behavior.
public void T023_TestAuthenticatedLoginAlreadyLoggedIn() public void T023_TestAuthenticatedLoginAlreadyLoggedIn()
{ {
TestHelper.InMethod(); TestHelper.InMethod();

View File

@ -256,10 +256,6 @@
accounts_authenticate = true accounts_authenticate = true
welcome_message = "Welcome to OpenSimulator" welcome_message = "Welcome to OpenSimulator"
; Shows or skips the "please wait 5 minutes" message when you crash or are already logged in.
; If false, it will silently kick the user from the scene and login.
warn_user_already_logged_in = true
; Inventory database provider ; Inventory database provider
inventory_plugin = "OpenSim.Data.SQLite.dll" inventory_plugin = "OpenSim.Data.SQLite.dll"
; inventory_plugin = "OpenSim.Data.MySQL.dll" ; inventory_plugin = "OpenSim.Data.MySQL.dll"