replace AgentHasMovedAway + KillEntity by a hacked version on teleports

avinationmerge
UbitUmarov 2014-08-21 22:42:45 +01:00
parent ad83b18634
commit 6674548af0
2 changed files with 17 additions and 5 deletions

View File

@ -981,10 +981,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// May need to logout or other cleanup // May need to logout or other cleanup
// AgentHasMovedAway(sp, logout); // AgentHasMovedAway(sp, logout);
AgentHasMovedAway(sp, true); // until logout use is checked // AgentHasMovedAway(sp, true); // until logout use is checked
// 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();
// Now let's make it officially a child agent // Now let's make it officially a child agent
sp.MakeChildAgent(); sp.MakeChildAgent();
@ -1147,12 +1149,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// abandoned without proper close by viewer but then re-used by an incoming connection. // abandoned without proper close by viewer but then re-used by an incoming connection.
sp.CloseChildAgents(newRegionX, newRegionY); sp.CloseChildAgents(newRegionX, newRegionY);
sp.HasMovedAway();
// May need to logout or other cleanup // May need to logout or other cleanup
// AgentHasMovedAway(sp, logout); // AgentHasMovedAway(sp, logout);
AgentHasMovedAway(sp, true); // AgentHasMovedAway(sp, true);
// 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);
// Now let's make it officially a child agent // Now let's make it officially a child agent
sp.MakeChildAgent(); sp.MakeChildAgent();

View File

@ -5652,7 +5652,7 @@ namespace OpenSim.Region.Framework.Scenes
public void parcelRegionCross() public void parcelRegionCross()
{ {
if (!ParcelHideThisAvatar || IsChildAgent || GodLevel >= 200) if (!ParcelHideThisAvatar || GodLevel >= 200)
return; return;
List<ScenePresence> allpresences = null; List<ScenePresence> allpresences = null;
@ -5846,6 +5846,15 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void HasMovedAway()
{
List<ScenePresence> allpresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allpresences)
SendKillTo(p);
if (Scene.AttachmentsModule != null)
Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
}
public void SendKillTo(ScenePresence p) public void SendKillTo(ScenePresence p)
{ {
foreach (SceneObjectGroup sog in m_attachments) foreach (SceneObjectGroup sog in m_attachments)