aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs35
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs21
5 files changed, 85 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 437b91a..c321a15 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -293,6 +293,17 @@ namespace OpenSim.Region.Framework.Scenes
293 public event ChatFromClientEvent OnChatFromClient; 293 public event ChatFromClientEvent OnChatFromClient;
294 294
295 /// <summary> 295 /// <summary>
296 /// ChatToClientsEvent is triggered via ChatModule (or
297 /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a
298 /// received chat message if they satisfy various conditions (within audible range, etc.)
299 /// </summary>
300 public delegate void ChatToClientsEvent(
301 UUID senderID, HashSet<UUID> receiverIDs,
302 string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
303 ChatSourceType src, ChatAudibleLevel level);
304 public event ChatToClientsEvent OnChatToClients;
305
306 /// <summary>
296 /// ChatBroadcastEvent is called via Scene when a broadcast chat message 307 /// ChatBroadcastEvent is called via Scene when a broadcast chat message
297 /// from world comes in 308 /// from world comes in
298 /// </summary> 309 /// </summary>
@@ -1603,6 +1614,30 @@ namespace OpenSim.Region.Framework.Scenes
1603 } 1614 }
1604 } 1615 }
1605 } 1616 }
1617
1618 public void TriggerOnChatToClients(
1619 UUID senderID, HashSet<UUID> receiverIDs,
1620 string message, ChatTypeEnum type, Vector3 fromPos, string fromName,
1621 ChatSourceType src, ChatAudibleLevel level)
1622 {
1623 ChatToClientsEvent handler = OnChatToClients;
1624 if (handler != null)
1625 {
1626 foreach (ChatToClientsEvent d in handler.GetInvocationList())
1627 {
1628 try
1629 {
1630 d(senderID, receiverIDs, message, type, fromPos, fromName, src, level);
1631 }
1632 catch (Exception e)
1633 {
1634 m_log.ErrorFormat(
1635 "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}",
1636 e.Message, e.StackTrace);
1637 }
1638 }
1639 }
1640 }
1606 1641
1607 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) 1642 public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
1608 { 1643 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6ed08f3..6367fcf 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2388,7 +2388,7 @@ namespace OpenSim.Region.Framework.Scenes
2388 } 2388 }
2389 catch (Exception e) 2389 catch (Exception e)
2390 { 2390 {
2391 m_log.WarnFormat("[SCENE]: Problem casting object: {0}", e.Message); 2391 m_log.WarnFormat("[SCENE]: Problem casting object: " + e.ToString());
2392 return false; 2392 return false;
2393 } 2393 }
2394 2394
@@ -3271,7 +3271,6 @@ namespace OpenSim.Region.Framework.Scenes
3271 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName); 3271 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3272 } 3272 }
3273 3273
3274
3275 /// <summary> 3274 /// <summary>
3276 /// Do the work necessary to initiate a new user connection for a particular scene. 3275 /// Do the work necessary to initiate a new user connection for a particular scene.
3277 /// At the moment, this consists of setting up the caps infrastructure 3276 /// At the moment, this consists of setting up the caps infrastructure
@@ -3284,6 +3283,23 @@ namespace OpenSim.Region.Framework.Scenes
3284 /// also return a reason.</returns> 3283 /// also return a reason.</returns>
3285 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) 3284 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
3286 { 3285 {
3286 return NewUserConnection(agent, teleportFlags, out reason, true);
3287 }
3288
3289 /// <summary>
3290 /// Do the work necessary to initiate a new user connection for a particular scene.
3291 /// At the moment, this consists of setting up the caps infrastructure
3292 /// The return bool should allow for connections to be refused, but as not all calling paths
3293 /// take proper notice of it let, we allowed banned users in still.
3294 /// </summary>
3295 /// <param name="agent">CircuitData of the agent who is connecting</param>
3296 /// <param name="reason">Outputs the reason for the false response on this string</param>
3297 /// <param name="requirePresenceLookup">True for normal presence. False for NPC
3298 /// or other applications where a full grid/Hypergrid presence may not be required.</param>
3299 /// <returns>True if the region accepts this agent. False if it does not. False will
3300 /// also return a reason.</returns>
3301 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
3302 {
3287 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || 3303 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
3288 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); 3304 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
3289 reason = String.Empty; 3305 reason = String.Empty;
@@ -3332,16 +3348,18 @@ namespace OpenSim.Region.Framework.Scenes
3332 3348
3333 if (sp == null) // We don't have an [child] agent here already 3349 if (sp == null) // We don't have an [child] agent here already
3334 { 3350 {
3335 3351 if (requirePresenceLookup)
3336 try
3337 { 3352 {
3338 if (!VerifyUserPresence(agent, out reason)) 3353 try
3354 {
3355 if (!VerifyUserPresence(agent, out reason))
3356 return false;
3357 }
3358 catch (Exception e)
3359 {
3360 m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
3339 return false; 3361 return false;
3340 } 3362 }
3341 catch (Exception e)
3342 {
3343 m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message);
3344 return false;
3345 } 3363 }
3346 3364
3347 try 3365 try
@@ -3351,7 +3369,7 @@ namespace OpenSim.Region.Framework.Scenes
3351 } 3369 }
3352 catch (Exception e) 3370 catch (Exception e)
3353 { 3371 {
3354 m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); 3372 m_log.ErrorFormat("[CONNECTION BEGIN]: Exception authorizing user " + e.ToString());
3355 return false; 3373 return false;
3356 } 3374 }
3357 3375
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index f81c551..24d7334 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -406,11 +406,14 @@ namespace OpenSim.Region.Framework.Scenes
406 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked) 406 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked)
407 { 407 {
408 EntityBase entity; 408 EntityBase entity;
409 if (!Entities.TryGetValue(uuid, out entity) && entity is SceneObjectGroup) 409 if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup)))
410 return false; 410 return false;
411 411
412 SceneObjectGroup grp = (SceneObjectGroup)entity; 412 SceneObjectGroup grp = (SceneObjectGroup)entity;
413 413
414 if (entity == null)
415 return false;
416
414 if (!resultOfObjectLinked) 417 if (!resultOfObjectLinked)
415 { 418 {
416 m_numPrim -= grp.PrimCount; 419 m_numPrim -= grp.PrimCount;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8541121..6576e64 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2897,9 +2897,6 @@ namespace OpenSim.Region.Framework.Scenes
2897 2897
2898 public void CopyTo(AgentData cAgent) 2898 public void CopyTo(AgentData cAgent)
2899 { 2899 {
2900// DEBUG ON
2901 m_log.ErrorFormat("[SCENEPRESENCE] CALLING COPYTO");
2902// DEBUG OFF
2903 cAgent.CallbackURI = m_callbackURI; 2900 cAgent.CallbackURI = m_callbackURI;
2904 2901
2905 cAgent.AgentID = UUID; 2902 cAgent.AgentID = UUID;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 044b599..e661ca9 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)
@@ -1426,7 +1426,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1426 1426
1427 reader.ReadStartElement(name); 1427 reader.ReadStartElement(name);
1428 vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x 1428 vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x
1429 vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or Y 1429 vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or y
1430 vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z 1430 vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z
1431 reader.ReadEndElement(); 1431 reader.ReadEndElement();
1432 1432
@@ -1501,15 +1501,28 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1501 1501
1502 reader.ReadStartElement(name, String.Empty); // Shape 1502 reader.ReadStartElement(name, String.Empty); // Shape
1503 1503
1504 string nodeName = string.Empty;
1504 while (reader.NodeType != XmlNodeType.EndElement) 1505 while (reader.NodeType != XmlNodeType.EndElement)
1505 { 1506 {
1507 nodeName = reader.Name;
1506 //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); 1508 //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name);
1507 ShapeXmlProcessor p = null; 1509 ShapeXmlProcessor p = null;
1508 if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p)) 1510 if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p))
1509 p(shape, reader); 1511 {
1512 try
1513 {
1514 p(shape, reader);
1515 }
1516 catch (Exception e)
1517 {
1518 m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing Shape {0}: {1}", nodeName, e);
1519 if (reader.NodeType == XmlNodeType.EndElement)
1520 reader.Read();
1521 }
1522 }
1510 else 1523 else
1511 { 1524 {
1512// m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name); 1525 // m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name);
1513 reader.ReadOuterXml(); 1526 reader.ReadOuterXml();
1514 } 1527 }
1515 } 1528 }