on TPs to nearby regions, only send kills if needed by parcel privacy

avinationmerge
UbitUmarov 2014-08-27 00:37:05 +01:00
parent 92b0b27caf
commit 620443f858
2 changed files with 38 additions and 14 deletions

View File

@ -986,7 +986,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Well, this is it. The agent is over there. // Well, this is it. The agent is over there.
// KillEntity(sp.Scene, sp.LocalId); // KillEntity(sp.Scene, sp.LocalId);
sp.HasMovedAway(); bool nearRegion = sp.KnownRegions.ContainsKey(destinationHandle);
sp.HasMovedAway(nearRegion);
// Now let's make it officially a child agent // Now let's make it officially a child agent
sp.MakeChildAgent(); sp.MakeChildAgent();
@ -1141,7 +1142,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
sp.HasMovedAway(); bool nearRegion = sp.KnownRegions.ContainsKey(destinationHandle);
sp.HasMovedAway(nearRegion);
// Need to signal neighbours whether child agents may need closing irrespective of whether this // Need to signal neighbours whether child agents may need closing irrespective of whether this
// one needed closing. We also need to close child agents as quickly as possible to avoid complicated // one needed closing. We also need to close child agents as quickly as possible to avoid complicated
@ -1784,9 +1786,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
// this may need the attachments // this may need the attachments
agent.parcelRegionCross();
AgentHasMovedAway(agent, true); agent.HasMovedAway(true);
// agent.parcelRegionCross();
// AgentHasMovedAway(agent, true);
agent.MakeChildAgent(); agent.MakeChildAgent();

View File

@ -5962,7 +5962,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void HasMovedAway() public void HasMovedAway(bool nearRegion)
{
if (nearRegion)
{
if (!ParcelHideThisAvatar || GodLevel >= 200)
return;
List<ScenePresence> allpresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.IsChildAgent || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.currentParcelUUID == m_currentParcelUUID)
{
p.SendKillTo(this);
}
}
}
else
{ {
List<ScenePresence> allpresences = m_scene.GetScenePresences(); List<ScenePresence> allpresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allpresences) foreach (ScenePresence p in allpresences)
@ -5973,7 +5993,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!p.IsChildAgent) if (!p.IsChildAgent)
p.SendKillTo(this); p.SendKillTo(this);
} }
}
if (Scene.AttachmentsModule != null) if (Scene.AttachmentsModule != null)
Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
} }