diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 63 |
1 files changed, 45 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d293a8b..c132c5d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3609,7 +3609,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3609 | regions.Remove(RegionInfo.RegionHandle); | 3609 | regions.Remove(RegionInfo.RegionHandle); |
3610 | 3610 | ||
3611 | // This ends up being done asynchronously so that a logout isn't held up where there are many present but unresponsive neighbours. | 3611 | // This ends up being done asynchronously so that a logout isn't held up where there are many present but unresponsive neighbours. |
3612 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); | 3612 | m_sceneGridService.SendCloseChildAgentConnections(agentID, acd.SessionID.ToString(), regions); |
3613 | } | 3613 | } |
3614 | 3614 | ||
3615 | m_eventManager.TriggerClientClosed(agentID, this); | 3615 | m_eventManager.TriggerClientClosed(agentID, this); |
@@ -3856,7 +3856,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3856 | m_log.WarnFormat( | 3856 | m_log.WarnFormat( |
3857 | "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", | 3857 | "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", |
3858 | sp.Name, sp.UUID, RegionInfo.RegionName); | 3858 | sp.Name, sp.UUID, RegionInfo.RegionName); |
3859 | |||
3860 | 3859 | ||
3861 | if (sp.ControllingClient != null) | 3860 | if (sp.ControllingClient != null) |
3862 | sp.ControllingClient.Close(true, true); | 3861 | sp.ControllingClient.Close(true, true); |
@@ -4395,10 +4394,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
4395 | 4394 | ||
4396 | if (childAgentUpdate != null) | 4395 | if (childAgentUpdate != null) |
4397 | { | 4396 | { |
4397 | if (cAgentData.SessionID != childAgentUpdate.ControllingClient.SessionId) | ||
4398 | { | ||
4399 | m_log.WarnFormat("[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).", childAgentUpdate.UUID, cAgentData.SessionID); | ||
4400 | Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", | ||
4401 | childAgentUpdate.UUID, childAgentUpdate.ControllingClient.SessionId, cAgentData.SessionID)); | ||
4402 | } | ||
4403 | |||
4398 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 4404 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); |
4399 | return true; | 4405 | return true; |
4400 | } | 4406 | } |
4401 | |||
4402 | return false; | 4407 | return false; |
4403 | } | 4408 | } |
4404 | 4409 | ||
@@ -4414,20 +4419,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
4414 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | 4419 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); |
4415 | if (childAgentUpdate != null) | 4420 | if (childAgentUpdate != null) |
4416 | { | 4421 | { |
4417 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. | 4422 | if (childAgentUpdate.ControllingClient.SessionId == cAgentData.SessionID) |
4418 | // however to avoid a race condition crossing borders.. | 4423 | { |
4419 | if (childAgentUpdate.IsChildAgent) | 4424 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. |
4420 | { | 4425 | // however to avoid a race condition crossing borders.. |
4421 | uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); | 4426 | if (childAgentUpdate.IsChildAgent) |
4422 | uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); | 4427 | { |
4423 | uint tRegionX = RegionInfo.RegionLocX; | 4428 | uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); |
4424 | uint tRegionY = RegionInfo.RegionLocY; | 4429 | uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); |
4425 | //Send Data to ScenePresence | 4430 | uint tRegionX = RegionInfo.RegionLocX; |
4426 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); | 4431 | uint tRegionY = RegionInfo.RegionLocY; |
4427 | // Not Implemented: | 4432 | //Send Data to ScenePresence |
4428 | //TODO: Do we need to pass the message on to one of our neighbors? | 4433 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); |
4434 | // Not Implemented: | ||
4435 | //TODO: Do we need to pass the message on to one of our neighbors? | ||
4436 | } | ||
4429 | } | 4437 | } |
4430 | 4438 | else | |
4439 | m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}", childAgentUpdate.UUID, cAgentData.SessionID); | ||
4431 | return true; | 4440 | return true; |
4432 | } | 4441 | } |
4433 | 4442 | ||
@@ -4470,6 +4479,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
4470 | 4479 | ||
4471 | return false; | 4480 | return false; |
4472 | } | 4481 | } |
4482 | /// <summary> | ||
4483 | /// Authenticated close (via network) | ||
4484 | /// </summary> | ||
4485 | /// <param name="agentID"></param> | ||
4486 | /// <param name="force"></param> | ||
4487 | /// <param name="auth_token"></param> | ||
4488 | /// <returns></returns> | ||
4489 | public bool IncomingCloseAgent(UUID agentID, bool force, string auth_token) | ||
4490 | { | ||
4491 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent {0} in region {1} with auth_token {2}", agentID, RegionInfo.RegionName, auth_token); | ||
4492 | |||
4493 | // Check that the auth_token is valid | ||
4494 | AgentCircuitData acd = AuthenticateHandler.GetAgentCircuitData(agentID); | ||
4495 | if (acd != null && acd.SessionID.ToString() == auth_token) | ||
4496 | return IncomingCloseAgent(agentID, force); | ||
4497 | else | ||
4498 | m_log.ErrorFormat("[SCENE]: Request to close agent {0} with invalid authorization token {1}", agentID, auth_token); | ||
4499 | return false; | ||
4500 | } | ||
4473 | 4501 | ||
4474 | public bool IncomingCloseAgent(UUID agentID) | 4502 | public bool IncomingCloseAgent(UUID agentID) |
4475 | { | 4503 | { |
@@ -4492,7 +4520,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4492 | public bool IncomingCloseAgent(UUID agentID, bool force) | 4520 | public bool IncomingCloseAgent(UUID agentID, bool force) |
4493 | { | 4521 | { |
4494 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 4522 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
4495 | |||
4496 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); | 4523 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); |
4497 | if (presence != null) | 4524 | if (presence != null) |
4498 | { | 4525 | { |
@@ -4500,7 +4527,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4500 | return true; | 4527 | return true; |
4501 | } | 4528 | } |
4502 | 4529 | ||
4503 | // Agent not here | 4530 | // Agent not here |
4504 | return false; | 4531 | return false; |
4505 | } | 4532 | } |
4506 | 4533 | ||