* 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

afrisby
Teravus Ovares 2007-11-30 02:01:12 +00:00
parent 5eb091ceee
commit 57e6b51639
2 changed files with 22 additions and 1 deletions

View File

@ -253,6 +253,7 @@ namespace OpenSim.Framework.UserManagement
{ {
UserProfileData profile = GetUserProfile(agentID); UserProfileData profile = GetUserProfile(agentID);
profile.currentAgent = null; profile.currentAgent = null;
setUserProfile(profile); setUserProfile(profile);
} }

View File

@ -253,7 +253,10 @@ namespace OpenSim.Framework.Data.SQLite
{ {
fillUserRow(row, user); 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) if (user.currentAgent != null)
{ {
DataTable ua = ds.Tables["useragents"]; DataTable ua = ds.Tables["useragents"];
@ -269,6 +272,23 @@ namespace OpenSim.Framework.Data.SQLite
fillUserAgentRow(row, user.currentAgent); 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", MainLog.Instance.Verbose("SQLITE",
"Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored"); "Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored");
// save changes off to disk // save changes off to disk