aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs95
1 files changed, 60 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 5af6a6c..977ff24 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1400,7 +1400,7 @@ namespace OpenSim.Region.Framework.Scenes
1400 else 1400 else
1401 Animator.ResetAnimations(); 1401 Animator.ResetAnimations();
1402 1402
1403 1403
1404// m_log.DebugFormat( 1404// m_log.DebugFormat(
1405// "[SCENE PRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", 1405// "[SCENE PRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}",
1406// Name, UUID, m_scene.RegionInfo.RegionName); 1406// Name, UUID, m_scene.RegionInfo.RegionName);
@@ -1876,17 +1876,14 @@ namespace OpenSim.Region.Framework.Scenes
1876 1876
1877 if (!IsChildAgent) 1877 if (!IsChildAgent)
1878 { 1878 {
1879 newhide = m_currentParcelHide;
1880 m_currentParcelHide = false;
1881 1879
1882 // take this region out of children Neighbours list
1883 // possible should be done elsewhere
1884 DropThisRootRegionFromNeighbours();
1885 1880
1886 ValidateAndSendAppearanceAndAgentData(); 1881 ValidateAndSendAppearanceAndAgentData();
1887 1882
1888 m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 1883 m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts));
1889 1884
1885 List<SceneObjectGroup> attachments = GetAttachments();
1886
1890 // attachments 1887 // attachments
1891 if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0) 1888 if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
1892 { 1889 {
@@ -1899,8 +1896,6 @@ namespace OpenSim.Region.Framework.Scenes
1899 } 1896 }
1900 else 1897 else
1901 { 1898 {
1902 List<SceneObjectGroup> attachments = GetAttachments();
1903
1904 if (attachments.Count > 0) 1899 if (attachments.Count > 0)
1905 { 1900 {
1906 m_log.DebugFormat( 1901 m_log.DebugFormat(
@@ -1930,7 +1925,7 @@ namespace OpenSim.Region.Framework.Scenes
1930 m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 1925 m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts));
1931 1926
1932 // send the rest of the world 1927 // send the rest of the world
1933 if (m_teleportFlags > 0 && !isNPC) 1928 if (m_teleportFlags > 0 && !isNPC || m_currentParcelHide)
1934 SendInitialDataToMe(); 1929 SendInitialDataToMe();
1935 1930
1936 m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 1931 m_log.DebugFormat("[CompleteMovement] SendInitialDataToMe: {0}ms", Util.EnvironmentTickCountSubtract(ts));
@@ -1961,11 +1956,11 @@ namespace OpenSim.Region.Framework.Scenes
1961 m_inTransit = false; 1956 m_inTransit = false;
1962 } 1957 }
1963 // if hide force a check 1958 // if hide force a check
1964 if (!IsChildAgent && newhide) 1959 // if (!IsChildAgent && newhide)
1965 { 1960 // {
1966 ParcelLoginCheck(m_currentParcelUUID); 1961 // ParcelLoginCheck(m_currentParcelUUID);
1967 m_currentParcelHide = newhide; 1962 // m_currentParcelHide = newhide;
1968 } 1963 // }
1969 1964
1970 m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 1965 m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts));
1971 } 1966 }
@@ -3533,14 +3528,25 @@ namespace OpenSim.Region.Framework.Scenes
3533 m_scene.AvatarFactory.QueueAppearanceSave(UUID); 3528 m_scene.AvatarFactory.QueueAppearanceSave(UUID);
3534 } 3529 }
3535 3530
3531 bool newhide = m_currentParcelHide;
3532 m_currentParcelHide = false;
3533
3536 SendAvatarDataToAllAgents(); 3534 SendAvatarDataToAllAgents();
3535
3536 if (newhide)
3537 {
3538 ParcelLoginCheck(m_currentParcelUUID);
3539 m_currentParcelHide = true;
3540 }
3541
3537 SendAppearanceToAgent(this); 3542 SendAppearanceToAgent(this);
3538 3543
3539// if (cachedappearance) 3544// if (cachedappearance)
3540// { 3545// {
3541 SendAppearanceToAllOtherAgents(); 3546 SendAppearanceToAllOtherAgents();
3542// } 3547// }
3543 Animator.SendAnimPack(); 3548 if(Animator!= null)
3549 Animator.SendAnimPack();
3544 } 3550 }
3545 3551
3546 /// <summary> 3552 /// <summary>
@@ -5481,7 +5487,7 @@ namespace OpenSim.Region.Framework.Scenes
5481 private void ParcelLoginCheck(UUID currentParcelID) 5487 private void ParcelLoginCheck(UUID currentParcelID)
5482 { 5488 {
5483 List<ScenePresence> killsToSendto = new List<ScenePresence>(); 5489 List<ScenePresence> killsToSendto = new List<ScenePresence>();
5484 List<ScenePresence> killsToSendme = new List<ScenePresence>(); 5490 List<uint> killsToSendme = new List<uint>();
5485 List<ScenePresence> viewsToSendto = new List<ScenePresence>(); 5491 List<ScenePresence> viewsToSendto = new List<ScenePresence>();
5486 List<ScenePresence> viewsToSendme = new List<ScenePresence>(); 5492 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
5487 List<ScenePresence> allpresences = null; 5493 List<ScenePresence> allpresences = null;
@@ -5498,7 +5504,7 @@ namespace OpenSim.Region.Framework.Scenes
5498 if (p.GodLevel < 200) 5504 if (p.GodLevel < 200)
5499 killsToSendto.Add(p); 5505 killsToSendto.Add(p);
5500 if (GodLevel < 200 && p.ParcelHideThisAvatar) 5506 if (GodLevel < 200 && p.ParcelHideThisAvatar)
5501 killsToSendme.Add(p); 5507 killsToSendme.Add(p.LocalId);
5502 } 5508 }
5503 else 5509 else
5504 { 5510 {
@@ -5522,14 +5528,15 @@ namespace OpenSim.Region.Framework.Scenes
5522 5528
5523 if (killsToSendme.Count > 0) 5529 if (killsToSendme.Count > 0)
5524 { 5530 {
5525 foreach (ScenePresence p in killsToSendme) 5531 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + killsToSendme.Count.ToString());
5532 try
5526 { 5533 {
5527 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); 5534 ControllingClient.SendKillObject(killsToSendme);
5528 try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
5529 catch (NullReferenceException) { }
5530 } 5535 }
5531 } 5536 catch (NullReferenceException) { }
5532 5537
5538 }
5539/*
5533 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc) 5540 if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
5534 { 5541 {
5535 foreach (ScenePresence p in viewsToSendto) 5542 foreach (ScenePresence p in viewsToSendto)
@@ -5557,16 +5564,18 @@ namespace OpenSim.Region.Framework.Scenes
5557 p.Animator.SendAnimPackToClient(ControllingClient); 5564 p.Animator.SendAnimPackToClient(ControllingClient);
5558 } 5565 }
5559 } 5566 }
5567*/
5560 } 5568 }
5561 5569
5562 public void parcelRegionCross(bool abort) 5570 public void parcelRegionCross(bool abort)
5563 { 5571 {
5564 if (!ParcelHideThisAvatar) 5572// if (!ParcelHideThisAvatar)
5565 return; 5573// return;
5566 5574
5567 List<ScenePresence> allpresences = null; 5575 List<ScenePresence> allpresences = null;
5568 allpresences = m_scene.GetScenePresences(); 5576 allpresences = m_scene.GetScenePresences();
5569 5577
5578// abort no longer complet
5570 if (abort) 5579 if (abort)
5571 { 5580 {
5572 List<ScenePresence> viewsToSendme = new List<ScenePresence>(); 5581 List<ScenePresence> viewsToSendme = new List<ScenePresence>();
@@ -5588,7 +5597,7 @@ namespace OpenSim.Region.Framework.Scenes
5588 { 5597 {
5589 if (p.IsChildAgent) 5598 if (p.IsChildAgent)
5590 continue; 5599 continue;
5591// m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname); 5600 // m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
5592 ControllingClient.SendAvatarDataImmediate(p); 5601 ControllingClient.SendAvatarDataImmediate(p);
5593 p.SendAppearanceToAgent(this); 5602 p.SendAppearanceToAgent(this);
5594 p.SendAttachmentsToClient(ControllingClient); 5603 p.SendAttachmentsToClient(ControllingClient);
@@ -5599,22 +5608,36 @@ namespace OpenSim.Region.Framework.Scenes
5599 } 5608 }
5600 else 5609 else
5601 { 5610 {
5602 if (GodLevel >= 200)
5603 return;
5604 5611
5612 bool inprivate = ParcelHideThisAvatar && GodLevel < 200;
5605 List<uint> killsToSendme = new List<uint>(); 5613 List<uint> killsToSendme = new List<uint>();
5606 foreach (ScenePresence p in allpresences) 5614
5615 if (inprivate)
5607 { 5616 {
5608 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) 5617 foreach (ScenePresence p in allpresences)
5609 continue; 5618 {
5619 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5620 continue;
5610 5621
5611 if (p.currentParcelUUID == m_currentParcelUUID) 5622 if (p.currentParcelUUID == m_currentParcelUUID)
5612 { 5623 {
5613 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname); 5624 m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
5614 killsToSendme.Add(p.LocalId); 5625 killsToSendme.Add(p.LocalId);
5626 }
5615 } 5627 }
5616 } 5628 }
5629/*
5630 else
5631 {
5632 foreach (ScenePresence p in allpresences)
5633 {
5634 if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
5635 continue;
5617 5636
5637 killsToSendme.Add(p.LocalId);
5638 }
5639 }
5640*/
5618 if (killsToSendme.Count > 0) 5641 if (killsToSendme.Count > 0)
5619 { 5642 {
5620 try 5643 try
@@ -5623,8 +5646,10 @@ namespace OpenSim.Region.Framework.Scenes
5623 } 5646 }
5624 catch (NullReferenceException) { } 5647 catch (NullReferenceException) { }
5625 } 5648 }
5649
5650 if (Scene.AttachmentsModule != null)
5651 Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
5626 5652
5627
5628 } 5653 }
5629 } 5654 }
5630 5655