From 55b569069dfd6eb7c87d4fbd66d68083878f6c65 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 31 Jul 2007 14:42:50 +0000 Subject: clear userAgent state on client shutdown, which fixes the issue where you could only login once with a given id in standalone mode. --- OpenSim/Framework/Data.DB4o/DB4oManager.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'OpenSim/Framework/Data.DB4o/DB4oManager.cs') diff --git a/OpenSim/Framework/Data.DB4o/DB4oManager.cs b/OpenSim/Framework/Data.DB4o/DB4oManager.cs index 43f9095..0e32938 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oManager.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oManager.cs @@ -129,26 +129,31 @@ namespace OpenSim.Framework.Data.DB4o } /// - /// Adds a new profile to the database (Warning: Probably slow.) + /// Adds or updates a record to the user database. Do this when changes are needed + /// in the user profile that need to be persistant. + /// + /// TODO: the logic here is not ACID, the local cache will be + /// updated even if the persistant data is not. This may lead + /// to unexpected results. /// - /// The profile to add - /// Successful? - public bool AddRow(UserProfileData row) + /// The profile to update + /// true on success, false on fail to persist to db + public bool UpdateRecord(UserProfileData record) { - if (userProfiles.ContainsKey(row.UUID)) + if (userProfiles.ContainsKey(record.UUID)) { - userProfiles[row.UUID] = row; + userProfiles[record.UUID] = record; } else { - userProfiles.Add(row.UUID, row); + userProfiles.Add(record.UUID, record); } try { IObjectContainer database; database = Db4oFactory.OpenFile(dbfl); - database.Set(row); + database.Set(record); database.Close(); return true; } @@ -157,7 +162,5 @@ namespace OpenSim.Framework.Data.DB4o return false; } } - - } } -- cgit v1.1