From a61a41ad921643813d00014570edd3d357abc333 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 01:22:36 +0000 Subject: Send GodLevel to viewers on login --- OpenSim/Region/Framework/Scenes/GodController.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 5763e03..d45f560 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -131,7 +131,7 @@ namespace OpenSim.Region.Framework.Scenes return canBeGod; } - protected void SyncViewerState() + public void SyncViewerState() { bool canBeGod = CanBeGod(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 339f1b1..38e46e7 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2015,6 +2015,8 @@ namespace OpenSim.Region.Framework.Scenes if (!WaitForUpdateAgent(client)) // The sending region never sent the UpdateAgent data, we have to refuse return; + + GodController.SyncViewerState(); } m_log.DebugFormat("[CompleteMovement] WaitForUpdateAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); -- cgit v1.1 From 9b93068054458e6b1bcbef9401dea56a01e611c0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 01:27:30 +0000 Subject: Sync viewer on make root --- OpenSim/Region/Framework/Scenes/GodController.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index d45f560..abdbe51 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -141,7 +141,7 @@ namespace OpenSim.Region.Framework.Scenes if (!shoudBeGod) godLevel = 0; - if (m_viewerUiIsGod != shoudBeGod) + if (m_viewerUiIsGod != shoudBeGod && (!m_scenePresence.IsChildAgent)) { m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); m_viewerUiIsGod = shoudBeGod; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 38e46e7..28b2f52 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1290,6 +1290,7 @@ namespace OpenSim.Region.Framework.Scenes } IsChildAgent = false; + GodController.SyncViewerState(); } m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); -- cgit v1.1 From 1b64a45f665546f053a7c47f7b751783baa46d51 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Jan 2017 01:38:13 +0000 Subject: take sync viewer out on make root --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 28b2f52..36d0e40 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1290,7 +1290,7 @@ namespace OpenSim.Region.Framework.Scenes } IsChildAgent = false; - GodController.SyncViewerState(); + } m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -2122,6 +2122,7 @@ namespace OpenSim.Region.Framework.Scenes } if(!IsChildAgent && !isNPC) + GodController.SyncViewerState(); // start sending terrain patchs if (!gotCrossUpdate && !isNPC) -- cgit v1.1 From ad531ecb5388e2dc0efa321d9497f451633bef40 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 01:52:42 +0000 Subject: Handle the case where grid gods and local gods should coexit Thou shalt have no other gods beside me, your one and true god. --- OpenSim/Region/Framework/Scenes/GodController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index abdbe51..95fdc02 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -50,6 +50,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence m_scenePresence; Scene m_scene; protected bool m_allowGridGods; + protected bool m_forceGridGods; protected bool m_regionOwnerIsGod; protected bool m_regionManagerIsGod; protected bool m_parcelOwnerIsGod; @@ -76,6 +77,11 @@ namespace OpenSim.Region.Framework.Scenes Util.GetConfigVarFromSections(config, "allow_grid_gods", sections, false); + // If grid gods are active, dont allow any other gods + m_forceGridGods = + Util.GetConfigVarFromSections(config, + "force_grid_gods", sections, false); + // The owner of a region is a god in his region only. m_regionOwnerIsGod = Util.GetConfigVarFromSections(config, @@ -138,6 +144,9 @@ namespace OpenSim.Region.Framework.Scenes bool shoudBeGod = m_forceGodModeAlwaysOn ? canBeGod : (m_viewerUiIsGod && canBeGod); int godLevel = m_allowGridGods ? m_userLevel : 200; + if ((!m_forceGridGods) && m_userLevel < 200) + godLevel = 200; + if (!shoudBeGod) godLevel = 0; -- cgit v1.1 From 8eb7c9d0fbd0804c186a086c531dd88fd23ba0b5 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 02:14:56 +0000 Subject: Fix the mixed gods issue in all places --- OpenSim/Region/Framework/Scenes/GodController.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 95fdc02..5146ea0 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -113,6 +113,15 @@ namespace OpenSim.Region.Framework.Scenes } + protected int PotentialGodLevel() + { + int godLevel = m_allowGridGods ? m_userLevel : 200; + if ((!m_forceGridGods) && m_userLevel < 200) + godLevel = 200; + + return godLevel; + } + protected bool CanBeGod() { bool canBeGod = false; @@ -143,9 +152,7 @@ namespace OpenSim.Region.Framework.Scenes bool shoudBeGod = m_forceGodModeAlwaysOn ? canBeGod : (m_viewerUiIsGod && canBeGod); - int godLevel = m_allowGridGods ? m_userLevel : 200; - if ((!m_forceGridGods) && m_userLevel < 200) - godLevel = 200; + int godLevel = PotentialGodLevel(); if (!shoudBeGod) godLevel = 0; @@ -172,7 +179,7 @@ namespace OpenSim.Region.Framework.Scenes if (!CanBeGod()) return false; - int godLevel = m_allowGridGods ? m_userLevel : 200; + int godLevel = PotentialGodLevel(); if (!m_viewerUiIsGod) m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); @@ -211,7 +218,7 @@ namespace OpenSim.Region.Framework.Scenes { get { - int godLevel = m_allowGridGods ? m_userLevel : 200; + int godLevel = PotentialGodLevel(); if (!m_viewerUiIsGod) godLevel = 0; @@ -223,7 +230,7 @@ namespace OpenSim.Region.Framework.Scenes { get { - int godLevel = m_allowGridGods ? m_userLevel : 200; + int godLevel = PotentialGodLevel(); if (m_viewerUiIsGod) return godLevel; -- cgit v1.1 From 7ac74fcf73fc4a303d71a75b2c57bf86a8792e54 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Jan 2017 03:07:17 +0000 Subject: fix typo --- OpenSim/Region/Framework/Scenes/GodController.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 5146ea0..7672062 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -124,26 +124,24 @@ namespace OpenSim.Region.Framework.Scenes protected bool CanBeGod() { - bool canBeGod = false; - if (m_allowGridGods && m_userLevel > 0) - canBeGod = true; + return true; if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID)) - canBeGod = true; + return true; if (m_regionManagerIsGod && m_scene.Permissions.IsEstateManager(m_scenePresence.UUID)) - canBeGod = true; + return true; - if (!canBeGod && m_parcelOwnerIsGod) // Skip expensive check if we're already god! + if (m_parcelOwnerIsGod) // Skip expensive check if we're already god! { Vector3 pos = m_scenePresence.AbsolutePosition; ILandObject parcel = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); if (parcel != null && parcel.LandData.OwnerID == m_scenePresence.UUID) - canBeGod = true; + return true; } - return canBeGod; + return false; } public void SyncViewerState() @@ -211,7 +209,7 @@ namespace OpenSim.Region.Framework.Scenes public int UserLevel { get { return m_userLevel; } - set { m_userLevel = UserLevel; } + set { m_userLevel = value; } } public int GodLevel -- cgit v1.1 From e5a3d85bc7618a023222a8120984999158a8bd43 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Jan 2017 03:45:47 +0000 Subject: fix/simplify validation of god_data update field --- OpenSim/Region/Framework/Scenes/GodController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 7672062..f51e8c9 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -198,12 +198,13 @@ namespace OpenSim.Region.Framework.Scenes public void SetState(OSD state) { + if(state == null) + return; + OSDMap s = (OSDMap)state; if (s.ContainsKey("ViewerUiIsGod")) m_viewerUiIsGod = s["ViewerUiIsGod"].AsBoolean(); - - SyncViewerState(); } public int UserLevel -- cgit v1.1 From c7079555174bf34fc7df9622a3601f8a305cd2b7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Jan 2017 10:28:10 +0000 Subject: restore parcels avatars visibility god level change correct handling; try to reduced the increased change of user error on config options setting --- OpenSim/Region/Framework/Scenes/GodController.cs | 44 +++++++++++++----------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 +++-- 2 files changed, 28 insertions(+), 24 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index f51e8c9..f8b576c 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence m_scenePresence; Scene m_scene; protected bool m_allowGridGods; - protected bool m_forceGridGods; + protected bool m_forceGridGodsOnly; protected bool m_regionOwnerIsGod; protected bool m_regionManagerIsGod; protected bool m_parcelOwnerIsGod; @@ -78,25 +78,30 @@ namespace OpenSim.Region.Framework.Scenes "allow_grid_gods", sections, false); // If grid gods are active, dont allow any other gods - m_forceGridGods = + m_forceGridGodsOnly = Util.GetConfigVarFromSections(config, - "force_grid_gods", sections, false); + "force_grid_gods_only", sections, false); - // The owner of a region is a god in his region only. - m_regionOwnerIsGod = + if(!m_forceGridGodsOnly) // damm redundant and error prone option + { + // The owner of a region is a god in his region only. + m_regionOwnerIsGod = Util.GetConfigVarFromSections(config, "region_owner_is_god", sections, true); - // Region managers are gods in the regions they manage. - m_regionManagerIsGod = + // Region managers are gods in the regions they manage. + m_regionManagerIsGod = Util.GetConfigVarFromSections(config, "region_manager_is_god", sections, false); - // Parcel owners are gods in their own parcels only. - m_parcelOwnerIsGod = + // Parcel owners are gods in their own parcels only. + m_parcelOwnerIsGod = Util.GetConfigVarFromSections(config, "parcel_owner_is_god", sections, false); - + } + else + m_allowGridGods = true; // reduce user mistakes increased by this over complex options set + // God mode should be turned on in the viewer whenever // the user has god rights somewhere. They may choose // to turn it off again, though. @@ -110,13 +115,12 @@ namespace OpenSim.Region.Framework.Scenes m_allowGodActionsWithoutGodMode = Util.GetConfigVarFromSections(config, "implicit_gods", sections, false); - } protected int PotentialGodLevel() { int godLevel = m_allowGridGods ? m_userLevel : 200; - if ((!m_forceGridGods) && m_userLevel < 200) + if ((!m_forceGridGodsOnly) && m_userLevel < 200) godLevel = 200; return godLevel; @@ -127,6 +131,9 @@ namespace OpenSim.Region.Framework.Scenes if (m_allowGridGods && m_userLevel > 0) return true; + if(m_forceGridGodsOnly) + return false; + if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID)) return true; @@ -164,13 +171,12 @@ namespace OpenSim.Region.Framework.Scenes public bool RequestGodMode(bool god) { + // this is used by viewer protocol + // and they may want a answer if (!god) { - if (m_viewerUiIsGod) - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, 0); - + m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, 0); m_viewerUiIsGod = false; - return true; } @@ -178,12 +184,8 @@ namespace OpenSim.Region.Framework.Scenes return false; int godLevel = PotentialGodLevel(); - - if (!m_viewerUiIsGod) - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); - + m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); m_viewerUiIsGod = true; - return true; } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 36d0e40..01e0aac 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4509,9 +4509,11 @@ namespace OpenSim.Region.Framework.Scenes if (isNPC) return; - bool success = GodController.RequestGodMode(godStatus); - if (success && godStatus) - parcelGodCheck(m_currentParcelUUID, GodController.GodLevel >= 200); + bool wasgod = (GodController.GodLevel >= 200); + GodController.RequestGodMode(godStatus); + bool isgod = GodController.GodLevel >= 200; + if (wasgod != isgod) + parcelGodCheck(m_currentParcelUUID, isgod); } #region Child Agent Updates -- cgit v1.1 From 4385d7d6934443530c1e14976e40f01dc90175bf Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 13:17:43 +0000 Subject: Fix errors introduced by incomplete understanding of what folded perms are --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 24 ++++++++-------------- .../Framework/Scenes/SceneObjectPartInventory.cs | 19 +++++++++++------ 2 files changed, 22 insertions(+), 21 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e3ccf96..9c8dbb6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -681,13 +681,17 @@ namespace OpenSim.Region.Framework.Scenes // a mask if (item.InvType == (int)InventoryType.Object) { + // Create a safe mask for the current perms + uint foldedPerms = (item.CurrentPermissions & 7) << 13; + foldedPerms |= permsMask; + bool isRootMod = (item.CurrentPermissions & (uint)PermissionMask.Modify) != 0 ? true : false; // Mask the owner perms to the folded perms - PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref ownerPerms); - PermissionsUtil.ApplyFoldedPermissions(item.CurrentPermissions, ref basePerms); + ownerPerms &= foldedPerms; + basePerms &= foldedPerms; // If the root was mod, let the mask reflect that // We also need to adjust the base here, because @@ -1240,19 +1244,9 @@ namespace OpenSim.Region.Framework.Scenes { agentItem.BasePermissions = taskItem.BasePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); if (taskItem.InvType == (int)InventoryType.Object) - { - // Bake the new base permissions from folded permissions - // The folded perms are in the lowest 3 bits of the current perms - // We use base permissions here to avoid baking the "Locked" status - // into the item as it is passed. - uint perms = taskItem.BasePermissions & taskItem.NextPermissions; - PermissionsUtil.ApplyFoldedPermissions(taskItem.CurrentPermissions, ref perms); - // Avoid the "lock trap" - move must always be enabled but the above may remove it - // Add it back here. - agentItem.BasePermissions = perms | (uint)PermissionMask.Move; - // Newly given items cannot be "locked" on rez. Make sure by - // setting current equal to base. - } + agentItem.CurrentPermissions = agentItem.BasePermissions & (((taskItem.CurrentPermissions & 7) << 13) | (taskItem.CurrentPermissions & (uint)PermissionMask.Move)); + else + agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; agentItem.CurrentPermissions = agentItem.BasePermissions; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a50f162..45c3ebd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -1358,12 +1358,19 @@ namespace OpenSim.Region.Framework.Scenes { if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) { - if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Copy; - if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; - if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Modify; +// m_log.DebugFormat ( +// "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", +// item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); + + if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) + { + if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Copy; + if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; + if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Modify; + } } item.CurrentPermissions &= item.NextPermissions; item.BasePermissions &= item.NextPermissions; -- cgit v1.1 From 0b912b2acc0eee5eef9214541d380a2862222f0e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Jan 2017 14:48:49 +0000 Subject: Remove parcel_owner_is_god option. It is conceptually wrong and with limited use. Relevant parcel owners can just be made estate managers with better regions management logic --- OpenSim/Region/Framework/Scenes/GodController.cs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index f8b576c..36483fb 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -53,7 +53,6 @@ namespace OpenSim.Region.Framework.Scenes protected bool m_forceGridGodsOnly; protected bool m_regionOwnerIsGod; protected bool m_regionManagerIsGod; - protected bool m_parcelOwnerIsGod; protected bool m_forceGodModeAlwaysOn; protected bool m_allowGodActionsWithoutGodMode; @@ -94,10 +93,6 @@ namespace OpenSim.Region.Framework.Scenes Util.GetConfigVarFromSections(config, "region_manager_is_god", sections, false); - // Parcel owners are gods in their own parcels only. - m_parcelOwnerIsGod = - Util.GetConfigVarFromSections(config, - "parcel_owner_is_god", sections, false); } else m_allowGridGods = true; // reduce user mistakes increased by this over complex options set @@ -140,14 +135,6 @@ namespace OpenSim.Region.Framework.Scenes if (m_regionManagerIsGod && m_scene.Permissions.IsEstateManager(m_scenePresence.UUID)) return true; - if (m_parcelOwnerIsGod) // Skip expensive check if we're already god! - { - Vector3 pos = m_scenePresence.AbsolutePosition; - ILandObject parcel = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); - if (parcel != null && parcel.LandData.OwnerID == m_scenePresence.UUID) - return true; - } - return false; } -- cgit v1.1 From e526e8c5e225e931a5796532bf32b76530388089 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 17:05:00 +0000 Subject: Fix the long-standing bug that object permissions set in inventory were lost NOTE: Items rezzed by users using 0.8 or older will still exhibit broken behaviour. Until 0.8 becomes end of life, this fix will not produce dependable results on grids with mixed versions. Grids based on 0.9 will now work properly. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 18 ++++++++++++------ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 9c8dbb6..cb06540 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -627,6 +627,7 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.AssetType = item.AssetType; itemCopy.InvType = item.InvType; itemCopy.Folder = recipientFolderId; + itemCopy.Flags = item.Flags; if (Permissions.PropagatePermissions() && recipient != senderId) { @@ -643,7 +644,7 @@ namespace OpenSim.Region.Framework.Scenes // // Transfer // Copy - // Modufy + // Modify uint permsMask = ~ ((uint)PermissionMask.Copy | (uint)PermissionMask.Transfer | (uint)PermissionMask.Modify); @@ -718,6 +719,10 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.BasePermissions = basePerms; itemCopy.CurrentPermissions = ownerPerms; itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; + // Need to clear the other inventory slam options. + // That is so we can handle the case where the recipient + // changes the bits in inventory before rezzing + itemCopy.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); itemCopy.NextPermissions = item.NextPermissions; @@ -767,9 +772,8 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.GroupID = UUID.Zero; itemCopy.GroupOwned = false; - itemCopy.Flags = item.Flags; - itemCopy.SalePrice = item.SalePrice; - itemCopy.SaleType = item.SaleType; + itemCopy.SalePrice = 0; //item.SalePrice; + itemCopy.SaleType = 0; //item.SaleType; IInventoryAccessModule invAccess = RequestModuleInterface(); if (invAccess != null) @@ -1251,9 +1255,11 @@ namespace OpenSim.Region.Framework.Scenes agentItem.CurrentPermissions = agentItem.BasePermissions; agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm; + agentItem.Flags &= ~(uint)(InventoryItemFlags.ObjectOverwriteBase | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); agentItem.NextPermissions = taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); - agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; + // Group permissions make no sense here + agentItem.GroupPermissions = 0; } else { @@ -1261,7 +1267,7 @@ namespace OpenSim.Region.Framework.Scenes agentItem.CurrentPermissions = taskItem.CurrentPermissions; agentItem.NextPermissions = taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions; - agentItem.GroupPermissions = taskItem.GroupPermissions; + agentItem.GroupPermissions = 0; } message = null; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b97cceb..99be06b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -5242,6 +5242,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter BaseMask &= NextOwnerMask | (uint)PermissionMask.Export; OwnerMask &= NextOwnerMask; EveryoneMask &= NextOwnerMask | (uint)PermissionMask.Export; + GroupMask = 0; // Giving an object zaps group permissions Inventory.ApplyNextOwnerPermissions(); } -- cgit v1.1 From 497c4178850f616103690944838aee940b122302 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Jan 2017 17:33:12 +0000 Subject: add a missing god_date transmition --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 01e0aac..0c88c78 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1045,7 +1045,6 @@ namespace OpenSim.Region.Framework.Scenes public ScenePresence( IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) { - GodController = new GodController(world, this); m_scene = world; AttachmentsSyncLock = new Object(); @@ -1072,8 +1071,12 @@ namespace OpenSim.Region.Framework.Scenes else m_userFlags = 0; + int userlevel = 0; if (account != null) - GodController.UserLevel = account.UserLevel; + userlevel = account.UserLevel; + +// GodController = new GodController(world, this, userlevel); + GodController = new GodController(world, this); // IGroupsModule gm = m_scene.RequestModuleInterface(); // if (gm != null) @@ -4612,6 +4615,7 @@ namespace OpenSim.Region.Framework.Scenes cAgent.UpAxis = CameraUpAxis; cAgent.Far = DrawDistance; + cAgent.GodData = GodController.State(); // Throttles cAgent.Throttles = ControllingClient.GetThrottlesPacked(1); -- cgit v1.1 From f2c50db968dd03cd361e407f4054a94ea59930d2 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 6 Jan 2017 18:13:33 +0000 Subject: Fix an artefact introduced by git's revert merging logic --- .../Region/Framework/Scenes/SceneObjectPartInventory.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 45c3ebd..6557003 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -1362,15 +1362,12 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE OBJECT PART INVENTORY]: Applying next permissions {0} to {1} in {2} with current {3}, base {4}, everyone {5}", // item.NextPermissions, item.Name, m_part.Name, item.CurrentPermissions, item.BasePermissions, item.EveryonePermissions); - if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0) - { - if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Copy; - if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; - if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) - item.CurrentPermissions &= ~(uint)PermissionMask.Modify; - } + if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Copy; + if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Transfer; + if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0) + item.CurrentPermissions &= ~(uint)PermissionMask.Modify; } item.CurrentPermissions &= item.NextPermissions; item.BasePermissions &= item.NextPermissions; -- cgit v1.1 From 8ec258bef4950f81929057a9ee382a3f020359d5 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 01:07:56 +0000 Subject: Fix grid gods --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0c88c78..15d1f50 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1077,6 +1077,7 @@ namespace OpenSim.Region.Framework.Scenes // GodController = new GodController(world, this, userlevel); GodController = new GodController(world, this); + GodController.UserLevel = userlevel; // IGroupsModule gm = m_scene.RequestModuleInterface(); // if (gm != null) -- cgit v1.1 From d761a20ccebc0b20237c86bb55683155f0eeaf15 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 16:02:52 +0000 Subject: more changes to god level control. Not that this is work in progress, for now it still works mainly as with option implicit_gods = true. speed up some regions child updates, some cleanup --- OpenSim/Region/Framework/Scenes/GodController.cs | 200 +++++++++++------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 258 ++++++++++------------- 2 files changed, 234 insertions(+), 224 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 36483fb..8035760 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -47,6 +47,12 @@ namespace OpenSim.Region.Framework.Scenes { public class GodController { + public enum ImplicitGodLevels : int + { + EstateManager = 210, // estate manager implicit god level + RegionOwner = 220 // region owner implicit god level should be >= than estate + } + ScenePresence m_scenePresence; Scene m_scene; protected bool m_allowGridGods; @@ -56,14 +62,20 @@ namespace OpenSim.Region.Framework.Scenes protected bool m_forceGodModeAlwaysOn; protected bool m_allowGodActionsWithoutGodMode; - protected bool m_viewerUiIsGod = false; - protected int m_userLevel = 0; - - public GodController(Scene scene, ScenePresence sp) + // the god level from local or grid user rights + protected int m_rightsGodLevel = 0; + // the level seen by viewers + protected int m_godlevel = 0; + // new level that can be fixed or equal to godlevel, acording to options + protected int m_effectivegodlevel = 0; + protected int m_lastLevelToViewer = 0; + + public GodController(Scene scene, ScenePresence sp, int userlevel) { m_scene = scene; m_scenePresence = sp; + m_userLevel = userlevel; IConfigSource config = scene.Config; @@ -81,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes Util.GetConfigVarFromSections(config, "force_grid_gods_only", sections, false); - if(!m_forceGridGodsOnly) // damm redundant and error prone option + if(!m_forceGridGodsOnly) { // The owner of a region is a god in his region only. m_regionOwnerIsGod = @@ -95,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes } else - m_allowGridGods = true; // reduce user mistakes increased by this over complex options set + m_allowGridGods = true; // reduce potencial user mistakes // God mode should be turned on in the viewer whenever // the user has god rights somewhere. They may choose @@ -110,76 +122,122 @@ namespace OpenSim.Region.Framework.Scenes m_allowGodActionsWithoutGodMode = Util.GetConfigVarFromSections(config, "implicit_gods", sections, false); - } - protected int PotentialGodLevel() - { - int godLevel = m_allowGridGods ? m_userLevel : 200; - if ((!m_forceGridGodsOnly) && m_userLevel < 200) - godLevel = 200; + m_rightsGodLevel = CalcRightsGodLevel(); + + if(m_allowGodActionsWithoutGodMode) + { + m_effectivegodlevel = m_rightsGodLevel; + + m_forceGodModeAlwaysOn = false; + } + + else if(m_forceGodModeAlwaysOn) + { + m_godlevel = m_rightsGodLevel; + m_effectivegodlevel = m_rightsGodLevel; + } - return godLevel; + m_scenePresence.isGod = (m_effectivegodlevel >= 200); + m_scenePresence.isLegacyGod = (m_godlevel >= 200); } - protected bool CanBeGod() + // calculates god level at sp creation from local and grid user god rights + // for now this is assumed static until user leaves region. + // later estate and gride level updates may update this + protected int CalcRightsGodLevel() { - if (m_allowGridGods && m_userLevel > 0) - return true; + int level = 0; + if (m_allowGridGods && m_userLevel >= 200) + level = m_userLevel; - if(m_forceGridGodsOnly) - return false; + if(m_forceGridGodsOnly || level >= (int)ImplicitGodLevels.RegionOwner) + return level; if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID)) - return true; + level = (int)ImplicitGodLevels.RegionOwner; + + if(level >= (int)ImplicitGodLevels.EstateManager) + return level; if (m_regionManagerIsGod && m_scene.Permissions.IsEstateManager(m_scenePresence.UUID)) - return true; + level = (int)ImplicitGodLevels.EstateManager; - return false; + return level; } - public void SyncViewerState() + protected bool CanBeGod() { - bool canBeGod = CanBeGod(); - - bool shoudBeGod = m_forceGodModeAlwaysOn ? canBeGod : (m_viewerUiIsGod && canBeGod); + return m_rightsGodLevel >= 200; + } - int godLevel = PotentialGodLevel(); + protected void UpdateGodLevels(bool viewerState) + { + if(!CanBeGod()) + { + m_godlevel = 0; + m_effectivegodlevel = 0; + m_scenePresence.isGod = false; + m_scenePresence.isLegacyGod = false; + return; + } - if (!shoudBeGod) - godLevel = 0; + // legacy some are controled by viewer, others are static + if(m_allowGodActionsWithoutGodMode) + { + if(viewerState) + m_godlevel = m_rightsGodLevel; + else + m_godlevel = 0; - if (m_viewerUiIsGod != shoudBeGod && (!m_scenePresence.IsChildAgent)) + m_effectivegodlevel = m_rightsGodLevel; + } + else { - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); - m_viewerUiIsGod = shoudBeGod; + // new all change with viewer + if(viewerState) + { + m_godlevel = m_rightsGodLevel; + m_effectivegodlevel = m_rightsGodLevel; + } + else + { + m_godlevel = 0; + m_effectivegodlevel = 0; + } } + m_scenePresence.isGod = (m_effectivegodlevel >= 200); + m_scenePresence.isLegacyGod = (m_godlevel >= 200); } - public bool RequestGodMode(bool god) + public void SyncViewerState() { - // this is used by viewer protocol - // and they may want a answer - if (!god) - { - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, 0); - m_viewerUiIsGod = false; - return true; - } + if(m_lastLevelToViewer == m_godlevel) + return; + + m_lastLevelToViewer = m_godlevel; - if (!CanBeGod()) - return false; + if(m_scenePresence.IsChildAgent) + return; - int godLevel = PotentialGodLevel(); - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel); - m_viewerUiIsGod = true; - return true; + m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); } - public OSD State() + public void RequestGodMode(bool god) { - OSDMap godMap = new OSDMap(2); + UpdateGodLevels(god); + if(m_lastLevelToViewer != m_godlevel) + { + m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); + m_lastLevelToViewer = m_godlevel; + } + } + + public OSD State() + { + OSDMap godMap = new OSDMap(2); + bool m_viewerUiIsGod = m_godlevel >= 200; godMap.Add("ViewerUiIsGod", OSD.FromBoolean(m_viewerUiIsGod)); return godMap; @@ -187,13 +245,26 @@ namespace OpenSim.Region.Framework.Scenes public void SetState(OSD state) { - if(state == null) - return; - - OSDMap s = (OSDMap)state; + bool newstate = false; + if(m_forceGodModeAlwaysOn) + newstate = true; + else + { + if(state != null) + { + OSDMap s = (OSDMap)state; + + if (s.ContainsKey("ViewerUiIsGod")) + newstate = s["ViewerUiIsGod"].AsBoolean(); + m_lastLevelToViewer = m_godlevel; // we are not changing viewer level by default + } + } + UpdateGodLevels(newstate); + } - if (s.ContainsKey("ViewerUiIsGod")) - m_viewerUiIsGod = s["ViewerUiIsGod"].AsBoolean(); + public void HasMovedAway() + { + m_lastLevelToViewer = 0; } public int UserLevel @@ -204,29 +275,12 @@ namespace OpenSim.Region.Framework.Scenes public int GodLevel { - get - { - int godLevel = PotentialGodLevel(); - if (!m_viewerUiIsGod) - godLevel = 0; - - return godLevel; - } + get { return m_godlevel; } } public int EffectiveLevel { - get - { - int godLevel = PotentialGodLevel(); - if (m_viewerUiIsGod) - return godLevel; - - if (m_allowGodActionsWithoutGodMode && CanBeGod()) - return godLevel; - - return 0; - } + get { return m_effectivegodlevel; } } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 15d1f50..dbca68b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -92,6 +92,14 @@ namespace OpenSim.Region.Framework.Scenes public bool isNPC { get; private set; } + // simple yes or no isGOD from god level >= 200 + // should only be set by GodController + // we have two to suport legacy behaviour + // isLegacyGod was controlled by viewer in older versions + // isGod may now be also controled by viewer acording to options + public bool isLegacyGod { get; set; } + public bool isGod { get; set; } + private PresenceType m_presenceType; public PresenceType PresenceType { get {return m_presenceType;} @@ -155,7 +163,7 @@ namespace OpenSim.Region.Framework.Scenes public static readonly float MOVEMENT = .25f; public static readonly float SIGNIFICANT_MOVEMENT = 16.0f; public static readonly float CHILDUPDATES_MOVEMENT = 100.0f; - public static readonly float CHILDUPDATES_TIME = 10000f; // min time between child updates (ms) + public static readonly float CHILDUPDATES_TIME = 2000f; // min time between child updates (ms) private UUID m_previusParcelUUID = UUID.Zero; private UUID m_currentParcelUUID = UUID.Zero; @@ -186,7 +194,7 @@ namespace OpenSim.Region.Framework.Scenes m_currentParcelHide = true; if (m_previusParcelUUID != UUID.Zero || checksame) - ParcelCrossCheck(m_currentParcelUUID,m_previusParcelUUID,m_currentParcelHide, m_previusParcelHide, oldhide,checksame); + ParcelCrossCheck(m_currentParcelUUID, m_previusParcelUUID, m_currentParcelHide, m_previusParcelHide, oldhide,checksame); } } } @@ -267,8 +275,6 @@ namespace OpenSim.Region.Framework.Scenes private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; private bool MouseDown = false; -// private SceneObjectGroup proxyObjectGroup; - //private SceneObjectPart proxyObjectPart = null; public Vector3 lastKnownAllowedPosition; public bool sentMessageAboutRestrictedParcelFlyingDown; public Vector4 CollisionPlane = Vector4.UnitW; @@ -281,9 +287,6 @@ namespace OpenSim.Region.Framework.Scenes private bool m_followCamAuto = false; -// private object m_forceToApplyLock = new object(); -// private bool m_forceToApplyValid; -// private Vector3 m_forceToApply; private int m_userFlags; public int UserFlags { @@ -304,9 +307,6 @@ namespace OpenSim.Region.Framework.Scenes set { PhysicsActor.IsColliding = value; } } -// private int m_lastColCount = -1; //KF: Look for Collision chnages -// private int m_updateCount = 0; //KF: Update Anims for a while -// private static readonly int UPDATE_COUNT = 10; // how many frames to update for private List m_lastColliders = new List(); private TeleportFlags m_teleportFlags; @@ -332,8 +332,10 @@ namespace OpenSim.Region.Framework.Scenes private float m_sitAvatarHeight = 2.0f; - private bool childUpdatesBusy = false; - private int lastChildUpdatesTime; + private bool m_childUpdatesBusy = false; + private int m_lastChildUpdatesTime; + private int m_lastChildAgentUpdateGodLevel; + private float m_lastChildAgentUpdateDrawDistance; private Vector3 m_lastChildAgentUpdatePosition; // private Vector3 m_lastChildAgentUpdateCamPosition; @@ -348,8 +350,6 @@ namespace OpenSim.Region.Framework.Scenes private float m_healRate = 1f; private float m_healRatePerFrame = 0.05f; -// protected ulong crossingFromRegion; - private readonly Vector3[] Dir_Vectors = new Vector3[12]; protected int m_reprioritizationLastTime; @@ -372,10 +372,7 @@ namespace OpenSim.Region.Framework.Scenes private const int NumMovementsBetweenRayCast = 5; private bool CameraConstraintActive; - //private int m_moveToPositionStateStatus; - //***************************************************** - //private bool m_collisionEventFlag = false; private object m_collisionEventLock = new Object(); private int m_movementAnimationUpdateCounter = 0; @@ -529,7 +526,6 @@ namespace OpenSim.Region.Framework.Scenes private bool m_doingCamRayCast = false; public Vector3 CameraPosition { get; set; } - public Quaternion CameraRotation { get; private set; } // Use these three vectors to figure out what the agent is looking at @@ -589,7 +585,6 @@ namespace OpenSim.Region.Framework.Scenes public bool AllowMovement { get; set; } private bool m_setAlwaysRun; - public bool SetAlwaysRun { get @@ -613,7 +608,6 @@ namespace OpenSim.Region.Framework.Scenes } } - public byte State { get; set; } private AgentManager.ControlFlags m_AgentControlFlags; @@ -935,27 +929,7 @@ namespace OpenSim.Region.Framework.Scenes seeds = Scene.CapsModule.GetChildrenSeeds(UUID); else seeds = new Dictionary(); - -/* we can't do this anymore - List old = new List(); - foreach (ulong handle in seeds.Keys) - { - uint x, y; - Util.RegionHandleToRegionLoc(handle, out x, out y); -// if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY,)) - { - old.Add(handle); - } - } - - DropOldNeighbours(old); - - if (Scene.CapsModule != null) - Scene.CapsModule.SetChildrenSeed(UUID, seeds); -*/ KnownRegions = seeds; - //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); - //DumpKnownRegions(); } public void DumpKnownRegions() @@ -1045,7 +1019,6 @@ namespace OpenSim.Region.Framework.Scenes public ScenePresence( IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) { - m_scene = world; AttachmentsSyncLock = new Object(); AllowMovement = true; @@ -1075,9 +1048,7 @@ namespace OpenSim.Region.Framework.Scenes if (account != null) userlevel = account.UserLevel; -// GodController = new GodController(world, this, userlevel); - GodController = new GodController(world, this); - GodController.UserLevel = userlevel; + GodController = new GodController(world, this, userlevel); // IGroupsModule gm = m_scene.RequestModuleInterface(); // if (gm != null) @@ -1091,7 +1062,7 @@ namespace OpenSim.Region.Framework.Scenes m_reprioritizationLastDrawDistance = DrawDistance; // disable updates workjobs for now - childUpdatesBusy = true; + m_childUpdatesBusy = true; m_reprioritizationBusy = true; AdjustKnownSeeds(); @@ -1293,8 +1264,7 @@ namespace OpenSim.Region.Framework.Scenes IsLoggingIn = false; } - IsChildAgent = false; - + IsChildAgent = false; } m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -1304,7 +1274,6 @@ namespace OpenSim.Region.Framework.Scenes // Should not be needed if we are not trying to tell this region to close // DoNotCloseAfterTeleport = false; - RegionHandle = m_scene.RegionInfo.RegionHandle; m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); @@ -1447,7 +1416,6 @@ namespace OpenSim.Region.Framework.Scenes } } - m_log.DebugFormat("[MakeRootAgent] position and physical: {0}ms", Util.EnvironmentTickCountSubtract(ts)); m_scene.SwapRootAgentCount(false); @@ -1782,17 +1750,14 @@ namespace OpenSim.Region.Framework.Scenes if (m_AngularVelocity.Z > 0) { - float leftOverToMin = m_AngularVelocity.Z - rollMinRadians; if (amount > leftOverToMin) return -leftOverToMin; else return -amount; - } else { - float leftOverToMin = -m_AngularVelocity.Z - rollMinRadians; if (amount > leftOverToMin) return leftOverToMin; @@ -1801,8 +1766,6 @@ namespace OpenSim.Region.Framework.Scenes } } - - // neighbouring regions we have enabled a child agent in // holds the seed cap for the child agent in that region private Dictionary m_knownChildRegions = new Dictionary(); @@ -1815,7 +1778,6 @@ namespace OpenSim.Region.Framework.Scenes private Dictionary m_knownChildRegionsSizeInfo = new Dictionary(); - public void AddNeighbourRegionSizeInfo(GridRegion region) { lock (m_knownChildRegions) @@ -1946,7 +1908,6 @@ namespace OpenSim.Region.Framework.Scenes lock (m_originRegionIDAccessLock) originID = m_originRegionID; - while (originID.Equals(UUID.Zero) && count-- > 0) { lock (m_originRegionIDAccessLock) @@ -2020,8 +1981,6 @@ namespace OpenSim.Region.Framework.Scenes if (!WaitForUpdateAgent(client)) // The sending region never sent the UpdateAgent data, we have to refuse return; - - GodController.SyncViewerState(); } m_log.DebugFormat("[CompleteMovement] WaitForUpdateAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -2070,13 +2029,11 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); } - // Tell the client that we're totally ready ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - if (!string.IsNullOrEmpty(m_callbackURI)) { // We cannot sleep here since this would hold up the inbound packet processing thread, as @@ -2105,7 +2062,6 @@ namespace OpenSim.Region.Framework.Scenes // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); // } - m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); if(m_teleportFlags > 0) @@ -2125,18 +2081,19 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] HG"); } - if(!IsChildAgent && !isNPC) - GodController.SyncViewerState(); - -// start sending terrain patchs - if (!gotCrossUpdate && !isNPC) - Scene.SendLayerData(ControllingClient); - m_previusParcelHide = false; m_previusParcelUUID = UUID.Zero; m_currentParcelHide = false; m_currentParcelUUID = UUID.Zero; + if(!isNPC) + { + GodController.SyncViewerState(); + + // start sending terrain patchs + if (!gotCrossUpdate) + Scene.SendLayerData(ControllingClient); + } // send initial land overlay and parcel ILandChannel landch = m_scene.LandChannel; if (landch != null) @@ -2185,7 +2142,6 @@ namespace OpenSim.Region.Framework.Scenes if (haveAnims) SendAnimPackToAgent(this, animIDs, animseqs, animsobjs); - // we should be able to receive updates, etc // so release them m_inTransit = false; @@ -2200,7 +2156,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) continue; SendAppearanceToAgentNF(p); @@ -2250,7 +2206,7 @@ namespace OpenSim.Region.Framework.Scenes continue; } - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) continue; SendAttachmentsToAgentNF(p); @@ -2267,10 +2223,13 @@ namespace OpenSim.Region.Framework.Scenes { m_agentTransfer.EnableChildAgents(this); } - // let updates be sent, with some delay - lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; - childUpdatesBusy = false; // allow them } + // let updates be sent, with some delay + m_lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; + m_lastChildAgentUpdateGodLevel = GodController.GodLevel; + m_lastChildAgentUpdateDrawDistance = DrawDistance; + m_lastChildAgentUpdatePosition = AbsolutePosition; + m_childUpdatesBusy = false; // allow them } m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -2300,7 +2259,6 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] friendsModule: {0}ms", Util.EnvironmentTickCountSubtract(ts)); } - } finally { @@ -2309,14 +2267,7 @@ namespace OpenSim.Region.Framework.Scenes crossingFlags = 0; m_inTransit = false; } - // if hide force a check - // if (!IsChildAgent && newhide) - // { - // ParcelLoginCheck(m_currentParcelUUID); - // m_currentParcelHide = newhide; - // } - - + m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -3228,7 +3179,6 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; - if (PhysicsActor != null) m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; @@ -3257,7 +3207,6 @@ namespace OpenSim.Region.Framework.Scenes if (canSit) { - if (PhysicsActor != null) { // We can remove the physicsActor until they stand up. @@ -3368,7 +3317,6 @@ namespace OpenSim.Region.Framework.Scenes return false; } - private bool CanEnterLandPosition(Vector3 testPos) { ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y); @@ -3448,7 +3396,6 @@ namespace OpenSim.Region.Framework.Scenes ControllingClient.SendSitResponse( part.ParentGroup.UUID, offset, Orientation, true, cameraAtOffset, cameraEyeOffset, forceMouselook); - SendAvatarDataToAllAgents(); if (status == 3) @@ -3658,8 +3605,6 @@ namespace OpenSim.Region.Framework.Scenes Animator.avnChangeAnim(animID, addRemove, sendPack); } - - /// /// Rotate the avatar to the given rotation and apply a movement in the given relative vector /// @@ -3866,7 +3811,7 @@ namespace OpenSim.Region.Framework.Scenes if (!remoteClient.IsActive) return; - if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.isLegacyGod) return; //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); @@ -3976,7 +3921,7 @@ namespace OpenSim.Region.Framework.Scenes // get the avatar, then a kill if can't see it p.SendInitialAvatarDataToAgent(this); - if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && GodController.GodLevel < 200) + if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !isLegacyGod) return; p.SendAppearanceToAgentNF(this); @@ -4024,7 +3969,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (ScenePresence p in presences) { p.ControllingClient.SendAvatarDataImmediate(this); - if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) // either just kill the object // p.ControllingClient.SendKillObject(new List {LocalId}); // or also attachments viewer may still know about @@ -4037,7 +3982,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendInitialAvatarDataToAgent(ScenePresence p) { p.ControllingClient.SendAvatarDataImmediate(this); - if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) // either just kill the object // p.ControllingClient.SendKillObject(new List {LocalId}); // or also attachments viewer may still know about @@ -4051,7 +3996,7 @@ namespace OpenSim.Region.Framework.Scenes public void SendAvatarDataToAgent(ScenePresence avatar) { //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAgent from {0} ({1}) to {2} ({3})", Name, UUID, avatar.Name, avatar.UUID); - if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isLegacyGod) return; avatar.ControllingClient.SendAvatarDataImmediate(this); } @@ -4096,7 +4041,7 @@ namespace OpenSim.Region.Framework.Scenes { // m_log.DebugFormat( // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); - if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isLegacyGod) return; SendAppearanceToAgentNF(avatar); } @@ -4112,7 +4057,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent || Animator == null) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) return; Animator.SendAnimPackToClient(p.ControllingClient); @@ -4123,7 +4068,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) return; p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); @@ -4148,7 +4093,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) return; p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); }); @@ -4183,7 +4128,7 @@ namespace OpenSim.Region.Framework.Scenes if(DrawDistance > minregionSize && m_reprioritizationLastDrawDistance > minregionSize) byDrawdistance = false; else - byDrawdistance = (Math.Abs(DrawDistance-m_reprioritizationLastDrawDistance) > 0.5f * limit); + byDrawdistance = (Math.Abs(DrawDistance - m_reprioritizationLastDrawDistance) > 0.5f * limit); } int tdiff = Util.EnvironmentTickCountSubtract(m_reprioritizationLastTime); @@ -4232,7 +4177,7 @@ namespace OpenSim.Region.Framework.Scenes // updates priority recalc checkRePrioritization(); - if(childUpdatesBusy) + if(m_childUpdatesBusy) return; //possible KnownRegionHandles always contains current region and this check is not needed @@ -4242,37 +4187,52 @@ namespace OpenSim.Region.Framework.Scenes if(KnownRegionHandles.Count > minhandles) { - int tdiff = Util.EnvironmentTickCountSubtract(lastChildUpdatesTime); - if(tdiff > CHILDUPDATES_TIME) + int tdiff = Util.EnvironmentTickCountSubtract(m_lastChildUpdatesTime); + if(tdiff < CHILDUPDATES_TIME) + return; + + bool doUpdate = false; + if(m_lastChildAgentUpdateGodLevel != GodController.GodLevel) + doUpdate = true; + + if(!doUpdate && Math.Abs(DrawDistance - m_lastChildAgentUpdateDrawDistance) > 32.0f) + doUpdate = true; + + if(!doUpdate) { diff = pos - m_lastChildAgentUpdatePosition; if (diff.LengthSquared() > CHILDUPDATES_MOVEMENT) - { - childUpdatesBusy = true; - m_lastChildAgentUpdatePosition = pos; + doUpdate = true; + } + + if(doUpdate) + { + m_childUpdatesBusy = true; + m_lastChildAgentUpdatePosition = pos; + m_lastChildAgentUpdateGodLevel = GodController.GodLevel; + m_lastChildAgentUpdateDrawDistance = DrawDistance; // m_lastChildAgentUpdateCamPosition = CameraPosition; - AgentPosition agentpos = new AgentPosition(); - agentpos.AgentID = new UUID(UUID.Guid); - agentpos.SessionID = ControllingClient.SessionId; - agentpos.Size = Appearance.AvatarSize; - agentpos.Center = CameraPosition; - agentpos.Far = DrawDistance; - agentpos.Position = AbsolutePosition; - agentpos.Velocity = Velocity; - agentpos.RegionHandle = RegionHandle; - agentpos.GodData = GodController.State(); - agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); - - // Let's get this out of the update loop - Util.FireAndForget( - o => - { - m_scene.SendOutChildAgentUpdates(agentpos, this); - lastChildUpdatesTime = Util.EnvironmentTickCount(); - childUpdatesBusy = false; - }, null, "ScenePresence.SendOutChildAgentUpdates"); - } + AgentPosition agentpos = new AgentPosition(); + agentpos.AgentID = new UUID(UUID.Guid); + agentpos.SessionID = ControllingClient.SessionId; + agentpos.Size = Appearance.AvatarSize; + agentpos.Center = CameraPosition; + agentpos.Far = DrawDistance; + agentpos.Position = AbsolutePosition; + agentpos.Velocity = Velocity; + agentpos.RegionHandle = RegionHandle; + agentpos.GodData = GodController.State(); + agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); + + // Let's get this out of the update loop + Util.FireAndForget( + o => + { + m_scene.SendOutChildAgentUpdates(agentpos, this); + m_lastChildUpdatesTime = Util.EnvironmentTickCount(); + m_childUpdatesBusy = false; + }, null, "ScenePresence.SendOutChildAgentUpdates"); } } } @@ -4513,11 +4473,10 @@ namespace OpenSim.Region.Framework.Scenes if (isNPC) return; - bool wasgod = (GodController.GodLevel >= 200); + bool wasgod = isLegacyGod; GodController.RequestGodMode(godStatus); - bool isgod = GodController.GodLevel >= 200; - if (wasgod != isgod) - parcelGodCheck(m_currentParcelUUID, isgod); + if (wasgod != isLegacyGod) + parcelGodCheck(m_currentParcelUUID); } #region Child Agent Updates @@ -4697,7 +4656,6 @@ namespace OpenSim.Region.Framework.Scenes Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis); CameraRotation = camRot; - ParentUUID = cAgent.ParentPart; PrevSitOffset = cAgent.SitOffset; @@ -4883,7 +4841,6 @@ namespace OpenSim.Region.Framework.Scenes ControllingClient.SendAgentAlertMessage("Physics is having a problem with your avatar. You may not be able to move until you relog.", true); } - /// /// Event called by the physics plugin to tell the avatar about a collision. /// @@ -4952,7 +4909,7 @@ namespace OpenSim.Region.Framework.Scenes RaiseCollisionScriptEvents(coldata); // Gods do not take damage and Invulnerable is set depending on parcel/region flags - if (Invulnerable || GodController.GodLevel > 0) + if (Invulnerable || isLegacyGod) return; // The following may be better in the ICombatModule @@ -5237,7 +5194,7 @@ namespace OpenSim.Region.Framework.Scenes if (p != this && sog.HasPrivateAttachmentPoint) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) return; SendTerseUpdateToAgentNF(p); @@ -5351,7 +5308,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) continue; p.ControllingClient.SendEntityUpdate(rootpart, rootflag); @@ -5403,14 +5360,13 @@ namespace OpenSim.Region.Framework.Scenes if (sog.HasPrivateAttachmentPoint) return; - List allPresences = m_scene.GetScenePresences(); foreach (ScenePresence p in allPresences) { if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) continue; p.ControllingClient.SendEntityUpdate(rootpart, flag); @@ -5460,7 +5416,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) continue; p.ControllingClient.SendEntityUpdate(part, flag); @@ -5501,7 +5457,7 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) continue; p.ControllingClient.SendEntityUpdate(part, flag); @@ -6139,7 +6095,7 @@ namespace OpenSim.Region.Framework.Scenes // the TP point. This behaviour mimics agni. if (land.LandData.LandingType == (byte)LandingType.LandingPoint && land.LandData.UserLocation != Vector3.Zero && - GodController.GodLevel < 200 && + !isLegacyGod && ((land.LandData.OwnerID != m_uuid && !m_scene.Permissions.IsGod(m_uuid) && !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || @@ -6164,7 +6120,7 @@ namespace OpenSim.Region.Framework.Scenes string reason; // dont mess with gods - if(GodController.GodLevel >= 200 || m_scene.Permissions.IsGod(m_uuid)) + if(isLegacyGod || m_scene.Permissions.IsGod(m_uuid)) return true; // respect region owner and managers @@ -6450,7 +6406,7 @@ namespace OpenSim.Region.Framework.Scenes } - private void parcelGodCheck(UUID currentParcelID, bool isGod) + private void parcelGodCheck(UUID currentParcelID) { List allpresences = m_scene.GetScenePresences(); @@ -6461,7 +6417,7 @@ namespace OpenSim.Region.Framework.Scenes if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) { - if (isGod) + if (isLegacyGod) p.SendViewTo(this); else p.SendKillTo(this); @@ -6470,7 +6426,7 @@ namespace OpenSim.Region.Framework.Scenes } private void ParcelCrossCheck(UUID currentParcelID,UUID previusParcelID, - bool currentParcelHide, bool previusParcelHide, bool oldhide,bool check) + bool currentParcelHide, bool previusParcelHide, bool oldhide, bool check) { List killsToSendto = new List(); List killsToSendme = new List(); @@ -6512,7 +6468,7 @@ namespace OpenSim.Region.Framework.Scenes continue; // those not on parcel dont see me - if (currentParcelID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) { killsToSendto.Add(p); // they dont see me } @@ -6538,9 +6494,9 @@ namespace OpenSim.Region.Framework.Scenes // only those on previus parcel need receive kills if (previusParcelID == p.currentParcelUUID) { - if(p.GodController.GodLevel < 200) + if(!p.isLegacyGod) killsToSendto.Add(p); // they dont see me - if(GodController.GodLevel < 200) + if(!isLegacyGod) killsToSendme.Add(p); // i dont see them } // only those on new parcel need see @@ -6562,7 +6518,7 @@ namespace OpenSim.Region.Framework.Scenes continue; // those not on new parcel dont see me - if (currentParcelID != p.currentParcelUUID && p.GodController.GodLevel < 200) + if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) { killsToSendto.Add(p); // they dont see me } @@ -6588,7 +6544,7 @@ namespace OpenSim.Region.Framework.Scenes if (p.IsDeleted || p == this || p.ControllingClient == null || !p.ControllingClient.IsActive) continue; // only those old parcel need kills - if (previusParcelID == p.currentParcelUUID && GodController.GodLevel < 200) + if (previusParcelID == p.currentParcelUUID && !isLegacyGod) { killsToSendme.Add(p); // i dont see them } @@ -6645,13 +6601,12 @@ namespace OpenSim.Region.Framework.Scenes public void HasMovedAway(bool nearRegion) { - if (nearRegion) { if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); - if (!ParcelHideThisAvatar || GodController.GodLevel >= 200) + if (!ParcelHideThisAvatar || isLegacyGod) return; List allpresences = m_scene.GetScenePresences(); @@ -6668,6 +6623,7 @@ namespace OpenSim.Region.Framework.Scenes } else { + GodController.HasMovedAway(); List allpresences = m_scene.GetScenePresences(); foreach (ScenePresence p in allpresences) { -- cgit v1.1