mess update ( hide avatars )

avinationmerge
UbitUmarov 2014-08-03 22:38:50 +01:00
parent 21aa325883
commit 0d71a2bb8f
2 changed files with 47 additions and 33 deletions

View File

@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public void SendOutNearestBanLine(IClientAPI client)
{
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
if (sp == null || sp.IsChildAgent)
if (sp == null)
return;
List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition);
@ -394,11 +394,12 @@ namespace OpenSim.Region.CoreModules.World.Land
if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar))
return;
if (avatar.IsChildAgent)
return;
SendParcelOverlay(remoteClient);
if (avatar.IsChildAgent)
return;
ILandObject over = GetLandObject(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y);
if (over == null)
return;
@ -958,7 +959,7 @@ namespace OpenSim.Region.CoreModules.World.Land
UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData);
m_scene.ForEachClient(SendParcelOverlay);
result.SendLandUpdateToAvatarsOverMe();
startLandObject.SendLandUpdateToAvatarsOverMe();
}
/// <summary>
@ -1047,7 +1048,6 @@ namespace OpenSim.Region.CoreModules.World.Land
/// <param name="remote_client">The object representing the client</param>
public void SendParcelOverlay(IClientAPI remote_client)
{
if (remote_client.SceneAgent.PresenceType == PresenceType.Npc)
return;
@ -1198,20 +1198,24 @@ namespace OpenSim.Region.CoreModules.World.Land
bool needOverlay = false;
if (land.UpdateLandProperties(args, remote_client, out snap_selection, out needOverlay))
{
//the proprieties to who changed it
//the proprieties to who changed them
land.SendLandProperties(0, true, LandChannel.LAND_RESULT_SINGLE, remote_client);
if (needOverlay)
{
UUID parcelID = land.LandData.GlobalID;
m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar)
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
if (avatar.IsDeleted || avatar.IsChildAgent)
if (avatar.IsDeleted || avatar.isNPC)
return;
IClientAPI client = avatar.ControllingClient;
SendParcelOverlay(client);
if (avatar.IsChildAgent)
return;
ILandObject aland = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
if (aland != null)
{

View File

@ -178,7 +178,7 @@ namespace OpenSim.Region.Framework.Scenes
if (land != null && !land.LandData.SeeAVs)
m_currentParcelHide = true;
if (m_previusParcelUUID != UUID.Zero)
if (m_previusParcelUUID != UUID.Zero || checksame)
ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,checksame);
}
}
@ -1847,7 +1847,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
// send agentData to all clients including us (?)
// get appearance
// if in cache sent it to all clients
@ -1857,7 +1856,7 @@ namespace OpenSim.Region.Framework.Scenes
// attachments
if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
{
// if (Scene.AttachmentsModule != null)
if (Scene.AttachmentsModule != null)
// Util.FireAndForget(
// o =>
// {
@ -5418,6 +5417,8 @@ namespace OpenSim.Region.Framework.Scenes
foreach (ScenePresence p in viewsToSendme)
{
m_log.Debug("[AVATAR]: viewMe: " + Lastname + " " + p.Lastname);
if (!p.IsChildAgent)
{
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
@ -5426,6 +5427,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
else
{
List<ScenePresence> killsToSendme = new List<ScenePresence>();
@ -5524,6 +5526,8 @@ namespace OpenSim.Region.Framework.Scenes
foreach (ScenePresence p in viewsToSendme)
{
m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
if (!p.IsChildAgent)
{
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
@ -5532,6 +5536,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
private void parcelRegionCross(bool abort)
{
@ -5562,6 +5567,8 @@ namespace OpenSim.Region.Framework.Scenes
foreach (ScenePresence p in viewsToSendme)
{
m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
if (!p.IsChildAgent)
{
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
@ -5570,6 +5577,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
else
{
if (GodLevel >= 200)
@ -5630,7 +5638,6 @@ namespace OpenSim.Region.Framework.Scenes
// those on not on parcel see me
if (currentParcelID != p.currentParcelUUID)
{
m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
viewsToSendto.Add(p); // they see me
}
}
@ -5775,6 +5782,8 @@ namespace OpenSim.Region.Framework.Scenes
foreach (ScenePresence p in viewsToSendme)
{
m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
if (!p.IsChildAgent)
{
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
@ -5784,4 +5793,5 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
}