reduce the kills sent, hide attachments kills on origin

avinationmerge
UbitUmarov 2014-08-18 04:07:40 +01:00
parent f8e4805d98
commit 96de2a2fd2
2 changed files with 19 additions and 75 deletions

View File

@ -1782,10 +1782,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Unlike a teleport, here we do not wait for the destination region to confirm the receipt. // Unlike a teleport, here we do not wait for the destination region to confirm the receipt.
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp); m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);
AgentHasMovedAway(agent, false); AgentHasMovedAway(agent, true);
KillEntity(agent.Scene, agent.LocalId); agent.parcelRegionCross();
// agent.parcelRegionCross(false);
agent.MakeChildAgent(); agent.MakeChildAgent();

View File

@ -5503,8 +5503,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
if (p.GodLevel < 200) if (p.GodLevel < 200)
killsToSendto.Add(p); killsToSendto.Add(p);
if (GodLevel < 200 && p.ParcelHideThisAvatar) // if (GodLevel < 200 && p.ParcelHideThisAvatar)
killsToSendme.Add(p.LocalId); // killsToSendme.Add(p.LocalId);
} }
else else
{ {
@ -5567,89 +5567,34 @@ namespace OpenSim.Region.Framework.Scenes
*/ */
} }
public void parcelRegionCross(bool abort) public void parcelRegionCross()
{ {
// if (!ParcelHideThisAvatar) if (!ParcelHideThisAvatar || GodLevel >= 200)
// return; return;
List<ScenePresence> allpresences = null; List<ScenePresence> allpresences = null;
allpresences = m_scene.GetScenePresences(); allpresences = m_scene.GetScenePresences();
// abort no longer complet List<uint> killsToSendme = new List<uint>();
if (abort)
foreach (ScenePresence p in allpresences)
{ {
List<ScenePresence> viewsToSendme = new List<ScenePresence>(); if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
foreach (ScenePresence p in allpresences) if (p.currentParcelUUID == m_currentParcelUUID)
{ {
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) killsToSendme.Add(p.LocalId);
continue;
if (p.currentParcelUUID == m_currentParcelUUID)
{
viewsToSendme.Add(p);
}
}
if (viewsToSendme.Count > 0)
{
foreach (ScenePresence p in viewsToSendme)
{
if (p.IsChildAgent)
continue;
// m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient);
}
} }
} }
else
if (killsToSendme.Count > 0)
{ {
try
bool inprivate = ParcelHideThisAvatar && GodLevel < 200;
List<uint> killsToSendme = new List<uint>();
if (inprivate)
{ {
foreach (ScenePresence p in allpresences) ControllingClient.SendKillObject(killsToSendme);
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.currentParcelUUID == m_currentParcelUUID)
{
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
killsToSendme.Add(p.LocalId);
}
}
} }
/* catch (NullReferenceException) { }
else
{
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
killsToSendme.Add(p.LocalId);
}
}
*/
if (killsToSendme.Count > 0)
{
try
{
ControllingClient.SendKillObject(killsToSendme);
}
catch (NullReferenceException) { }
}
if (Scene.AttachmentsModule != null)
Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true);
} }
} }