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 --- .../ServiceConnectorsOut/GridUser/ActivityDetector.cs | 2 +- .../GridUser/LocalGridUserServiceConnector.cs | 4 ++-- .../GridUser/RemoteGridUserServiceConnector.cs | 4 ++-- .../Server/Handlers/GridUser/GridUserServerPostHandler.cs | 2 +- .../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 +- 10 files changed, 22 insertions(+), 16 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 116a1dc..f523c73 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser } } m_log.DebugFormat("[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/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs index 76e030f..985acec 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs @@ -152,9 +152,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_GridUserService.LoggedIn(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) { - return m_GridUserService.LoggedOut(userID, regionID, lastPosition, lastLookAt); + return m_GridUserService.LoggedOut(userID, sessionID, regionID, lastPosition, lastLookAt); } public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index fb11e9a..95b3591 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs @@ -126,9 +126,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return null; } - public bool LoggedOut(string userID, UUID region, Vector3 position, Vector3 lookat) + public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) { - return m_RemoteConnector.LoggedOut(userID, region, position, lookat); + return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); } diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index 6b14a52..485bc3e 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs @@ -131,7 +131,7 @@ namespace OpenSim.Server.Handlers.GridUser if (!UnpackArgs(request, out userID, out regionID, out position, out lookat)) return FailureResult(); - if (m_GridUserService.LoggedOut(userID, regionID, position, lookat)) + if (m_GridUserService.LoggedOut(userID, UUID.Zero, regionID, position, lookat)) return SuccessResult(); return FailureResult(); 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