aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2011-10-24 18:22:36 +0200
committerMelanie2011-10-24 18:22:36 +0200
commit4a6160e7ad6284de8eef48892c6a6e133d4ddc2f (patch)
treea90b9ab6941b5bc168b5752b9a1804e491df4e84 /OpenSim/Region
parentAllow updating the movement animation while flying. This fixes falling, (diff)
downloadopensim-SC-4a6160e7ad6284de8eef48892c6a6e133d4ddc2f.zip
opensim-SC-4a6160e7ad6284de8eef48892c6a6e133d4ddc2f.tar.gz
opensim-SC-4a6160e7ad6284de8eef48892c6a6e133d4ddc2f.tar.bz2
opensim-SC-4a6160e7ad6284de8eef48892c6a6e133d4ddc2f.tar.xz
Fake an AgentCircuitData if none is available rather than crashing out
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs26
1 files changed, 24 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 80d7871..98bc44f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5360,16 +5360,38 @@ namespace OpenSim.Region.Framework.Scenes
5360 } 5360 }
5361 } 5361 }
5362 5362
5363 ScenePresence presence = GetScenePresence(agentID);
5364 IClientAPI client = null;
5365 AgentCircuitData aCircuit = null;
5366
5367 if (presence != null)
5368 {
5369 client = presence.ControllingClient;
5370 if (client != null)
5371 aCircuit = client.RequestClientInfo();
5372 }
5373
5374 // We may be called before there is a presence or a client.
5375 // Fake AgentCircuitData to keep IAuthorizationModule smiling
5376 if (client == null)
5377 {
5378 aCircuit = new AgentCircuitData();
5379 aCircuit.AgentID = agentID;
5380 aCircuit.firstname = String.Empty;
5381 aCircuit.lastname = String.Empty;
5382 }
5383
5363 try 5384 try
5364 { 5385 {
5365 if (!AuthorizeUser(GetScenePresence(agentID).ControllingClient.RequestClientInfo(), out reason)) 5386 if (!AuthorizeUser(aCircuit, out reason))
5366 { 5387 {
5367 // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID); 5388 // m_log.DebugFormat("[SCENE]: Denying access for {0}", agentID);
5368 return false; 5389 return false;
5369 } 5390 }
5370 } 5391 }
5371 catch 5392 catch (Exception e)
5372 { 5393 {
5394 m_log.DebugFormat("[SCENE]: Exception authorizing agent: {0} "+ e.StackTrace, e.Message);
5373 return false; 5395 return false;
5374 } 5396 }
5375 5397