diff options
author | Teravus Ovares | 2007-11-30 02:01:12 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-30 02:01:12 +0000 |
commit | 57e6b516390a6a07a9c5fb62f11f56ccb6bf04fa (patch) | |
tree | b59a4e9b68590e8084924cff47af557e7cb34db2 /OpenSim/Framework/Data.SQLite | |
parent | * Temporary fix for 'User already online' issue in standalone mode. (diff) | |
download | opensim-SC-57e6b516390a6a07a9c5fb62f11f56ccb6bf04fa.zip opensim-SC-57e6b516390a6a07a9c5fb62f11f56ccb6bf04fa.tar.gz opensim-SC-57e6b516390a6a07a9c5fb62f11f56ccb6bf04fa.tar.bz2 opensim-SC-57e6b516390a6a07a9c5fb62f11f56ccb6bf04fa.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Framework/Data.SQLite')
-rw-r--r-- | OpenSim/Framework/Data.SQLite/SQLiteUserData.cs | 22 |
1 files changed, 21 insertions, 1 deletions
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 | |||
253 | { | 253 | { |
254 | fillUserRow(row, user); | 254 | fillUserRow(row, user); |
255 | } | 255 | } |
256 | 256 | // This is why we're getting the 'logins never log-off'.. because It isn't clearing the | |
257 | // useragents table once the useragent is null | ||
258 | // | ||
259 | // A database guy should look at this and figure out the best way to clear the useragents table. | ||
257 | if (user.currentAgent != null) | 260 | if (user.currentAgent != null) |
258 | { | 261 | { |
259 | DataTable ua = ds.Tables["useragents"]; | 262 | DataTable ua = ds.Tables["useragents"]; |
@@ -269,6 +272,23 @@ namespace OpenSim.Framework.Data.SQLite | |||
269 | fillUserAgentRow(row, user.currentAgent); | 272 | fillUserAgentRow(row, user.currentAgent); |
270 | } | 273 | } |
271 | } | 274 | } |
275 | else | ||
276 | { | ||
277 | // I just added this to help the standalone login situation. | ||
278 | //It still needs to be looked at by a Database guy | ||
279 | if (row == null) | ||
280 | { | ||
281 | // do nothing | ||
282 | } | ||
283 | else | ||
284 | { | ||
285 | DataTable ua = ds.Tables["useragents"]; | ||
286 | row = ua.Rows.Find(user.UUID); | ||
287 | row.Delete(); | ||
288 | ua.AcceptChanges(); | ||
289 | } | ||
290 | } | ||
291 | |||
272 | MainLog.Instance.Verbose("SQLITE", | 292 | MainLog.Instance.Verbose("SQLITE", |
273 | "Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored"); | 293 | "Syncing user database: " + ds.Tables["users"].Rows.Count + " users stored"); |
274 | // save changes off to disk | 294 | // save changes off to disk |