* Run SimianGrid session updates asynchronously instead of from the main heartbeat thread

* Minor dead code cleanup
viewer-2-initial-appearance
John Hurliman 2010-09-09 15:05:22 -07:00
parent 8415b98806
commit 9609faa8eb
6 changed files with 5 additions and 66 deletions

View File

@ -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);
});
}
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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<PresenceInfo> GetSessions(UUID userID)
{
List<PresenceInfo> presences = new List<PresenceInfo>(1);
@ -429,39 +407,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
return success;
}
///// <summary>
///// Fetch the last known avatar location with GetSession and persist it
///// as user data with AddUserData
///// </summary>
//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)

View File

@ -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;