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.
viewer-2-initial-appearance
Melanie 2010-11-05 13:31:45 +00:00
parent 6c3b7617b0
commit 1c8d19d714
2 changed files with 16 additions and 0 deletions

View File

@ -45,10 +45,20 @@ namespace OpenSim.Services.PresenceService
LogManager.GetLogger( LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
protected bool m_allowDuplicatePresences = false;
public PresenceService(IConfigSource config) public PresenceService(IConfigSource config)
: base(config) : base(config)
{ {
m_log.Debug("[PRESENCE SERVICE]: Starting presence service"); 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, public bool LoginAgent(string userID, UUID sessionID,
@ -57,6 +67,9 @@ namespace OpenSim.Services.PresenceService
//PresenceData[] d = m_Database.Get("UserID", userID); //PresenceData[] d = m_Database.Get("UserID", userID);
//m_Database.Get("UserID", userID); //m_Database.Get("UserID", userID);
if (!m_allowDuplicatePresences)
m_Database.Delete("UserID", userID.ToString());
PresenceData data = new PresenceData(); PresenceData data = new PresenceData();
data.UserID = userID; data.UserID = userID;

View File

@ -107,6 +107,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[PresenceService] [PresenceService]
; for the server connector ; for the server connector
LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService" LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService"
; Set this to true to allow the use of advanced web services and multiple
; bots using one account
AllowDuplicatePresences = false;
[AvatarService] [AvatarService]
; for the server connector ; for the server connector