Merge branch 'ubitworkmaster'

avinationmerge
Melanie Thielker 2014-08-04 02:23:43 +02:00
commit 2ab0790aa8
8 changed files with 349 additions and 72 deletions

View File

@ -358,7 +358,7 @@ namespace OpenSim.Region.ClientStack.Linden
return queue.Count > 0; return queue.Count > 0;
} }
m_log.WarnFormat("POLLED FOR EVENTS BY {0} unknown agent", agentID); //m_log.WarnFormat("POLLED FOR EVENTS BY {0} unknown agent", agentID);
return true; return true;
} }

View File

@ -388,6 +388,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
Dictionary<SceneObjectGroup, string> scriptStates = new Dictionary<SceneObjectGroup, string>(); Dictionary<SceneObjectGroup, string> scriptStates = new Dictionary<SceneObjectGroup, string>();
if (sp.PresenceType != PresenceType.Npc)
{
foreach (SceneObjectGroup so in attachments) foreach (SceneObjectGroup so in attachments)
{ {
// Scripts MUST be snapshotted before the object is // Scripts MUST be snapshotted before the object is
@ -402,10 +404,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
{ {
foreach (SceneObjectGroup so in attachments) foreach (SceneObjectGroup so in attachments)
UpdateDetachedObject(sp, so, scriptStates[so]); UpdateDetachedObject(sp, so, scriptStates[so]);
sp.ClearAttachments(); sp.ClearAttachments();
} }
} }
else
{
lock (sp.AttachmentsSyncLock)
{
foreach (SceneObjectGroup so in attachments)
UpdateDetachedObject(sp, so, String.Empty);
sp.ClearAttachments();
}
}
}
public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent)
{ {
@ -1014,6 +1025,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// Remove the object from the scene so no more updates // Remove the object from the scene so no more updates
// are sent. Doing this before the below changes will ensure // are sent. Doing this before the below changes will ensure
// updates can't cause "HUD artefacts" // updates can't cause "HUD artefacts"
m_scene.DeleteSceneObject(so, false, false); m_scene.DeleteSceneObject(so, false, false);
// Prepare sog for storage // Prepare sog for storage

View File

@ -236,12 +236,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
fromName = avatar.Name; fromName = avatar.Name;
fromID = c.Sender.AgentId; fromID = c.Sender.AgentId;
if (avatar.GodLevel >= 200) if (avatar.GodLevel >= 200)
{ { // let gods speak to outside or things may get confusing
fromNamePrefix = m_adminPrefix; fromNamePrefix = m_adminPrefix;
checkParcelHide = false;
}
else
{
checkParcelHide = true;
} }
destination = UUID.Zero; // Avatars cant "SayTo" destination = UUID.Zero; // Avatars cant "SayTo"
ownerID = c.Sender.AgentId; ownerID = c.Sender.AgentId;
checkParcelHide = true;
hidePos = fromPos; hidePos = fromPos;
break; break;
@ -305,7 +310,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
// objects on a parcel with access restrictions // objects on a parcel with access restrictions
if (checkParcelHide) if (checkParcelHide)
{ {
if (sourceParcelID != Presencecheck.LandData.GlobalID) if (sourceParcelID != Presencecheck.LandData.GlobalID && presence.GodLevel < 200)
return; return;
} }
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)

View File

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

View File

@ -617,6 +617,7 @@ namespace OpenSim.Region.CoreModules.World.Land
avatar.Invulnerable = true; avatar.Invulnerable = true;
SendLandUpdateToClient(snap_selection, avatar.ControllingClient); SendLandUpdateToClient(snap_selection, avatar.ControllingClient);
avatar.currentParcelUUID = LandData.GlobalID;
} }
} }
}); });

View File

@ -1366,7 +1366,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
try try
{ {
// m_log.ErrorFormat("[EVENT MANAGER]: OnRemovePresenceDelegate: {0}",d.Target.ToString());
d(agentId); d(agentId);
// m_log.ErrorFormat("[EVENT MANAGER]: OnRemovePresenceDelegate done ");
} }
catch (Exception e) catch (Exception e)
{ {
@ -2037,7 +2039,10 @@ namespace OpenSim.Region.Framework.Scenes
{ {
try try
{ {
// m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed: {0}", d.Target.ToString());
d(ClientID, scene); d(ClientID, scene);
// m_log.ErrorFormat("[EVENT MANAGER]: TriggerClientClosed done ");
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -3640,13 +3640,17 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_eventManager.TriggerClientClosed(agentID, this); m_eventManager.TriggerClientClosed(agentID, this);
// m_log.Debug("[Scene]TriggerClientClosed done");
m_eventManager.TriggerOnRemovePresence(agentID); m_eventManager.TriggerOnRemovePresence(agentID);
// m_log.Debug("[Scene]TriggerOnRemovePresence done");
if (!isChildAgent) if (!isChildAgent)
{ {
if (AttachmentsModule != null) if (AttachmentsModule != null)
{ {
// m_log.Debug("[Scene]DeRezAttachments");
AttachmentsModule.DeRezAttachments(avatar); AttachmentsModule.DeRezAttachments(avatar);
// m_log.Debug("[Scene]DeRezAttachments done");
} }
ForEachClient( ForEachClient(
@ -3660,7 +3664,10 @@ namespace OpenSim.Region.Framework.Scenes
// It's possible for child agents to have transactions if changes are being made cross-border. // It's possible for child agents to have transactions if changes are being made cross-border.
if (AgentTransactionsModule != null) if (AgentTransactionsModule != null)
{
// m_log.Debug("[Scene]RemoveAgentAssetTransactions");
AgentTransactionsModule.RemoveAgentAssetTransactions(agentID); AgentTransactionsModule.RemoveAgentAssetTransactions(agentID);
}
m_log.Debug("[Scene] The avatar has left the building"); m_log.Debug("[Scene] The avatar has left the building");
} }
catch (Exception e) catch (Exception e)

View File

@ -164,12 +164,12 @@ namespace OpenSim.Region.Framework.Scenes
lock (parcelLock) lock (parcelLock)
{ {
bool oldhide = m_currentParcelHide; bool oldhide = m_currentParcelHide;
bool check = true; bool checksame = true;
if (value != m_currentParcelUUID) if (value != m_currentParcelUUID)
{ {
m_previusParcelHide = m_currentParcelHide; m_previusParcelHide = m_currentParcelHide;
m_previusParcelUUID = m_currentParcelUUID; m_previusParcelUUID = m_currentParcelUUID;
check = false; checksame = false;
} }
m_currentParcelUUID = value; m_currentParcelUUID = value;
m_currentParcelHide = false; m_currentParcelHide = false;
@ -177,8 +177,9 @@ namespace OpenSim.Region.Framework.Scenes
ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y);
if (land != null && !land.LandData.SeeAVs) if (land != null && !land.LandData.SeeAVs)
m_currentParcelHide = true; m_currentParcelHide = true;
if (m_previusParcelUUID != UUID.Zero)
ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,check); if (m_previusParcelUUID != UUID.Zero || checksame)
ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,checksame);
} }
} }
} }
@ -1835,42 +1836,32 @@ namespace OpenSim.Region.Framework.Scenes
m_currentParcelUUID = UUID.Zero; m_currentParcelUUID = UUID.Zero;
// send initial land overlay and parcel // send initial land overlay and parcel
if (!IsChildAgent)
{
ILandChannel landch = m_scene.LandChannel; ILandChannel landch = m_scene.LandChannel;
if (landch != null) if (landch != null)
{ {
landch.sendClientInitialLandInfo(client); landch.sendClientInitialLandInfo(client);
if (!IsChildAgent)
{
newhide = m_currentParcelHide; newhide = m_currentParcelHide;
m_currentParcelHide = false; m_currentParcelHide = false;
} }
} }
// send agentData to all clients including us (?) // send agentData to all clients including us (?)
// get appearance // get appearance
// if in cache sent it to all clients // if in cache sent it to all clients
// send what we have to us, even if not in cache ( bad? ) // send what we have to us, even if not in cache ( bad? )
ValidateAndSendAppearanceAndAgentData(); ValidateAndSendAppearanceAndAgentData();
// Create child agents in neighbouring regions
if (openChildAgents && !IsChildAgent)
{
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
if (m_agentTransfer != null)
m_agentTransfer.EnableChildAgents(this);
}
// attachments // attachments
if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0) if (isNPC || (TeleportFlags & TeleportFlags.ViaLogin) != 0)
{ {
if (Scene.AttachmentsModule != null) if (Scene.AttachmentsModule != null)
Util.FireAndForget( // Util.FireAndForget(
o => // o =>
{ // {
Scene.AttachmentsModule.RezAttachments(this); Scene.AttachmentsModule.RezAttachments(this);
}); // });
} }
else else
{ {
@ -1894,6 +1885,14 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", // "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms",
// client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); // client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds);
// Create child agents in neighbouring regions
if (openChildAgents && !IsChildAgent)
{
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
if (m_agentTransfer != null)
m_agentTransfer.EnableChildAgents(this);
}
// send the rest of the world // send the rest of the world
if (m_teleportFlags > 0 && !isNPC) if (m_teleportFlags > 0 && !isNPC)
SendInitialDataToMe(); SendInitialDataToMe();
@ -1923,8 +1922,10 @@ namespace OpenSim.Region.Framework.Scenes
} }
// if hide force a check // if hide force a check
if (!IsChildAgent && newhide) if (!IsChildAgent && newhide)
ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, {
true, m_previusParcelHide, false, true); ParcelLoginCheck(m_currentParcelUUID);
m_currentParcelHide = newhide;
}
} }
/// <summary> /// <summary>
@ -3377,7 +3378,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!remoteClient.IsActive) if (!remoteClient.IsActive)
return; return;
if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID) if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && p.GodLevel < 200)
return; return;
@ -3464,6 +3465,14 @@ namespace OpenSim.Region.Framework.Scenes
// we created a new ScenePresence (a new child agent) in a fresh region. // we created a new ScenePresence (a new child agent) in a fresh region.
// Request info about all the (root) agents in this region // Request info about all the (root) agents in this region
// Note: This won't send data *to* other clients in that region (children don't send) // Note: This won't send data *to* other clients in that region (children don't send)
if (m_teleportFlags <= 0)
{
ILandChannel landch = m_scene.LandChannel;
if (landch != null)
{
landch.sendClientInitialLandInfo(ControllingClient);
}
}
SendOtherAgentsAvatarDataToMe(); SendOtherAgentsAvatarDataToMe();
SendOtherAgentsAppearanceToMe(); SendOtherAgentsAppearanceToMe();
@ -3586,7 +3595,7 @@ namespace OpenSim.Region.Framework.Scenes
public void SendAvatarDataToAgent(ScenePresence avatar) public void SendAvatarDataToAgent(ScenePresence avatar)
{ {
//m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID);
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID) if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200)
return; return;
avatar.ControllingClient.SendAvatarDataImmediate(this); avatar.ControllingClient.SendAvatarDataImmediate(this);
Animator.SendAnimPackToClient(avatar.ControllingClient); Animator.SendAnimPackToClient(avatar.ControllingClient);
@ -3653,7 +3662,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID) if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200)
return; return;
avatar.ControllingClient.SendAppearance( avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
@ -3866,14 +3875,21 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
protected bool CrossToNewRegion() protected bool CrossToNewRegion()
{ {
bool result = false;
parcelRegionCross(false);
try try
{ {
return m_scene.CrossAgentToNewRegion(this, Flying); result = m_scene.CrossAgentToNewRegion(this, Flying);
} }
catch catch
{ {
return m_scene.CrossAgentToNewRegion(this, false); result = m_scene.CrossAgentToNewRegion(this, false);
} }
if(!result)
parcelRegionCross(true);
return result;
} }
public void Reset() public void Reset()
@ -3947,6 +3963,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus) public void GrantGodlikePowers(UUID agentID, UUID sessionID, UUID token, bool godStatus)
{ {
int oldgodlevel = GodLevel;
if (godStatus) if (godStatus)
{ {
// For now, assign god level 200 to anyone // For now, assign god level 200 to anyone
@ -3967,6 +3985,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
ControllingClient.SendAdminResponse(token, (uint)GodLevel); ControllingClient.SendAdminResponse(token, (uint)GodLevel);
if(oldgodlevel != GodLevel)
parcelGodCheck(m_currentParcelUUID, GodLevel >= 200);
} }
#region Child Agent Updates #region Child Agent Updates
@ -5377,7 +5398,221 @@ namespace OpenSim.Region.Framework.Scenes
} }
private void ParcelCrossCheck(UUID currentParcelUUID,UUID previusParcelUUID, private void parcelGodCheck(UUID currentParcelID, 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 != currentParcelID)
{
viewsToSendme.Add(p); // i see them
}
}
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
{
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 != currentParcelID)
{
killsToSendme.Add(p);
}
}
if (killsToSendme.Count > 0)
{
foreach (ScenePresence p in killsToSendme)
{
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
catch (NullReferenceException) { }
}
}
}
}
private void ParcelLoginCheck(UUID currentParcelID)
{
List<ScenePresence> killsToSendto = new List<ScenePresence>();
List<ScenePresence> killsToSendme = new List<ScenePresence>();
List<ScenePresence> viewsToSendto = new List<ScenePresence>();
List<ScenePresence> viewsToSendme = new List<ScenePresence>();
List<ScenePresence> allpresences = null;
allpresences = m_scene.GetScenePresences();
foreach (ScenePresence p in allpresences)
{
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue;
if (currentParcelID != p.currentParcelUUID)
{
if (p.GodLevel < 200)
killsToSendto.Add(p);
if (GodLevel < 200 && p.ParcelHideThisAvatar)
killsToSendme.Add(p);
}
else
{
viewsToSendto.Add(p);
viewsToSendme.Add(p);
}
}
allpresences.Clear();
// send the things
// kill main avatar object
if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
{
foreach (ScenePresence p in killsToSendto)
{
m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
catch (NullReferenceException) { }
}
}
if (killsToSendme.Count > 0)
{
foreach (ScenePresence p in killsToSendme)
{
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
catch (NullReferenceException) { }
}
}
if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
{
foreach (ScenePresence p in viewsToSendto)
{
m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
p.ControllingClient.SendAvatarDataImmediate(this);
SendAppearanceToAgent(p);
SendAttachmentsToClient(p.ControllingClient);
if (Animator != null)
Animator.SendAnimPackToClient(p.ControllingClient);
}
}
if (viewsToSendme.Count > 0)
{
foreach (ScenePresence p in viewsToSendme)
{
m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
if (p.IsChildAgent)
continue;
ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient);
if (p.Animator != null)
p.Animator.SendAnimPackToClient(ControllingClient);
}
}
}
private void parcelRegionCross(bool abort)
{
if (!ParcelHideThisAvatar)
return;
List<ScenePresence> allpresences = null;
allpresences = m_scene.GetScenePresences();
if (abort)
{
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.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 (GodLevel >= 200)
return;
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.currentParcelUUID == m_currentParcelUUID)
{
killsToSendme.Add(p);
}
}
if (killsToSendme.Count > 0)
{
foreach (ScenePresence p in killsToSendme)
{
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
try { ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
catch (NullReferenceException) { }
}
}
}
}
private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID,
bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check)
{ {
List<ScenePresence> killsToSendto = new List<ScenePresence>(); List<ScenePresence> killsToSendto = new List<ScenePresence>();
@ -5391,6 +5626,7 @@ 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;
@ -5404,7 +5640,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) if (currentParcelID != p.currentParcelUUID)
{ {
viewsToSendto.Add(p); // they see me viewsToSendto.Add(p); // they see me
} }
@ -5419,14 +5655,13 @@ namespace OpenSim.Region.Framework.Scenes
continue; continue;
// those not on parcel dont see me // those not on parcel dont see me
if (currentParcelUUID != p.currentParcelUUID) if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200)
{ {
killsToSendto.Add(p); // they dont see me killsToSendto.Add(p); // they dont see me
} }
} }
} // where public end } // where public end
allpresences.Clear(); allpresences.Clear();
} }
else else
@ -5436,7 +5671,7 @@ namespace OpenSim.Region.Framework.Scenes
// now on a private parcel // now on a private parcel
allpresences = m_scene.GetScenePresences(); allpresences = m_scene.GetScenePresences();
if (previusParcelHide && previusParcelUUID != UUID.Zero) if (previusParcelHide && previusParcelID != UUID.Zero)
{ {
foreach (ScenePresence p in allpresences) foreach (ScenePresence p in allpresences)
{ {
@ -5444,13 +5679,15 @@ namespace OpenSim.Region.Framework.Scenes
continue; continue;
// only those on previus parcel need receive kills // only those on previus parcel need receive kills
if (previusParcelUUID == p.currentParcelUUID) if (previusParcelID == p.currentParcelUUID)
{ {
if(p.GodLevel < 200)
killsToSendto.Add(p); // they dont see me killsToSendto.Add(p); // they dont see me
if(GodLevel < 200)
killsToSendme.Add(p); // i dont see them killsToSendme.Add(p); // i dont see them
} }
// only those on new parcel need see // only those on new parcel need see
if (currentParcelUUID == p.currentParcelUUID) if (currentParcelID == p.currentParcelUUID)
{ {
viewsToSendto.Add(p); // they see me viewsToSendto.Add(p); // they see me
viewsToSendme.Add(p); // i see them viewsToSendme.Add(p); // i see them
@ -5468,7 +5705,7 @@ namespace OpenSim.Region.Framework.Scenes
continue; continue;
// those not on new parcel dont see me // those not on new parcel dont see me
if (currentParcelUUID != p.currentParcelUUID) if (currentParcelID != p.currentParcelUUID && p.GodLevel < 200)
{ {
killsToSendto.Add(p); // they dont see me killsToSendto.Add(p); // they dont see me
} }
@ -5484,7 +5721,7 @@ namespace OpenSim.Region.Framework.Scenes
else else
{ {
// now on public parcel // now on public parcel
if (previusParcelHide && previusParcelUUID != UUID.Zero) if (previusParcelHide && previusParcelID != UUID.Zero)
{ {
// was on private area // was on private area
allpresences = m_scene.GetScenePresences(); allpresences = m_scene.GetScenePresences();
@ -5494,7 +5731,7 @@ namespace OpenSim.Region.Framework.Scenes
if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive)
continue; continue;
// only those old parcel need receive kills // only those old parcel need receive kills
if (previusParcelUUID == p.currentParcelUUID) if (previusParcelID == p.currentParcelUUID && GodLevel < 200)
{ {
killsToSendme.Add(p); // i dont see them killsToSendme.Add(p); // i dont see them
} }
@ -5511,29 +5748,32 @@ namespace OpenSim.Region.Framework.Scenes
// send the things // send the things
// kill main avatar object // kill main avatar object
if (killsToSendto.Count > 0) if (killsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
{ {
foreach (ScenePresence p in killsToSendto) foreach (ScenePresence p in killsToSendto)
{ {
m_log.Debug("[AVATAR]: killTo: " + Lastname + " " + p.Lastname);
try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); } try { p.ControllingClient.SendKillObject(new List<uint> { LocalId }); }
catch (NullReferenceException) { } catch (NullReferenceException) { }
} }
} }
if (killsToSendme.Count > 0 && PresenceType != PresenceType.Npc) if (killsToSendme.Count > 0 )
{ {
foreach (ScenePresence p in killsToSendme) foreach (ScenePresence p in killsToSendme)
{ {
m_log.Debug("[AVATAR]: killMe: " + Lastname + " " + p.Lastname);
try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); } try {ControllingClient.SendKillObject(new List<uint> { p.LocalId }); }
catch (NullReferenceException) { } catch (NullReferenceException) { }
} }
} }
if (viewsToSendto.Count > 0) if (viewsToSendto.Count > 0 && PresenceType != PresenceType.Npc)
{ {
foreach (ScenePresence p in viewsToSendto) foreach (ScenePresence p in viewsToSendto)
{ {
p.ControllingClient.SendAvatarDataImmediate(this); p.ControllingClient.SendAvatarDataImmediate(this);
// m_log.Debug("[AVATAR]: viewTo: " + Lastname + " " + p.Lastname);
SendAppearanceToAgent(p); SendAppearanceToAgent(p);
SendAttachmentsToClient(p.ControllingClient); SendAttachmentsToClient(p.ControllingClient);
if (Animator != null) if (Animator != null)
@ -5541,10 +5781,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
if (viewsToSendme.Count > 0 && PresenceType != PresenceType.Npc) if (viewsToSendme.Count > 0 )
{ {
foreach (ScenePresence p in viewsToSendme) foreach (ScenePresence p in viewsToSendme)
{ {
if (p.IsChildAgent)
continue;
// m_log.Debug("[AVATAR]: viewMe: " + Lastname + "<-" + p.Lastname);
ControllingClient.SendAvatarDataImmediate(p); ControllingClient.SendAvatarDataImmediate(p);
p.SendAppearanceToAgent(this); p.SendAppearanceToAgent(this);
p.SendAttachmentsToClient(ControllingClient); p.SendAttachmentsToClient(ControllingClient);