diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 74dba4c86d..f1f2c2b24c 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -253,6 +253,7 @@ namespace OpenSim.Framework.UserManagement { UserProfileData profile = GetUserProfile(agentID); profile.currentAgent = null; + setUserProfile(profile); } diff --git a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs index f68e751c61..3e3ab71c01 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteUserData.cs @@ -253,7 +253,10 @@ namespace OpenSim.Framework.Data.SQLite { fillUserRow(row, user); } - + // This is why we're getting the 'logins never log-off'.. because It isn't clearing the + // useragents table once the useragent is null + // + // A database guy should look at this and figure out the best way to clear the useragents table. if (user.currentAgent != null) { DataTable ua = ds.Tables["useragents"]; @@ -269,6 +272,23 @@ namespace OpenSim.Framework.Data.SQLite fillUserAgentRow(row, user.currentAgent); } } + else + { + // I just added this to help the standalone login situation. + //It still needs to be looked at by a Database guy + if (row == null) + { + // do nothing + } + else + { + DataTable ua = ds.Tables["useragents"]; + row = ua.Rows.Find(user.UUID); + row.Delete(); + ua.AcceptChanges(); + } + } + MainLog.Instance.Verbose("SQLITE", "Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored"); // save changes off to disk