From 9609faa8eb330dc85dfb2efec1e7e5652f01d6f2 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 9 Sep 2010 15:05:22 -0700 Subject: * Run SimianGrid session updates asynchronously instead of from the main heartbeat thread * Minor dead code cleanup --- .../SimianGrid/SimianActivityDetector.cs | 8 ++-- .../SimianGrid/SimianAvatarServiceConnector.cs | 3 -- .../SimianGrid/SimianFriendsServiceConnector.cs | 3 -- .../SimianGrid/SimianInventoryServiceConnector.cs | 1 - .../SimianGrid/SimianPresenceServiceConnector.cs | 55 ---------------------- .../SimianUserAccountServiceConnector.cs | 1 - 6 files changed, 5 insertions(+), 66 deletions(-) (limited to 'OpenSim/Services/Connectors/SimianGrid') diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs index a871d07..67b73f3 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -26,11 +26,9 @@ */ using System; -using System.Collections.Generic; using System.Reflection; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; -using OpenSim.Services.Interfaces; using OpenMetaverse; using log4net; @@ -107,7 +105,11 @@ namespace OpenSim.Services.Connectors.SimianGrid void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID) { - m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + // Asynchronously update the position stored in the session table for this agent + Util.FireAndForget(delegate(object o) + { + m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + }); } } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index 3505c64..4d0d53e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs @@ -28,8 +28,6 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.IO; -using System.Net; using System.Reflection; using log4net; using Mono.Addins; @@ -37,7 +35,6 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Server.Base; using OpenSim.Services.Interfaces; using OpenMetaverse; using OpenMetaverse.StructuredData; diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs index 5b18aef..6f2d735 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs @@ -30,13 +30,10 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 3953369..21ad4ab 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -37,7 +37,6 @@ using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Server.Base; using OpenSim.Services.Interfaces; namespace OpenSim.Services.Connectors.SimianGrid diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index 077be3c..a344594 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -28,17 +28,14 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Net; using System.Reflection; using log4net; using Mono.Addins; using Nini.Config; using OpenSim.Framework; -using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -using OpenSim.Server.Base; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -358,25 +355,6 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } -// private OSDMap GetSessionData(UUID sessionID) -// { -// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for session " + sessionID); -// -// NameValueCollection requestArgs = new NameValueCollection -// { -// { "RequestMethod", "GetSession" }, -// { "SessionID", sessionID.ToString() } -// }; -// -// OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); -// if (response["Success"].AsBoolean()) -// return response; -// else -// m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session data for session " + sessionID); -// -// return null; -// } - private List GetSessions(UUID userID) { List presences = new List(1); @@ -429,39 +407,6 @@ namespace OpenSim.Services.Connectors.SimianGrid return success; } - ///// - ///// Fetch the last known avatar location with GetSession and persist it - ///// as user data with AddUserData - ///// - //private bool SetLastLocation(UUID sessionID) - //{ - // NameValueCollection requestArgs = new NameValueCollection - // { - // { "RequestMethod", "GetSession" }, - // { "SessionID", sessionID.ToString() } - // }; - - // OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); - // bool success = response["Success"].AsBoolean(); - - // if (success) - // { - // UUID userID = response["UserID"].AsUUID(); - // UUID sceneID = response["SceneID"].AsUUID(); - // Vector3 position = response["ScenePosition"].AsVector3(); - // Vector3 lookAt = response["SceneLookAt"].AsVector3(); - - // return SetLastLocation(userID, sceneID, position, lookAt); - // } - // else - // { - // m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve presence information for session " + sessionID + - // " while saving last location: " + response["Message"].AsString()); - // } - - // return success; - //} - private PresenceInfo ResponseToPresenceInfo(OSDMap sessionResponse, OSDMap userResponse) { if (sessionResponse == null) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 1ac9882..ddd2322 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.IO; using System.Reflection; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; -- cgit v1.1