From 9b7c99f0cfd8fbcd3ce31e0be6fa68f5bedef78b Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 29 Sep 2010 14:24:32 -0700 Subject: Made IGridUserService.SetLastPosition() more flexible to allow different possible implementations. This doesn't change any behavior or any Robust code, but it simplifies the SimianGrid connector by using the standard OpenSim interface for setting last position now --- OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs | 2 +- OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs | 8 ++++---- .../Connectors/SimianGrid/SimianPresenceServiceConnector.cs | 6 ------ 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs index 935ebb1..48d2939 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs @@ -123,7 +123,7 @@ namespace OpenSim.Services.Connectors return Set(sendData, userID, regionID, position, lookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 position, Vector3 lookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, 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 67a06f3..c89c81a 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -29,6 +29,7 @@ using System; using System.Reflection; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; using OpenMetaverse; using log4net; @@ -38,12 +39,12 @@ namespace OpenSim.Services.Connectors.SimianGrid { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private SimianPresenceServiceConnector m_GridUserService; + private IGridUserService m_GridUserService; private Scene m_aScene; - public SimianActivityDetector(SimianPresenceServiceConnector guservice) + public SimianActivityDetector(IGridUserService guService) { - m_GridUserService = guservice; + m_GridUserService = guService; m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Started"); } @@ -103,7 +104,6 @@ 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); } - } void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index a344594..fa51c9a 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -304,12 +304,6 @@ namespace OpenSim.Services.Connectors.SimianGrid return UpdateSession(sessionID, regionID, lastPosition, lastLookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) - { - // Never called - return false; - } - public GridUserInfo GetGridUserInfo(string user) { m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user); -- cgit v1.1 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 --- OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs | 2 +- OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs | 6 +----- .../Connectors/SimianGrid/SimianPresenceServiceConnector.cs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'OpenSim/Services/Connectors') 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 -- cgit v1.1 From 08ee7a0e51a86e0a65c821e28eceaedaae9f009d Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 29 Sep 2010 15:14:13 -0700 Subject: Actually log users out (call LogoutAgent) in the SimianPresenceServiceConnector when LoggedOut() is called --- .../Connectors/SimianGrid/SimianPresenceServiceConnector.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index a41c6ad..8141420 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -262,6 +262,12 @@ namespace OpenSim.Services.Connectors.SimianGrid public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { + m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID); + + // Remove the session to mark this user offline + if (!LogoutAgent(sessionID)) + return false; + // Save our last position as user data NameValueCollection requestArgs = new NameValueCollection { -- cgit v1.1