diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
4 files changed, 47 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 0825a01..2c7cd40 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -388,23 +388,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
388 | 388 | ||
389 | Dictionary<SceneObjectGroup, string> scriptStates = new Dictionary<SceneObjectGroup, string>(); | 389 | Dictionary<SceneObjectGroup, string> scriptStates = new Dictionary<SceneObjectGroup, string>(); |
390 | 390 | ||
391 | foreach (SceneObjectGroup so in attachments) | 391 | if (sp.PresenceType != PresenceType.Npc) |
392 | { | ||
393 | // Scripts MUST be snapshotted before the object is | ||
394 | // removed from the scene because doing otherwise will | ||
395 | // clobber the run flag | ||
396 | // This must be done outside the sp.AttachmentSyncLock so that there is no risk of a deadlock from | ||
397 | // scripts performing attachment operations at the same time. Getting object states stops the scripts. | ||
398 | scriptStates[so] = PrepareScriptInstanceForSave(so, false); | ||
399 | } | ||
400 | |||
401 | lock (sp.AttachmentsSyncLock) | ||
402 | { | 392 | { |
403 | foreach (SceneObjectGroup so in attachments) | 393 | foreach (SceneObjectGroup so in attachments) |
404 | UpdateDetachedObject(sp, so, scriptStates[so]); | 394 | { |
405 | 395 | // Scripts MUST be snapshotted before the object is | |
406 | sp.ClearAttachments(); | 396 | // removed from the scene because doing otherwise will |
397 | // clobber the run flag | ||
398 | // This must be done outside the sp.AttachmentSyncLock so that there is no risk of a deadlock from | ||
399 | // scripts performing attachment operations at the same time. Getting object states stops the scripts. | ||
400 | scriptStates[so] = PrepareScriptInstanceForSave(so, false); | ||
401 | } | ||
402 | |||
403 | lock (sp.AttachmentsSyncLock) | ||
404 | { | ||
405 | foreach (SceneObjectGroup so in attachments) | ||
406 | UpdateDetachedObject(sp, so, scriptStates[so]); | ||
407 | sp.ClearAttachments(); | ||
408 | } | ||
407 | } | 409 | } |
410 | else | ||
411 | { | ||
412 | lock (sp.AttachmentsSyncLock) | ||
413 | { | ||
414 | foreach (SceneObjectGroup so in attachments) | ||
415 | UpdateDetachedObject(sp, so, String.Empty); | ||
416 | sp.ClearAttachments(); | ||
417 | } | ||
418 | } | ||
408 | } | 419 | } |
409 | 420 | ||
410 | public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) | 421 | public void DeleteAttachmentsFromScene(IScenePresence sp, bool silent) |
@@ -1014,6 +1025,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1014 | // Remove the object from the scene so no more updates | 1025 | // Remove the object from the scene so no more updates |
1015 | // are sent. Doing this before the below changes will ensure | 1026 | // are sent. Doing this before the below changes will ensure |
1016 | // updates can't cause "HUD artefacts" | 1027 | // updates can't cause "HUD artefacts" |
1028 | |||
1017 | m_scene.DeleteSceneObject(so, false, false); | 1029 | m_scene.DeleteSceneObject(so, false, false); |
1018 | 1030 | ||
1019 | // Prepare sog for storage | 1031 | // Prepare sog for storage |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 9b41083..dcfc630 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -236,12 +236,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
236 | fromName = avatar.Name; | 236 | fromName = avatar.Name; |
237 | fromID = c.Sender.AgentId; | 237 | fromID = c.Sender.AgentId; |
238 | if (avatar.GodLevel >= 200) | 238 | if (avatar.GodLevel >= 200) |
239 | { | 239 | { // let gods speak to outside or things may get confusing |
240 | fromNamePrefix = m_adminPrefix; | 240 | fromNamePrefix = m_adminPrefix; |
241 | checkParcelHide = false; | ||
242 | } | ||
243 | else | ||
244 | { | ||
245 | checkParcelHide = true; | ||
241 | } | 246 | } |
242 | destination = UUID.Zero; // Avatars cant "SayTo" | 247 | destination = UUID.Zero; // Avatars cant "SayTo" |
243 | ownerID = c.Sender.AgentId; | 248 | ownerID = c.Sender.AgentId; |
244 | checkParcelHide = true; | 249 | |
245 | hidePos = fromPos; | 250 | hidePos = fromPos; |
246 | break; | 251 | break; |
247 | 252 | ||
@@ -305,7 +310,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
305 | // objects on a parcel with access restrictions | 310 | // objects on a parcel with access restrictions |
306 | if (checkParcelHide) | 311 | if (checkParcelHide) |
307 | { | 312 | { |
308 | if (sourceParcelID != Presencecheck.LandData.GlobalID) | 313 | if (sourceParcelID != Presencecheck.LandData.GlobalID && presence.GodLevel < 200) |
309 | return; | 314 | return; |
310 | } | 315 | } |
311 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) | 316 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index d8e3082..c8555ab 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -368,7 +368,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
368 | public void SendOutNearestBanLine(IClientAPI client) | 368 | public void SendOutNearestBanLine(IClientAPI client) |
369 | { | 369 | { |
370 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 370 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
371 | if (sp == null || sp.IsChildAgent) | 371 | if (sp == null) |
372 | return; | 372 | return; |
373 | 373 | ||
374 | List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition); | 374 | List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition); |
@@ -394,11 +394,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
394 | 394 | ||
395 | if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar)) | 395 | if (!m_scene.TryGetScenePresence(remoteClient.AgentId, out avatar)) |
396 | return; | 396 | return; |
397 | if (avatar.IsChildAgent) | ||
398 | return; | ||
399 | 397 | ||
400 | SendParcelOverlay(remoteClient); | 398 | SendParcelOverlay(remoteClient); |
401 | 399 | ||
400 | if (avatar.IsChildAgent) | ||
401 | return; | ||
402 | |||
402 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y); | 403 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X,avatar.AbsolutePosition.Y); |
403 | if (over == null) | 404 | if (over == null) |
404 | return; | 405 | return; |
@@ -958,7 +959,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
958 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); | 959 | UpdateLandObject(startLandObject.LandData.LocalID, startLandObject.LandData); |
959 | m_scene.ForEachClient(SendParcelOverlay); | 960 | m_scene.ForEachClient(SendParcelOverlay); |
960 | result.SendLandUpdateToAvatarsOverMe(); | 961 | result.SendLandUpdateToAvatarsOverMe(); |
961 | 962 | startLandObject.SendLandUpdateToAvatarsOverMe(); | |
962 | } | 963 | } |
963 | 964 | ||
964 | /// <summary> | 965 | /// <summary> |
@@ -1047,7 +1048,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1047 | /// <param name="remote_client">The object representing the client</param> | 1048 | /// <param name="remote_client">The object representing the client</param> |
1048 | public void SendParcelOverlay(IClientAPI remote_client) | 1049 | public void SendParcelOverlay(IClientAPI remote_client) |
1049 | { | 1050 | { |
1050 | |||
1051 | if (remote_client.SceneAgent.PresenceType == PresenceType.Npc) | 1051 | if (remote_client.SceneAgent.PresenceType == PresenceType.Npc) |
1052 | return; | 1052 | return; |
1053 | 1053 | ||
@@ -1198,20 +1198,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1198 | bool needOverlay = false; | 1198 | bool needOverlay = false; |
1199 | if (land.UpdateLandProperties(args, remote_client, out snap_selection, out needOverlay)) | 1199 | if (land.UpdateLandProperties(args, remote_client, out snap_selection, out needOverlay)) |
1200 | { | 1200 | { |
1201 | //the proprieties to who changed it | 1201 | //the proprieties to who changed them |
1202 | 1202 | ||
1203 | land.SendLandProperties(0, true, LandChannel.LAND_RESULT_SINGLE, remote_client); | 1203 | land.SendLandProperties(0, true, LandChannel.LAND_RESULT_SINGLE, remote_client); |
1204 | 1204 | ||
1205 | if (needOverlay) | 1205 | if (needOverlay) |
1206 | { | 1206 | { |
1207 | UUID parcelID = land.LandData.GlobalID; | 1207 | UUID parcelID = land.LandData.GlobalID; |
1208 | m_scene.ForEachRootScenePresence(delegate(ScenePresence avatar) | 1208 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1209 | { | 1209 | { |
1210 | if (avatar.IsDeleted || avatar.IsChildAgent) | 1210 | if (avatar.IsDeleted || avatar.isNPC) |
1211 | return; | 1211 | return; |
1212 | 1212 | ||
1213 | IClientAPI client = avatar.ControllingClient; | 1213 | IClientAPI client = avatar.ControllingClient; |
1214 | SendParcelOverlay(client); | 1214 | SendParcelOverlay(client); |
1215 | |||
1216 | if (avatar.IsChildAgent) | ||
1217 | return; | ||
1218 | |||
1215 | ILandObject aland = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 1219 | ILandObject aland = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
1216 | if (aland != null) | 1220 | if (aland != null) |
1217 | { | 1221 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 29c2234..e002feb 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -617,6 +617,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
617 | avatar.Invulnerable = true; | 617 | avatar.Invulnerable = true; |
618 | 618 | ||
619 | SendLandUpdateToClient(snap_selection, avatar.ControllingClient); | 619 | SendLandUpdateToClient(snap_selection, avatar.ControllingClient); |
620 | avatar.currentParcelUUID = LandData.GlobalID; | ||
620 | } | 621 | } |
621 | } | 622 | } |
622 | }); | 623 | }); |