Merge branch 'ubitworkmaster'

This commit is contained in:
Melanie Thielker
2014-08-04 02:23:43 +02:00
8 changed files with 349 additions and 72 deletions

View File

@@ -388,23 +388,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
Dictionary<SceneObjectGroup, string> scriptStates = new Dictionary<SceneObjectGroup, string>();
foreach (SceneObjectGroup so in attachments)
{
// Scripts MUST be snapshotted before the object is
// removed from the scene because doing otherwise will
// clobber the run flag
// This must be done outside the sp.AttachmentSyncLock so that there is no risk of a deadlock from
// scripts performing attachment operations at the same time. Getting object states stops the scripts.
scriptStates[so] = PrepareScriptInstanceForSave(so, false);
}
lock (sp.AttachmentsSyncLock)
if (sp.PresenceType != PresenceType.Npc)
{
foreach (SceneObjectGroup so in attachments)
UpdateDetachedObject(sp, so, scriptStates[so]);
sp.ClearAttachments();
{
// Scripts MUST be snapshotted before the object is
// removed from the scene because doing otherwise will
// clobber the run flag
// This must be done outside the sp.AttachmentSyncLock so that there is no risk of a deadlock from
// scripts performing attachment operations at the same time. Getting object states stops the scripts.
scriptStates[so] = PrepareScriptInstanceForSave(so, false);
}
lock (sp.AttachmentsSyncLock)
{
foreach (SceneObjectGroup so in attachments)
UpdateDetachedObject(sp, so, scriptStates[so]);
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)
@@ -1014,6 +1025,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// Remove the object from the scene so no more updates
// are sent. Doing this before the below changes will ensure
// updates can't cause "HUD artefacts"
m_scene.DeleteSceneObject(so, false, false);
// Prepare sog for storage

View File

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

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