testing...

avinationmerge
UbitUmarov 2014-08-02 23:38:18 +01:00
parent 009e8ee76c
commit addca0737c
1 changed files with 67 additions and 20 deletions

View File

@ -3970,9 +3970,8 @@ namespace OpenSim.Region.Framework.Scenes
ControllingClient.SendAdminResponse(token, (uint)GodLevel); ControllingClient.SendAdminResponse(token, (uint)GodLevel);
if(oldgodlevel != GodLevel) // force a visibility check if(oldgodlevel != GodLevel)
ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, parcelGodCheck(m_currentParcelUUID, GodLevel >= 200);
!m_currentParcelHide, m_previusParcelHide, m_currentParcelHide, true);
} }
#region Child Agent Updates #region Child Agent Updates
@ -5383,6 +5382,68 @@ namespace OpenSim.Region.Framework.Scenes
} }
private void parcelGodCheck(UUID currentParcelUUID, bool isGod)
{
List<ScenePresence> allpresences = null;
allpresences = m_scene.GetScenePresences();
if (isGod)
{
List<ScenePresence> viewsToSendme = new List<ScenePresence>();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID)
{
viewsToSendme.Add(p); // i see them
}
}
if (viewsToSendme.Count > 0)
{
foreach (ScenePresence p in viewsToSendme)
{
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient);
}
}
}
else
{
List<ScenePresence> killsToSendme = new List<ScenePresence>();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID)
{
killsToSendme.Add(p);
}
}
if (killsToSendme.Count > 0 && PresenceType != PresenceType.Npc)
{
foreach (ScenePresence p in killsToSendme)
{
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
catch (NullReferenceException) { }
}
}
}
}
private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID, private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID,
bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)
{ {
@ -5397,26 +5458,13 @@ namespace OpenSim.Region.Framework.Scenes
if (check) if (check)
{ {
// check is relative to current parcel only
if (currentParcelUUID == null || oldhide == currentParcelHide) if (currentParcelUUID == null || oldhide == currentParcelHide)
return; return;
allpresences = m_scene.GetScenePresences(); allpresences = m_scene.GetScenePresences();
if (GodLevel >= 200) if (oldhide)
{
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (p.ParcelHideThisAvatar)
{
viewsToSendto.Add(p); // they see me
}
}
}
else if (oldhide)
{ // where private { // where private
foreach (ScenePresence p in allpresences) foreach (ScenePresence p in allpresences)
{ {
@ -5424,7 +5472,7 @@ namespace OpenSim.Region.Framework.Scenes
continue; continue;
// those on not on parcel see me // those on not on parcel see me
if (currentParcelUUID != p.currentParcelUUID || p.GodLevel >= 200) if (currentParcelUUID != p.currentParcelUUID)
{ {
viewsToSendto.Add(p); // they see me viewsToSendto.Add(p); // they see me
} }
@ -5446,7 +5494,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} // where public end } // where public end
allpresences.Clear(); allpresences.Clear();
} }
else else