diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 95 |
2 files changed, 73 insertions, 40 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index feeb0d5..0208676 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -980,7 +980,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
980 | } | 980 | } |
981 | 981 | ||
982 | // May need to logout or other cleanup | 982 | // May need to logout or other cleanup |
983 | AgentHasMovedAway(sp, logout); | 983 | // AgentHasMovedAway(sp, logout); |
984 | AgentHasMovedAway(sp, true); // until logout use is checked | ||
984 | 985 | ||
985 | // Well, this is it. The agent is over there. | 986 | // Well, this is it. The agent is over there. |
986 | KillEntity(sp.Scene, sp.LocalId); | 987 | KillEntity(sp.Scene, sp.LocalId); |
@@ -1147,7 +1148,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1147 | sp.CloseChildAgents(newRegionX, newRegionY); | 1148 | sp.CloseChildAgents(newRegionX, newRegionY); |
1148 | 1149 | ||
1149 | // May need to logout or other cleanup | 1150 | // May need to logout or other cleanup |
1150 | AgentHasMovedAway(sp, logout); | 1151 | // AgentHasMovedAway(sp, logout); |
1152 | AgentHasMovedAway(sp, true); | ||
1151 | 1153 | ||
1152 | // Well, this is it. The agent is over there. | 1154 | // Well, this is it. The agent is over there. |
1153 | KillEntity(sp.Scene, sp.LocalId); | 1155 | KillEntity(sp.Scene, sp.LocalId); |
@@ -1262,7 +1264,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1262 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) | 1264 | protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout) |
1263 | { | 1265 | { |
1264 | if (sp.Scene.AttachmentsModule != null) | 1266 | if (sp.Scene.AttachmentsModule != null) |
1265 | sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, true); | 1267 | sp.Scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, logout); |
1266 | } | 1268 | } |
1267 | 1269 | ||
1268 | protected void KillEntity(Scene scene, uint localID) | 1270 | protected void KillEntity(Scene scene, uint localID) |
@@ -1740,6 +1742,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1740 | } | 1742 | } |
1741 | 1743 | ||
1742 | // No turning back | 1744 | // No turning back |
1745 | |||
1746 | |||
1747 | |||
1743 | agent.IsChildAgent = true; | 1748 | agent.IsChildAgent = true; |
1744 | 1749 | ||
1745 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); | 1750 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
@@ -1777,7 +1782,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1777 | // Unlike a teleport, here we do not wait for the destination region to confirm the receipt. | 1782 | // Unlike a teleport, here we do not wait for the destination region to confirm the receipt. |
1778 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); | 1783 | m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); |
1779 | 1784 | ||
1780 | agent.parcelRegionCross(false); | 1785 | AgentHasMovedAway(agent, false); |
1786 | |||
1787 | KillEntity(agent.Scene, agent.LocalId); | ||
1788 | // agent.parcelRegionCross(false); | ||
1781 | 1789 | ||
1782 | agent.MakeChildAgent(); | 1790 | agent.MakeChildAgent(); |
1783 | 1791 | ||
@@ -1803,7 +1811,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1803 | 1811 | ||
1804 | agent.CloseChildAgents(neighbourx, neighboury); | 1812 | agent.CloseChildAgents(neighbourx, neighboury); |
1805 | 1813 | ||
1806 | AgentHasMovedAway(agent, false); | 1814 | |
1807 | 1815 | ||
1808 | // the user may change their profile information in other region, | 1816 | // the user may change their profile information in other region, |
1809 | // so the userinfo in UserProfileCache is not reliable any more, delete it | 1817 | // so the userinfo in UserProfileCache is not reliable any more, delete it |
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 | ||