aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
authorMelanie2009-10-22 07:12:10 +0100
committerMelanie2009-10-22 07:12:10 +0100
commitc4969d47d9bbc22b37054451cd31451ca8d8c78a (patch)
tree788e3b034254bcf068ca950ee97a78b6aa07b386 /OpenSim/Region/Framework/Scenes/SceneGraph.cs
parentMerge branch 'master' into vehicles (diff)
parentRemove the "mel_t" from version string (diff)
downloadopensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.zip
opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.tar.gz
opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.tar.bz2
opensim-SC_OLD-c4969d47d9bbc22b37054451cd31451ca8d8c78a.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs32
1 files changed, 10 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index ba5119f..deee6c3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -467,7 +467,6 @@ namespace OpenSim.Region.Framework.Scenes
467 protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent) 467 protected internal void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot, bool silent)
468 { 468 {
469 // If we can't take it, we can't attach it! 469 // If we can't take it, we can't attach it!
470 //
471 SceneObjectPart part = m_parentScene.GetSceneObjectPart(objectLocalID); 470 SceneObjectPart part = m_parentScene.GetSceneObjectPart(objectLocalID);
472 if (part == null) 471 if (part == null)
473 return; 472 return;
@@ -477,9 +476,16 @@ namespace OpenSim.Region.Framework.Scenes
477 return; 476 return;
478 477
479 // Calls attach with a Zero position 478 // Calls attach with a Zero position
480 //
481 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false); 479 AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, Vector3.Zero, false);
482 m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); 480 m_parentScene.SendAttachEvent(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
481
482 // Save avatar attachment information
483 ScenePresence presence;
484 if (m_parentScene.AvatarFactory != null && m_parentScene.TryGetAvatar(remoteClient.AgentId, out presence))
485 {
486 m_log.Info("[SCENE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + ", AttachmentPoint: " + AttachmentPt);
487 m_parentScene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
488 }
483 } 489 }
484 490
485 public SceneObjectGroup RezSingleAttachment( 491 public SceneObjectGroup RezSingleAttachment(
@@ -574,7 +580,7 @@ namespace OpenSim.Region.Framework.Scenes
574 } 580 }
575 581
576 582
577 group.SetAttachmentPoint(Convert.ToByte(AttachmentPt)); 583 group.SetAttachmentPoint((byte)AttachmentPt);
578 group.AbsolutePosition = attachPos; 584 group.AbsolutePosition = attachPos;
579 585
580 // Saves and gets itemID 586 // Saves and gets itemID
@@ -613,7 +619,6 @@ namespace OpenSim.Region.Framework.Scenes
613 619
614 newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance); 620 newAvatar = new ScenePresence(client, m_parentScene, m_regInfo, appearance);
615 newAvatar.IsChildAgent = true; 621 newAvatar.IsChildAgent = true;
616 newAvatar.MaxPrimsPerFrame = m_parentScene.MaxPrimsPerFrame;
617 622
618 AddScenePresence(newAvatar); 623 AddScenePresence(newAvatar);
619 624
@@ -847,7 +852,7 @@ namespace OpenSim.Region.Framework.Scenes
847 /// </summary> 852 /// </summary>
848 /// <param name="localID"></param> 853 /// <param name="localID"></param>
849 /// <returns>null if no scene object group containing that prim is found</returns> 854 /// <returns>null if no scene object group containing that prim is found</returns>
850 private SceneObjectGroup GetGroupByPrim(uint localID) 855 public SceneObjectGroup GetGroupByPrim(uint localID)
851 { 856 {
852 if (Entities.ContainsKey(localID)) 857 if (Entities.ContainsKey(localID))
853 return Entities[localID] as SceneObjectGroup; 858 return Entities[localID] as SceneObjectGroup;
@@ -1107,23 +1112,6 @@ namespace OpenSim.Region.Framework.Scenes
1107 return UUID.Zero; 1112 return UUID.Zero;
1108 } 1113 }
1109 1114
1110 protected internal void ForEachClient(Action<IClientAPI> action)
1111 {
1112 List<ScenePresence> splist = GetScenePresences();
1113 foreach (ScenePresence presence in splist)
1114 {
1115 try
1116 {
1117 action(presence.ControllingClient);
1118 }
1119 catch (Exception e)
1120 {
1121 // Catch it and move on. This includes situations where splist has inconsistent info
1122 m_log.WarnFormat("[SCENE]: Problem processing action in ForEachClient: ", e.Message);
1123 }
1124 }
1125 }
1126
1127 protected internal void ForEachSOG(Action<SceneObjectGroup> action) 1115 protected internal void ForEachSOG(Action<SceneObjectGroup> action)
1128 { 1116 {
1129 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values); 1117 List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);