From 1c8d19d714cf8595680a88930287e4da222535ee Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 5 Nov 2010 13:31:45 +0000 Subject: Delete existing presences for a user ID when they log in again. WARNING!!! This changes a default. The old default is to allow multiple presences, the new default disables this. As the feature currently has no users, this should not present any difficulty and will alleviate the presence issues somewhat. --- OpenSim/Services/PresenceService/PresenceService.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 09c31c3..c8ac38e 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -45,10 +45,20 @@ namespace OpenSim.Services.PresenceService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + protected bool m_allowDuplicatePresences = false; + public PresenceService(IConfigSource config) : base(config) { m_log.Debug("[PRESENCE SERVICE]: Starting presence service"); + + IConfig presenceConfig = config.Configs["PresenceService"]; + if (presenceConfig != null) + { + m_allowDuplicatePresences = + presenceConfig.GetBoolean("AllowDuplicatePresences", + m_allowDuplicatePresences); + } } public bool LoginAgent(string userID, UUID sessionID, @@ -57,6 +67,9 @@ namespace OpenSim.Services.PresenceService //PresenceData[] d = m_Database.Get("UserID", userID); //m_Database.Get("UserID", userID); + if (!m_allowDuplicatePresences) + m_Database.Delete("UserID", userID.ToString()); + PresenceData data = new PresenceData(); data.UserID = userID; -- cgit v1.1