diff options
author | Justin Clark-Casey (justincc) | 2013-07-15 23:28:02 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-07-15 23:28:02 +0100 |
commit | eb14e5a1756726b1f296591bb1ac385e4b1372d7 (patch) | |
tree | 6a7e5e7489785729a2487a0245e0c7e3a9ee99bd /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Add request received/handling stats for caps which are served by http poll ha... (diff) | |
parent | Revert "Puts RequestImage (UDP) back to asyn -- CPU spike hunt" (diff) | |
download | opensim-SC_OLD-eb14e5a1756726b1f296591bb1ac385e4b1372d7.zip opensim-SC_OLD-eb14e5a1756726b1f296591bb1ac385e4b1372d7.tar.gz opensim-SC_OLD-eb14e5a1756726b1f296591bb1ac385e4b1372d7.tar.bz2 opensim-SC_OLD-eb14e5a1756726b1f296591bb1ac385e4b1372d7.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 54956ee..9cfe869 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3452,7 +3452,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3452 | regions.Remove(RegionInfo.RegionHandle); | 3452 | regions.Remove(RegionInfo.RegionHandle); |
3453 | 3453 | ||
3454 | // This ends up being done asynchronously so that a logout isn't held up where there are many present but unresponsive neighbours. | 3454 | // This ends up being done asynchronously so that a logout isn't held up where there are many present but unresponsive neighbours. |
3455 | m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); | 3455 | m_sceneGridService.SendCloseChildAgentConnections(agentID, acd.SessionID.ToString(), regions); |
3456 | } | 3456 | } |
3457 | 3457 | ||
3458 | m_eventManager.TriggerClientClosed(agentID, this); | 3458 | m_eventManager.TriggerClientClosed(agentID, this); |
@@ -4202,10 +4202,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
4202 | 4202 | ||
4203 | if (childAgentUpdate != null) | 4203 | if (childAgentUpdate != null) |
4204 | { | 4204 | { |
4205 | if (cAgentData.SessionID != childAgentUpdate.ControllingClient.SessionId) | ||
4206 | { | ||
4207 | 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); | ||
4208 | Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", | ||
4209 | childAgentUpdate.UUID, childAgentUpdate.ControllingClient.SessionId, cAgentData.SessionID)); | ||
4210 | } | ||
4211 | |||
4205 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); | 4212 | childAgentUpdate.ChildAgentDataUpdate(cAgentData); |
4206 | return true; | 4213 | return true; |
4207 | } | 4214 | } |
4208 | |||
4209 | return false; | 4215 | return false; |
4210 | } | 4216 | } |
4211 | 4217 | ||
@@ -4221,20 +4227,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
4221 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); | 4227 | ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); |
4222 | if (childAgentUpdate != null) | 4228 | if (childAgentUpdate != null) |
4223 | { | 4229 | { |
4224 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. | 4230 | if (childAgentUpdate.ControllingClient.SessionId == cAgentData.SessionID) |
4225 | // however to avoid a race condition crossing borders.. | ||
4226 | if (childAgentUpdate.IsChildAgent) | ||
4227 | { | 4231 | { |
4228 | uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); | 4232 | // I can't imagine *yet* why we would get an update if the agent is a root agent.. |
4229 | uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); | 4233 | // however to avoid a race condition crossing borders.. |
4230 | uint tRegionX = RegionInfo.RegionLocX; | 4234 | if (childAgentUpdate.IsChildAgent) |
4231 | uint tRegionY = RegionInfo.RegionLocY; | 4235 | { |
4232 | //Send Data to ScenePresence | 4236 | uint rRegionX = (uint)(cAgentData.RegionHandle >> 40); |
4233 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); | 4237 | uint rRegionY = (((uint)(cAgentData.RegionHandle)) >> 8); |
4234 | // Not Implemented: | 4238 | uint tRegionX = RegionInfo.RegionLocX; |
4235 | //TODO: Do we need to pass the message on to one of our neighbors? | 4239 | uint tRegionY = RegionInfo.RegionLocY; |
4240 | //Send Data to ScenePresence | ||
4241 | childAgentUpdate.ChildAgentDataUpdate(cAgentData, tRegionX, tRegionY, rRegionX, rRegionY); | ||
4242 | // Not Implemented: | ||
4243 | //TODO: Do we need to pass the message on to one of our neighbors? | ||
4244 | } | ||
4236 | } | 4245 | } |
4237 | 4246 | else | |
4247 | m_log.WarnFormat("[SCENE]: Attempt at updating position of agent {0} with invalid session id {1}", childAgentUpdate.UUID, cAgentData.SessionID); | ||
4238 | return true; | 4248 | return true; |
4239 | } | 4249 | } |
4240 | 4250 | ||
@@ -4277,6 +4287,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
4277 | 4287 | ||
4278 | return false; | 4288 | return false; |
4279 | } | 4289 | } |
4290 | /// <summary> | ||
4291 | /// Authenticated close (via network) | ||
4292 | /// </summary> | ||
4293 | /// <param name="agentID"></param> | ||
4294 | /// <param name="force"></param> | ||
4295 | /// <param name="auth_token"></param> | ||
4296 | /// <returns></returns> | ||
4297 | public bool IncomingCloseAgent(UUID agentID, bool force, string auth_token) | ||
4298 | { | ||
4299 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent {0} in region {1} with auth_token {2}", agentID, RegionInfo.RegionName, auth_token); | ||
4300 | |||
4301 | // Check that the auth_token is valid | ||
4302 | AgentCircuitData acd = AuthenticateHandler.GetAgentCircuitData(agentID); | ||
4303 | if (acd != null && acd.SessionID.ToString() == auth_token) | ||
4304 | return IncomingCloseAgent(agentID, force); | ||
4305 | else | ||
4306 | m_log.ErrorFormat("[SCENE]: Request to close agent {0} with invalid authorization token {1}", agentID, auth_token); | ||
4307 | return false; | ||
4308 | } | ||
4280 | 4309 | ||
4281 | /// <summary> | 4310 | /// <summary> |
4282 | /// Tell a single agent to disconnect from the region. | 4311 | /// Tell a single agent to disconnect from the region. |
@@ -4289,7 +4318,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4289 | public bool IncomingCloseAgent(UUID agentID, bool force) | 4318 | public bool IncomingCloseAgent(UUID agentID, bool force) |
4290 | { | 4319 | { |
4291 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); | 4320 | //m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID); |
4292 | |||
4293 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); | 4321 | ScenePresence presence = m_sceneGraph.GetScenePresence(agentID); |
4294 | if (presence != null) | 4322 | if (presence != null) |
4295 | { | 4323 | { |
@@ -4297,7 +4325,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4297 | return true; | 4325 | return true; |
4298 | } | 4326 | } |
4299 | 4327 | ||
4300 | // Agent not here | 4328 | // Agent not here |
4301 | return false; | 4329 | return false; |
4302 | } | 4330 | } |
4303 | 4331 | ||