aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2010-10-27 20:49:27 +0100
committerMelanie2010-10-27 20:49:27 +0100
commit05dbe4f2c4a58017ce6b59de45c2764f7ede4bd3 (patch)
tree22f6354b59a944d16aa9d0cab39fdb43ffb20667 /OpenSim/Region/Framework/Scenes
parentMerge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/va... (diff)
parentPrevent nullrefs in scene object deletion. Mantis #5156 (diff)
downloadopensim-SC_OLD-05dbe4f2c4a58017ce6b59de45c2764f7ede4bd3.zip
opensim-SC_OLD-05dbe4f2c4a58017ce6b59de45c2764f7ede4bd3.tar.gz
opensim-SC_OLD-05dbe4f2c4a58017ce6b59de45c2764f7ede4bd3.tar.bz2
opensim-SC_OLD-05dbe4f2c4a58017ce6b59de45c2764f7ede4bd3.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs36
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs2
4 files changed, 35 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 33069da..f24c53c 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -300,7 +300,7 @@ namespace OpenSim.Region.Framework.Scenes
300 /// ChatToClientsEvent is triggered via ChatModule (or 300 /// ChatToClientsEvent is triggered via ChatModule (or
301 /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a 301 /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
302 /// received chat message if they satisfy various conditions (within audible range, etc.) 302 /// received chat message if they satisfy various conditions (within audible range, etc.)
303 /// </summary> 303 /// </summary>
304 public delegate void ChatToClientsEvent( 304 public delegate void ChatToClientsEvent(
305 UUID senderID, HashSet<UUID> receiverIDs, 305 UUID senderID, HashSet<UUID> receiverIDs,
306 string message, ChatTypeEnum type, Vector3 fromPos, string fromName, 306 string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
@@ -1660,8 +1660,8 @@ namespace OpenSim.Region.Framework.Scenes
1660 e.Message, e.StackTrace); 1660 e.Message, e.StackTrace);
1661 } 1661 }
1662 } 1662 }
1663 } 1663 }
1664 } 1664 }
1665 1665
1666 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) 1666 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
1667 { 1667 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5428e5d..c3edeb3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3394,7 +3394,6 @@ namespace OpenSim.Region.Framework.Scenes
3394 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName); 3394 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3395 } 3395 }
3396 3396
3397
3398 /// <summary> 3397 /// <summary>
3399 /// Do the work necessary to initiate a new user connection for a particular scene. 3398 /// Do the work necessary to initiate a new user connection for a particular scene.
3400 /// At the moment, this consists of setting up the caps infrastructure 3399 /// At the moment, this consists of setting up the caps infrastructure
@@ -3407,6 +3406,23 @@ namespace OpenSim.Region.Framework.Scenes
3407 /// also return a reason.</returns> 3406 /// also return a reason.</returns>
3408 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) 3407 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
3409 { 3408 {
3409 return NewUserConnection(agent, teleportFlags, out reason, true);
3410 }
3411
3412 /// <summary>
3413 /// Do the work necessary to initiate a new user connection for a particular scene.
3414 /// At the moment, this consists of setting up the caps infrastructure
3415 /// The return bool should allow for connections to be refused, but as not all calling paths
3416 /// take proper notice of it let, we allowed banned users in still.
3417 /// </summary>
3418 /// <param name="agent">CircuitData of the agent who is connecting</param>
3419 /// <param name="reason">Outputs the reason for the false response on this string</param>
3420 /// <param name="requirePresenceLookup">True for normal presence. False for NPC
3421 /// or other applications where a full grid/Hypergrid presence may not be required.</param>
3422 /// <returns>True if the region accepts this agent. False if it does not. False will
3423 /// also return a reason.</returns>
3424 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
3425 {
3410 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || 3426 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
3411 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); 3427 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
3412 reason = String.Empty; 3428 reason = String.Empty;
@@ -3456,16 +3472,18 @@ namespace OpenSim.Region.Framework.Scenes
3456 3472
3457 if (sp == null) // We don't have an [child] agent here already 3473 if (sp == null) // We don't have an [child] agent here already
3458 { 3474 {
3459 3475 if (requirePresenceLookup)
3460 try
3461 { 3476 {
3462 if (!VerifyUserPresence(agent, out reason)) 3477 try
3478 {
3479 if (!VerifyUserPresence(agent, out reason))
3480 return false;
3481 }
3482 catch (Exception e)
3483 {
3484 m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
3463 return false; 3485 return false;
3464 } 3486 }
3465 catch (Exception e)
3466 {
3467 m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
3468 return false;
3469 } 3487 }
3470 3488
3471 try 3489 try
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index d4e3717..b016065 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -428,11 +428,14 @@ namespace OpenSim.Region.Framework.Scenes
428 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked) 428 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked)
429 { 429 {
430 EntityBase entity; 430 EntityBase entity;
431 if (!Entities.TryGetValue(uuid, out entity) && entity is SceneObjectGroup) 431 if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup)))
432 return false; 432 return false;
433 433
434 SceneObjectGroup grp = (SceneObjectGroup)entity; 434 SceneObjectGroup grp = (SceneObjectGroup)entity;
435 435
436 if (entity == null)
437 return false;
438
436 if (!resultOfObjectLinked) 439 if (!resultOfObjectLinked)
437 { 440 {
438 m_numPrim -= grp.PrimCount; 441 m_numPrim -= grp.PrimCount;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index ad994c9..4aadfdb 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -804,7 +804,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
804 private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader) 804 private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader)
805 { 805 {
806 byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry")); 806 byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry"));
807 shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length); 807 shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length);
808 } 808 }
809 809
810 private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlTextReader reader) 810 private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlTextReader reader)