From 4dd523b45d1e635c66eb4e556764fabe29dbfc58 Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Sun, 10 Jan 2010 15:34:56 -0800
Subject: * Changed IPresenceService Logout, so that it takes a position and a
lookat * CommsManager.AvatarService rerouted
---
.../CoreModules/Resources/CoreModulePlugin.addin.xml | 2 --
.../Interregion/RESTInterregionComms.cs | 15 ++++++++-------
.../Presence/LocalPresenceServiceConnector.cs | 4 ++--
.../ServiceConnectorsOut/Presence/PresenceDetector.cs | 18 +++++++++++++++++-
.../Presence/RemotePresenceServiceConnector.cs | 4 ++--
.../Presence/Tests/PresenceConnectorsTests.cs | 2 +-
OpenSim/Region/Framework/Scenes/Scene.cs | 1 -
.../Framework/Scenes/SceneCommunicationService.cs | 13 -------------
8 files changed, 30 insertions(+), 29 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index 7b9fdee..a43b728 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -46,8 +46,6 @@
-
-
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
index fa3681a..10ab76f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Interregion/RESTInterregionComms.cs
@@ -781,13 +781,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
ipaddr = Util.GetHostFromDNS(parts[0]);
if (parts.Length == 2)
UInt32.TryParse(parts[1], out port);
-
- // local authority (standalone), local call
- if (m_thisIP.Equals(ipaddr) && (m_aScene.RegionInfo.HttpPort == port))
- return ((IAuthentication)m_aScene.CommsManager.UserAdminService).VerifyKey(userID, key);
- // remote call
- else
- return AuthClient.VerifyKey("http://" + authority, userID, key);
+ return true;
+
+ //// local authority (standalone), local call
+ //if (m_thisIP.Equals(ipaddr) && (m_aScene.RegionInfo.HttpPort == port))
+ // return ((IAuthentication)m_aScene.CommsManager.UserAdminService).VerifyKey(userID, key);
+ //// remote call
+ //else
+ // return AuthClient.VerifyKey("http://" + authority, userID, key);
}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
index 2cb18c7..d78daf9 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs
@@ -163,9 +163,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
return false;
}
- public bool LogoutAgent(UUID sessionID)
+ public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookat)
{
- return m_PresenceService.LogoutAgent(sessionID);
+ return m_PresenceService.LogoutAgent(sessionID, position, lookat);
}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
index 3ca5560..891fc14 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs
@@ -42,6 +42,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IPresenceService m_PresenceService;
+ private Scene m_aScene;
public PresenceDetector(IPresenceService presenceservice)
{
@@ -54,6 +55,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
scene.EventManager.OnNewClient += OnNewClient;
m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID);
+
+ if (m_aScene == null)
+ m_aScene = scene;
}
public void RemoveRegion(Scene scene)
@@ -62,6 +66,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
scene.EventManager.OnNewClient -= OnNewClient;
m_PresenceService.LogoutRegionAgents(scene.RegionInfo.RegionID);
+
}
public void OnMakeRootAgent(ScenePresence sp)
@@ -78,7 +83,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
public void OnLogout(IClientAPI client)
{
client.OnLogout -= OnLogout;
- m_PresenceService.LogoutAgent(client.SessionId);
+
+ ScenePresence sp = null;
+ Vector3 position = new Vector3(128, 128, 0);
+ Vector3 lookat = new Vector3(0, 1, 0);
+
+ if (m_aScene.TryGetAvatar(client.AgentId, out sp))
+ {
+ position = sp.AbsolutePosition;
+ lookat = sp.Lookat;
+ }
+ m_PresenceService.LogoutAgent(client.SessionId, position, lookat);
+
}
}
}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
index 6c69570..865f99e 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
@@ -127,9 +127,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
return false;
}
- public bool LogoutAgent(UUID sessionID)
+ public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookat)
{
- return m_RemoteConnector.LogoutAgent(sessionID);
+ return m_RemoteConnector.LogoutAgent(sessionID, position, lookat);
}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
index ebb2c3e..9ba1bdc 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests
result = m_LocalConnector.GetAgent(session1);
Assert.That(result.RegionID, Is.EqualTo(region2), "Agent is not in the right region (region2)");
- r = m_LocalConnector.LogoutAgent(session1);
+ r = m_LocalConnector.LogoutAgent(session1, Vector3.Zero, Vector3.UnitY);
Assert.IsTrue(r, "LogoutAgent returned false");
result = m_LocalConnector.GetAgent(session1);
Assert.IsNotNull(result, "Agent session disappeared from storage after logout");
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 53c51e6..6d6f0b1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3213,7 +3213,6 @@ namespace OpenSim.Region.Framework.Scenes
if (!avatar.IsChildAgent)
{
- m_sceneGridService.LogOffUser(agentID, RegionInfo.RegionID, RegionInfo.RegionHandle, avatar.AbsolutePosition, avatar.Lookat);
//List childknownRegions = new List();
//List ckn = avatar.KnownChildRegionHandles;
//for (int i = 0; i < ckn.Count; i++)
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index ce3c16c..04ecb5f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -1444,19 +1444,6 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE COMM]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
}
-
- public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat)
- {
- m_commsProvider.LogOffUser(userid, regionid, regionhandle, position, lookat);
- }
-
- // deprecated as of 2008-08-27
- public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz)
- {
- m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz);
- }
-
-
public List GenerateAgentPickerRequestResponse(UUID queryID, string query)
{
return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
--
cgit v1.1