From 57e6b516390a6a07a9c5fb62f11f56ccb6bf04fa Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 30 Nov 2007 02:01:12 +0000 Subject: * Here's the issue, on log-off, the routine sets up a null useragent member and then tries to save it to the database.. where it was going wrong, is the database had a check to do *nothing* when it got a null useragent. I made it delete the userAgent row. This should be a good enough fix to solve the problem. It still needs to be looked at by a DB guy --- .../Framework/Communications/UserManagerBase.cs | 1 + OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 74dba4c..f1f2c2b 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 f68e751..3e3ab71 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 -- cgit v1.1