From b6e0563ad7ad7f6fc396229823d7e76cd31dced7 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 29 Sep 2010 14:34:02 -0700 Subject: Part two of the previous commit, making IGridUserService.LoggedOut() more flexible without changing current behavior --- .../Services/Connectors/GridUser/GridUserServiceConnector.cs | 2 +- .../Services/Connectors/SimianGrid/SimianActivityDetector.cs | 6 +----- .../Connectors/SimianGrid/SimianPresenceServiceConnector.cs | 2 +- OpenSim/Services/HypergridService/UserAgentService.cs | 2 +- OpenSim/Services/Interfaces/IGridUserService.cs | 12 +++++++++++- OpenSim/Services/UserAccountService/GridUserService.cs | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs index 48d2939..b3ea865 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs @@ -101,7 +101,7 @@ namespace OpenSim.Services.Connectors } - public bool LoggedOut(string userID, UUID region, Vector3 position, Vector3 lookat) + public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) { Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs index c89c81a..b8703c6 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -40,7 +40,6 @@ namespace OpenSim.Services.Connectors.SimianGrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IGridUserService m_GridUserService; - private Scene m_aScene; public SimianActivityDetector(IGridUserService guService) { @@ -55,9 +54,6 @@ namespace OpenSim.Services.Connectors.SimianGrid scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnAvatarEnteringNewParcel += OnEnteringNewParcel; - - if (m_aScene == null) - m_aScene = scene; } public void RemoveRegion(Scene scene) @@ -102,7 +98,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); - m_GridUserService.LoggedOut(client.AgentId.ToString(), client.Scene.RegionInfo.RegionID, position, lookat); + m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index fa51c9a..a41c6ad 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -260,7 +260,7 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } - public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { // Save our last position as user data NameValueCollection requestArgs = new NameValueCollection diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 8c3be70..8acd618 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -232,7 +232,7 @@ namespace OpenSim.Services.HypergridService GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString()); if (guinfo != null) - m_GridUserService.LoggedOut(userID.ToString(), guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); + m_GridUserService.LoggedOut(userID.ToString(), sessionID, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); } // We need to prevent foreign users with the same UUID as a local user diff --git a/OpenSim/Services/Interfaces/IGridUserService.cs b/OpenSim/Services/Interfaces/IGridUserService.cs index dfb79a4..6613ae7 100644 --- a/OpenSim/Services/Interfaces/IGridUserService.cs +++ b/OpenSim/Services/Interfaces/IGridUserService.cs @@ -105,7 +105,17 @@ namespace OpenSim.Services.Interfaces public interface IGridUserService { GridUserInfo LoggedIn(string userID); - bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); + + /// + /// Informs the grid that a user is logged out and to remove any session data for them + /// + /// Ignore if your connector does not use userID for logouts + /// Ignore if your connector does not use sessionID for logouts + /// RegionID where the user was last located + /// Last region-relative position of the user + /// Last normalized look direction for the user + /// True if the logout request was successfully processed, otherwise false + bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt); diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index 00a1ae2..9b18915 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs @@ -92,7 +92,7 @@ namespace OpenSim.Services.UserAccountService return GetGridUserInfo(userID); } - public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID); GridUserData d = m_Database.Get(userID); -- cgit v1.1