From 5bcb1c0e721322238e84eee21cf2513d6111fb69 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 18:10:30 +0000 Subject: [PATCH 1/7] rename same variables to make their meaning more clear --- .../Region/Framework/Scenes/GodController.cs | 51 ++++++++------- .../Region/Framework/Scenes/ScenePresence.cs | 62 +++++++++---------- 2 files changed, 56 insertions(+), 57 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 803576094a..ac11ba9460 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -66,9 +66,9 @@ namespace OpenSim.Region.Framework.Scenes // the god level from local or grid user rights protected int m_rightsGodLevel = 0; // the level seen by viewers - protected int m_godlevel = 0; + protected int m_viewergodlevel = 0; // new level that can be fixed or equal to godlevel, acording to options - protected int m_effectivegodlevel = 0; + protected int m_godlevel = 0; protected int m_lastLevelToViewer = 0; public GodController(Scene scene, ScenePresence sp, int userlevel) @@ -127,19 +127,18 @@ namespace OpenSim.Region.Framework.Scenes if(m_allowGodActionsWithoutGodMode) { - m_effectivegodlevel = m_rightsGodLevel; - + m_godlevel = m_rightsGodLevel; m_forceGodModeAlwaysOn = false; } else if(m_forceGodModeAlwaysOn) { + m_viewergodlevel = m_rightsGodLevel; m_godlevel = m_rightsGodLevel; - m_effectivegodlevel = m_rightsGodLevel; } - m_scenePresence.isGod = (m_effectivegodlevel >= 200); - m_scenePresence.isLegacyGod = (m_godlevel >= 200); + m_scenePresence.isGod = (m_godlevel >= 200); + m_scenePresence.isViewerUIGod = (m_viewergodlevel >= 200); } // calculates god level at sp creation from local and grid user god rights @@ -175,10 +174,10 @@ namespace OpenSim.Region.Framework.Scenes { if(!CanBeGod()) { + m_viewergodlevel = 0; m_godlevel = 0; - m_effectivegodlevel = 0; m_scenePresence.isGod = false; - m_scenePresence.isLegacyGod = false; + m_scenePresence.isViewerUIGod = false; return; } @@ -186,58 +185,58 @@ namespace OpenSim.Region.Framework.Scenes if(m_allowGodActionsWithoutGodMode) { if(viewerState) - m_godlevel = m_rightsGodLevel; + m_viewergodlevel = m_rightsGodLevel; else - m_godlevel = 0; + m_viewergodlevel = 0; - m_effectivegodlevel = m_rightsGodLevel; + m_godlevel = m_rightsGodLevel; } else { // new all change with viewer if(viewerState) { + m_viewergodlevel = m_rightsGodLevel; m_godlevel = m_rightsGodLevel; - m_effectivegodlevel = m_rightsGodLevel; } else { + m_viewergodlevel = 0; m_godlevel = 0; - m_effectivegodlevel = 0; } } - m_scenePresence.isGod = (m_effectivegodlevel >= 200); - m_scenePresence.isLegacyGod = (m_godlevel >= 200); + m_scenePresence.isGod = (m_godlevel >= 200); + m_scenePresence.isViewerUIGod = (m_viewergodlevel >= 200); } public void SyncViewerState() { - if(m_lastLevelToViewer == m_godlevel) + if(m_lastLevelToViewer == m_viewergodlevel) return; - m_lastLevelToViewer = m_godlevel; + m_lastLevelToViewer = m_viewergodlevel; if(m_scenePresence.IsChildAgent) return; - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); + m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_viewergodlevel); } public void RequestGodMode(bool god) { UpdateGodLevels(god); - if(m_lastLevelToViewer != m_godlevel) + if(m_lastLevelToViewer != m_viewergodlevel) { - m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); - m_lastLevelToViewer = m_godlevel; + m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_viewergodlevel); + m_lastLevelToViewer = m_viewergodlevel; } } public OSD State() { OSDMap godMap = new OSDMap(2); - bool m_viewerUiIsGod = m_godlevel >= 200; + bool m_viewerUiIsGod = m_viewergodlevel >= 200; godMap.Add("ViewerUiIsGod", OSD.FromBoolean(m_viewerUiIsGod)); return godMap; @@ -256,7 +255,7 @@ namespace OpenSim.Region.Framework.Scenes if (s.ContainsKey("ViewerUiIsGod")) newstate = s["ViewerUiIsGod"].AsBoolean(); - m_lastLevelToViewer = m_godlevel; // we are not changing viewer level by default + m_lastLevelToViewer = m_viewergodlevel; // we are not changing viewer level by default } } UpdateGodLevels(newstate); @@ -275,12 +274,12 @@ namespace OpenSim.Region.Framework.Scenes public int GodLevel { - get { return m_godlevel; } + get { return m_viewergodlevel; } } public int EffectiveLevel { - get { return m_effectivegodlevel; } + get { return m_godlevel; } } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index dbca68b71f..f851179fc2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -95,9 +95,9 @@ namespace OpenSim.Region.Framework.Scenes // 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 + // isViewerUIGod 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 isViewerUIGod { get; set; } public bool isGod { get; set; } private PresenceType m_presenceType; @@ -1264,7 +1264,7 @@ namespace OpenSim.Region.Framework.Scenes IsLoggingIn = false; } - IsChildAgent = false; + IsChildAgent = false; } m_log.DebugFormat("[MakeRootAgent] out lock: {0}ms", Util.EnvironmentTickCountSubtract(ts)); @@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) continue; SendAppearanceToAgentNF(p); @@ -2206,7 +2206,7 @@ namespace OpenSim.Region.Framework.Scenes continue; } - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) continue; SendAttachmentsToAgentNF(p); @@ -3811,7 +3811,7 @@ namespace OpenSim.Region.Framework.Scenes if (!remoteClient.IsActive) return; - if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.isViewerUIGod) return; //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); @@ -3921,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 && !isLegacyGod) + if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !isViewerUIGod) return; p.SendAppearanceToAgentNF(this); @@ -3969,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.isLegacyGod) + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) // either just kill the object // p.ControllingClient.SendKillObject(new List {LocalId}); // or also attachments viewer may still know about @@ -3982,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.isLegacyGod) + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) // either just kill the object // p.ControllingClient.SendKillObject(new List {LocalId}); // or also attachments viewer may still know about @@ -3996,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.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isViewerUIGod) return; avatar.ControllingClient.SendAvatarDataImmediate(this); } @@ -4041,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.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.isViewerUIGod) return; SendAppearanceToAgentNF(avatar); } @@ -4057,7 +4057,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent || Animator == null) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) return; Animator.SendAnimPackToClient(p.ControllingClient); @@ -4068,7 +4068,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) return; p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); @@ -4093,7 +4093,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) return; p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); }); @@ -4473,9 +4473,9 @@ namespace OpenSim.Region.Framework.Scenes if (isNPC) return; - bool wasgod = isLegacyGod; + bool wasgod = isViewerUIGod; GodController.RequestGodMode(godStatus); - if (wasgod != isLegacyGod) + if (wasgod != isViewerUIGod) parcelGodCheck(m_currentParcelUUID); } @@ -4909,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 || isLegacyGod) + if (Invulnerable || isViewerUIGod) return; // The following may be better in the ICombatModule @@ -5194,7 +5194,7 @@ namespace OpenSim.Region.Framework.Scenes if (p != this && sog.HasPrivateAttachmentPoint) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) return; SendTerseUpdateToAgentNF(p); @@ -5308,7 +5308,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(rootpart, rootflag); @@ -5366,7 +5366,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(rootpart, flag); @@ -5416,7 +5416,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(part, flag); @@ -5457,7 +5457,7 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isLegacyGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(part, flag); @@ -6095,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 && - !isLegacyGod && + !isViewerUIGod && ((land.LandData.OwnerID != m_uuid && !m_scene.Permissions.IsGod(m_uuid) && !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || @@ -6120,7 +6120,7 @@ namespace OpenSim.Region.Framework.Scenes string reason; // dont mess with gods - if(isLegacyGod || m_scene.Permissions.IsGod(m_uuid)) + if(isViewerUIGod || m_scene.Permissions.IsGod(m_uuid)) return true; // respect region owner and managers @@ -6417,7 +6417,7 @@ namespace OpenSim.Region.Framework.Scenes if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) { - if (isLegacyGod) + if (isViewerUIGod) p.SendViewTo(this); else p.SendKillTo(this); @@ -6468,7 +6468,7 @@ namespace OpenSim.Region.Framework.Scenes continue; // those not on parcel dont see me - if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) + if (currentParcelID != p.currentParcelUUID && !p.isViewerUIGod) { killsToSendto.Add(p); // they dont see me } @@ -6494,9 +6494,9 @@ namespace OpenSim.Region.Framework.Scenes // only those on previus parcel need receive kills if (previusParcelID == p.currentParcelUUID) { - if(!p.isLegacyGod) + if(!p.isViewerUIGod) killsToSendto.Add(p); // they dont see me - if(!isLegacyGod) + if(!isViewerUIGod) killsToSendme.Add(p); // i dont see them } // only those on new parcel need see @@ -6518,7 +6518,7 @@ namespace OpenSim.Region.Framework.Scenes continue; // those not on new parcel dont see me - if (currentParcelID != p.currentParcelUUID && !p.isLegacyGod) + if (currentParcelID != p.currentParcelUUID && !p.isViewerUIGod) { killsToSendto.Add(p); // they dont see me } @@ -6544,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 && !isLegacyGod) + if (previusParcelID == p.currentParcelUUID && !isViewerUIGod) { killsToSendme.Add(p); // i dont see them } @@ -6606,7 +6606,7 @@ namespace OpenSim.Region.Framework.Scenes if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); - if (!ParcelHideThisAvatar || isLegacyGod) + if (!ParcelHideThisAvatar || isViewerUIGod) return; List allpresences = m_scene.GetScenePresences(); From effa32cfa4cc252e9d52d536af510b4e1e92337c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 18:41:46 +0000 Subject: [PATCH 2/7] replace godlevel compares by the new faster bool isViewerUIGod --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 4 ++-- .../Region/CoreModules/Avatar/Friends/CallingCardModule.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs | 2 +- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 +++--- .../Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 6 +++--- .../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 316956b5fe..2bcb3bcdf3 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -11455,7 +11455,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ScenePresence p; if (scene.TryGetScenePresence(sender.AgentId, out p)) { - if (p.GodController.GodLevel >= 200) + if (p.isViewerUIGod) { groupProfileReply.GroupData.OpenEnrollment = true; groupProfileReply.GroupData.MembershipFee = 0; diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index adf5c685cf..5579dd0310 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat fromPos = avatar.AbsolutePosition; fromName = avatar.Name; fromID = c.Sender.AgentId; - if (avatar.GodController.GodLevel >= 200) + if (avatar.isViewerUIGod) { // let gods speak to outside or things may get confusing fromNamePrefix = m_adminPrefix; checkParcelHide = false; @@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat { if (checkParcelHide) { - if (sourceParcelID != Presencecheck.LandData.GlobalID && presence.GodController.GodLevel < 200) + if (sourceParcelID != Presencecheck.LandData.GlobalID && !presence.isViewerUIGod) return; } if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index 9843f2e619..58fa42d345 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // If we're in god mode, we reverse the meaning. Offer // calling card becomes "Take a calling card" for that // person, no matter if they agree or not. - if (sp.GodController.GodLevel >= 200) + if (sp.isViewerUIGod) { CreateCallingCard(client.AgentId, destID, UUID.Zero, true); return; diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 8116b3c54c..9664ae56b0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods sp.GrantGodlikePowers(token, godLike); - if (godLike && sp.GodController.GodLevel < 200 && DialogModule != null) + if (godLike && !sp.isViewerUIGod && DialogModule != null) DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); } diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index bd95ff09eb..9c80d0ae66 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure GridInstantMessage m; - if (scene.Permissions.IsAdministrator(client.AgentId) && presence.GodController.GodLevel >= 200 && (!scene.Permissions.IsAdministrator(targetid))) + if (scene.Permissions.IsAdministrator(client.AgentId) && presence.isViewerUIGod && (!scene.Permissions.IsAdministrator(targetid))) { m = new GridInstantMessage(scene, client.AgentId, client.FirstName+" "+client.LastName, targetid, diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 92d6808f10..51ab5fd324 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5029,7 +5029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // agent must not be a god - if (presence.GodController.GodLevel >= 200) return; + if (presence.isViewerUIGod) return; // agent must be over the owners land ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); @@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; // Pushee is in GodMode this pushing object isn't owned by them - if (avatar.GodController.GodLevel > 0 && m_host.OwnerID != targetID) + if (avatar.isViewerUIGod && m_host.OwnerID != targetID) return; pusheeav = avatar; @@ -6687,7 +6687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api delegate (ScenePresence ssp) { // Gods are not listed in SL - if (!ssp.IsDeleted && ssp.GodController.GodLevel == 0.0 && !ssp.IsChildAgent) + if (!ssp.IsDeleted && !ssp.isViewerUIGod && !ssp.IsChildAgent) { if (!regionWide) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 49e70bcd0b..40ad2918f2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -721,7 +721,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || sp.GodController.GodLevel < 200) + if (sp == null || !sp.isViewerUIGod) { LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; @@ -768,7 +768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || sp.GodController.GodLevel < 200) + if (sp == null || !sp.isViewerUIGod) { LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return; @@ -799,7 +799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || sp.GodController.GodLevel < 200) + if (sp == null || !sp.isViewerUIGod) { LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index c7e7f89d4c..bd53700c4b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -540,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - if (presence.IsDeleted || presence.IsChildAgent || presence.GodController.GodLevel > 0.0) + if (presence.IsDeleted || presence.IsChildAgent || presence.isViewerUIGod) return; // if the object the script is in is attached and the avatar is the owner From eedc37794e47159c0f8876ad3e37b69b9448ea98 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 18:49:15 +0000 Subject: [PATCH 3/7] rename same more variables to make their meaning more clear --- OpenSim/Region/Framework/Scenes/GodController.cs | 4 ++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index ac11ba9460..0ccb4b6769 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -272,12 +272,12 @@ namespace OpenSim.Region.Framework.Scenes set { m_userLevel = value; } } - public int GodLevel + public int ViwerUIGodLevel { get { return m_viewergodlevel; } } - public int EffectiveLevel + public int GodLevel { get { return m_godlevel; } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f851179fc2..c38e8fc675 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2226,7 +2226,7 @@ namespace OpenSim.Region.Framework.Scenes } // let updates be sent, with some delay m_lastChildUpdatesTime = Util.EnvironmentTickCount() + 10000; - m_lastChildAgentUpdateGodLevel = GodController.GodLevel; + m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; m_lastChildAgentUpdateDrawDistance = DrawDistance; m_lastChildAgentUpdatePosition = AbsolutePosition; m_childUpdatesBusy = false; // allow them @@ -4192,7 +4192,7 @@ namespace OpenSim.Region.Framework.Scenes return; bool doUpdate = false; - if(m_lastChildAgentUpdateGodLevel != GodController.GodLevel) + if(m_lastChildAgentUpdateGodLevel != GodController.ViwerUIGodLevel) doUpdate = true; if(!doUpdate && Math.Abs(DrawDistance - m_lastChildAgentUpdateDrawDistance) > 32.0f) @@ -4209,7 +4209,7 @@ namespace OpenSim.Region.Framework.Scenes { m_childUpdatesBusy = true; m_lastChildAgentUpdatePosition = pos; - m_lastChildAgentUpdateGodLevel = GodController.GodLevel; + m_lastChildAgentUpdateGodLevel = GodController.ViwerUIGodLevel; m_lastChildAgentUpdateDrawDistance = DrawDistance; // m_lastChildAgentUpdateCamPosition = CameraPosition; From 1b858ad47b2bb12cf095a2259db97381b295e464 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 18:57:12 +0000 Subject: [PATCH 4/7] missing changed file --- OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 9664ae56b0..904c8c8306 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -194,14 +194,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods int godlevel = 200; // update level so higher gods can kick lower ones ScenePresence god = m_scene.GetScenePresence(godID); - if(god != null && god.GodController.EffectiveLevel > godlevel) - godlevel = god.GodController.EffectiveLevel; + if(god != null && god.GodController.GodLevel > godlevel) + godlevel = god.GodController.GodLevel; if(agentID == ALL_AGENTS) { m_scene.ForEachRootScenePresence(delegate(ScenePresence p) { - if (p.UUID != godID && godlevel > p.GodController.EffectiveLevel) + if (p.UUID != godID && godlevel > p.GodController.GodLevel) doKickmodes(godID, p, kickflags, reason); }); return; @@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods return; } - if (godlevel <= sp.GodController.EffectiveLevel) // no god wars + if (godlevel <= sp.GodController.GodLevel) // no god wars return; if(sp.UUID == godID) From c41616b7711d3c2ab91ae0b8a06e22d8bfd5e0aa Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 7 Jan 2017 19:42:58 +0000 Subject: [PATCH 5/7] ignore teleport flag GodLike. Perform checks acording to agent static local or grid rights --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 87c3049830..2137b42417 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3951,7 +3951,7 @@ namespace OpenSim.Region.Framework.Scenes bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 || (teleportFlags & (uint)TPFlags.ViaHGLogin) != 0); bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0); - bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); +// bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0); reason = String.Empty; @@ -4251,7 +4251,8 @@ namespace OpenSim.Region.Framework.Scenes } // only check access, actual relocations will happen later on ScenePresence MakeRoot // allow child agents creation - if(!godlike && teleportFlags != (uint) TPFlags.Default) +// if(!godlike && teleportFlags != (uint) TPFlags.Default) + if(teleportFlags != (uint) TPFlags.Default) { bool checkTeleHub; @@ -6188,9 +6189,10 @@ Environment.Exit(1); if (Permissions.IsGod(agentID)) return true; - bool isAdmin = Permissions.IsAdministrator(agentID); - if(isAdmin) - return true; + // Permissions.IsAdministrator is the same as IsGod for now +// bool isAdmin = Permissions.IsAdministrator(agentID); +// if(isAdmin) +// return true; // also honor estate managers access rights bool isManager = Permissions.IsEstateManager(agentID); From 6d44ee90991e1594d2072a5016d1b3b767220140 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 20:30:51 +0000 Subject: [PATCH 6/7] Change improperly named isNPC to be IsNPC as a property should be uppercase --- OpenSim/Framework/ISceneAgent.cs | 4 ++-- .../AvatarFactory/AvatarFactoryModule.cs | 6 ++--- .../CoreModules/Avatar/Gods/GodsModule.cs | 2 +- .../Avatar/UserProfiles/UserProfileModule.cs | 8 +++---- .../GridUser/ActivityDetector.cs | 2 +- .../Presence/PresenceDetector.cs | 2 +- .../World/Land/LandManagementModule.cs | 2 +- .../CoreModules/World/Land/LandObject.cs | 2 +- .../Framework/Scenes/SceneObjectGroup.cs | 2 +- .../Framework/Scenes/SceneObjectPart.cs | 2 +- .../Region/Framework/Scenes/ScenePresence.cs | 22 +++++++++---------- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/OpenSim/Framework/ISceneAgent.cs b/OpenSim/Framework/ISceneAgent.cs index 5534e24eaf..5d70b83357 100644 --- a/OpenSim/Framework/ISceneAgent.cs +++ b/OpenSim/Framework/ISceneAgent.cs @@ -56,7 +56,7 @@ namespace OpenSim.Framework bool IsChildAgent { get; } bool IsInTransit { get; } - bool isNPC { get;} + bool IsNPC { get;} bool Invulnerable { get; set; } /// @@ -83,4 +83,4 @@ namespace OpenSim.Framework /// Will be Vector3.Zero for a child agent. Vector3 Lookat { get; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 0826a08152..fb408a402d 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -364,7 +364,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return false; // npcs dont have baked cache - if (((ScenePresence)sp).isNPC) + if (((ScenePresence)sp).IsNPC) return true; // uploaded baked textures will be in assets local cache @@ -507,7 +507,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { int hits = 0; - if (((ScenePresence)sp).isNPC) + if (((ScenePresence)sp).IsNPC) return true; lock (m_setAppearanceLock) @@ -701,7 +701,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) { - if (((ScenePresence)sp).isNPC) + if (((ScenePresence)sp).IsNPC) return 0; int texturesRebaked = 0; diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 904c8c8306..bb571d0a20 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods UUID agentID, UUID sessionID, UUID token, bool godLike) { ScenePresence sp = m_scene.GetScenePresence(agentID); - if(sp == null || sp.IsDeleted || sp.isNPC) + if(sp == null || sp.IsDeleted || sp.IsNPC) return; if (sessionID != sp.ControllingClient.SessionId) diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 138c0f7496..bc8aeca002 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs @@ -356,7 +356,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles return; ScenePresence p = FindPresence(targetID); - if (p != null && p.isNPC) + if (p != null && p.IsNPC) { remoteClient.SendAvatarClassifiedReply(targetID, classifieds); return; @@ -751,7 +751,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles Dictionary picks = new Dictionary(); ScenePresence p = FindPresence(targetId); - if (p != null && p.isNPC) + if (p != null && p.IsNPC) { remoteClient.SendAvatarPicksReply(targetId, picks); return; @@ -1165,7 +1165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles public void NotesUpdate(IClientAPI remoteClient, UUID queryTargetID, string queryNotes) { ScenePresence p = FindPresence(queryTargetID); - if (p != null && p.isNPC) + if (p != null && p.IsNPC) { remoteClient.SendAgentAlertMessage( "Notes for NPCs not available", false); @@ -1329,7 +1329,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles } ScenePresence p = FindPresence(avatarID); - if (p != null && p.isNPC) + if (p != null && p.IsNPC) { remoteClient.SendAvatarProperties(avatarID, ((INPC)(p.ControllingClient)).profileAbout, ((INPC)(p.ControllingClient)).Born, Utils.StringToBytes("Non Player Character (NPC)"), "NPCs have no life", 0x10, diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index c780bcde6c..1529fc2764 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser public void OnMakeRootAgent(ScenePresence sp) { - if (sp.isNPC) + if (sp.IsNPC) return; if(sp.gotCrossUpdate) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index aafd047a2d..a7e62eb755 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence public void OnMakeRootAgent(ScenePresence sp) { - if (sp.isNPC) + if (sp.IsNPC) return; if(sp.gotCrossUpdate) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 0122f47e30..5d12f8b31a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -1285,7 +1285,7 @@ namespace OpenSim.Region.CoreModules.World.Land UUID parcelID = land.LandData.GlobalID; m_scene.ForEachScenePresence(delegate(ScenePresence avatar) { - if (avatar.IsDeleted || avatar.isNPC) + if (avatar.IsDeleted || avatar.IsNPC) return; IClientAPI client = avatar.ControllingClient; diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index fc2282dd2a..73b4cb57a0 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -718,7 +718,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (!m_scene.TryGetScenePresence(avatar, out sp)) return true; - if(sp==null || !sp.isNPC) + if(sp==null || !sp.IsNPC) return true; INPC npccli = (INPC)sp.ControllingClient; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 8fdb0f1370..5928764a24 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2302,7 +2302,7 @@ namespace OpenSim.Region.Framework.Scenes List sitters = GetSittingAvatars(); foreach(ScenePresence sp in sitters) { - if(!sp.IsDeleted && !sp.isNPC && sp.IsSatOnObject) + if(!sp.IsDeleted && !sp.IsNPC && sp.IsSatOnObject) return; } } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 99be06bd01..b8ac089826 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2723,7 +2723,7 @@ namespace OpenSim.Region.Framework.Scenes detobj.posVector = av.AbsolutePosition; detobj.rotQuat = av.Rotation; detobj.velVector = av.Velocity; - detobj.colliderType = av.isNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs + detobj.colliderType = av.IsNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs if(av.IsSatOnObject) detobj.colliderType |= 0x4; //passive else if(detobj.velVector != Vector3.Zero) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c38e8fc675..58af505a43 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -90,7 +90,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene.EventManager.TriggerScenePresenceUpdated(this); } - public bool isNPC { get; private set; } + public bool IsNPC { get; private set; } // simple yes or no isGOD from god level >= 200 // should only be set by GodController @@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes private set { m_presenceType = value; - isNPC = (m_presenceType == PresenceType.Npc); + IsNPC = (m_presenceType == PresenceType.Npc); } } @@ -1974,7 +1974,7 @@ namespace OpenSim.Region.Framework.Scenes try { // Make sure it's not a login agent. We don't want to wait for updates during login - if (!isNPC && !IsRealLogin(m_teleportFlags)) + if (!IsNPC && !IsRealLogin(m_teleportFlags)) { // Let's wait until UpdateAgent (called by departing region) is done @@ -2012,7 +2012,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - if(!haveGroupInformation && !IsChildAgent && !isNPC) + if(!haveGroupInformation && !IsChildAgent && !IsNPC) { IGroupsModule gm = m_scene.RequestModuleInterface(); if (gm != null) @@ -2086,7 +2086,7 @@ namespace OpenSim.Region.Framework.Scenes m_currentParcelHide = false; m_currentParcelUUID = UUID.Zero; - if(!isNPC) + if(!IsNPC) { GodController.SyncViewerState(); @@ -2104,7 +2104,7 @@ namespace OpenSim.Region.Framework.Scenes // verify baked textures and cache bool cachedbaked = false; - if (isNPC) + if (IsNPC) cachedbaked = true; else { @@ -2168,14 +2168,14 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); // attachments - if (isNPC || IsRealLogin(m_teleportFlags)) + if (IsNPC || IsRealLogin(m_teleportFlags)) { if (Scene.AttachmentsModule != null) // Util.FireAndForget( // o => // { - if (!isNPC) + if (!IsNPC) Scene.AttachmentsModule.RezAttachments(this); else Util.FireAndForget(x => @@ -2235,7 +2235,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] openChildAgents: {0}ms", Util.EnvironmentTickCountSubtract(ts)); // send the rest of the world - if (m_teleportFlags > 0 && !isNPC || m_currentParcelHide) + if (m_teleportFlags > 0 && !IsNPC || m_currentParcelHide) SendInitialDataToMe(); // priority uses avatar position only @@ -4470,7 +4470,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void GrantGodlikePowers(UUID token, bool godStatus) { - if (isNPC) + if (IsNPC) return; bool wasgod = isViewerUIGod; @@ -6194,7 +6194,7 @@ namespace OpenSim.Region.Framework.Scenes detobj.posVector = av.AbsolutePosition; detobj.rotQuat = av.Rotation; detobj.velVector = av.Velocity; - detobj.colliderType = av.isNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs + detobj.colliderType = av.IsNPC ? 0x20 : 0x1; // OpenSim\Region\ScriptEngine\Shared\Helpers.cs if(av.IsSatOnObject) detobj.colliderType |= 0x4; //passive else if(detobj.velVector != Vector3.Zero) From e58903be6f745f7fca2a8d652e0f2d9a9283a04f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 7 Jan 2017 20:38:30 +0000 Subject: [PATCH 7/7] Correct casing on isGod and isViewerUIGod --- .../ClientStack/Linden/UDP/LLClientView.cs | 2 +- .../CoreModules/Avatar/Chat/ChatModule.cs | 4 +- .../Avatar/Friends/CallingCardModule.cs | 2 +- .../CoreModules/Avatar/Gods/GodsModule.cs | 2 +- .../CoreModules/Avatar/Lure/LureModule.cs | 2 +- .../Region/Framework/Scenes/GodController.cs | 12 ++-- .../Region/Framework/Scenes/ScenePresence.cs | 64 +++++++++---------- .../Shared/Api/Implementation/LSL_Api.cs | 6 +- .../Shared/Api/Implementation/LS_Api.cs | 6 +- .../Implementation/Plugins/SensorRepeat.cs | 2 +- 10 files changed, 51 insertions(+), 51 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 2bcb3bcdf3..df3466815b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -11455,7 +11455,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ScenePresence p; if (scene.TryGetScenePresence(sender.AgentId, out p)) { - if (p.isViewerUIGod) + if (p.IsViewerUIGod) { groupProfileReply.GroupData.OpenEnrollment = true; groupProfileReply.GroupData.MembershipFee = 0; diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 5579dd0310..ea901851c8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat fromPos = avatar.AbsolutePosition; fromName = avatar.Name; fromID = c.Sender.AgentId; - if (avatar.isViewerUIGod) + if (avatar.IsViewerUIGod) { // let gods speak to outside or things may get confusing fromNamePrefix = m_adminPrefix; checkParcelHide = false; @@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat { if (checkParcelHide) { - if (sourceParcelID != Presencecheck.LandData.GlobalID && !presence.isViewerUIGod) + if (sourceParcelID != Presencecheck.LandData.GlobalID && !presence.IsViewerUIGod) return; } if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs index 58fa42d345..4a55a7e4ea 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // If we're in god mode, we reverse the meaning. Offer // calling card becomes "Take a calling card" for that // person, no matter if they agree or not. - if (sp.isViewerUIGod) + if (sp.IsViewerUIGod) { CreateCallingCard(client.AgentId, destID, UUID.Zero, true); return; diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index bb571d0a20..f699c0c889 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods sp.GrantGodlikePowers(token, godLike); - if (godLike && !sp.isViewerUIGod && DialogModule != null) + if (godLike && !sp.IsViewerUIGod && DialogModule != null) DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); } diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index 9c80d0ae66..6f79676f0c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure GridInstantMessage m; - if (scene.Permissions.IsAdministrator(client.AgentId) && presence.isViewerUIGod && (!scene.Permissions.IsAdministrator(targetid))) + if (scene.Permissions.IsAdministrator(client.AgentId) && presence.IsViewerUIGod && (!scene.Permissions.IsAdministrator(targetid))) { m = new GridInstantMessage(scene, client.AgentId, client.FirstName+" "+client.LastName, targetid, diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs index 0ccb4b6769..7ed80f6051 100644 --- a/OpenSim/Region/Framework/Scenes/GodController.cs +++ b/OpenSim/Region/Framework/Scenes/GodController.cs @@ -137,8 +137,8 @@ namespace OpenSim.Region.Framework.Scenes m_godlevel = m_rightsGodLevel; } - m_scenePresence.isGod = (m_godlevel >= 200); - m_scenePresence.isViewerUIGod = (m_viewergodlevel >= 200); + m_scenePresence.IsGod = (m_godlevel >= 200); + m_scenePresence.IsViewerUIGod = (m_viewergodlevel >= 200); } // calculates god level at sp creation from local and grid user god rights @@ -176,8 +176,8 @@ namespace OpenSim.Region.Framework.Scenes { m_viewergodlevel = 0; m_godlevel = 0; - m_scenePresence.isGod = false; - m_scenePresence.isViewerUIGod = false; + m_scenePresence.IsGod = false; + m_scenePresence.IsViewerUIGod = false; return; } @@ -205,8 +205,8 @@ namespace OpenSim.Region.Framework.Scenes m_godlevel = 0; } } - m_scenePresence.isGod = (m_godlevel >= 200); - m_scenePresence.isViewerUIGod = (m_viewergodlevel >= 200); + m_scenePresence.IsGod = (m_godlevel >= 200); + m_scenePresence.IsViewerUIGod = (m_viewergodlevel >= 200); } public void SyncViewerState() diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 58af505a43..bd0786b858 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -95,10 +95,10 @@ namespace OpenSim.Region.Framework.Scenes // simple yes or no isGOD from god level >= 200 // should only be set by GodController // we have two to suport legacy behaviour - // isViewerUIGod was controlled by viewer in older versions - // isGod may now be also controled by viewer acording to options - public bool isViewerUIGod { get; set; } - public bool isGod { get; set; } + // IsViewerUIGod was controlled by viewer in older versions + // IsGod may now be also controled by viewer acording to options + public bool IsViewerUIGod { get; set; } + public bool IsGod { get; set; } private PresenceType m_presenceType; public PresenceType PresenceType { @@ -2156,7 +2156,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) continue; SendAppearanceToAgentNF(p); @@ -2206,7 +2206,7 @@ namespace OpenSim.Region.Framework.Scenes continue; } - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) continue; SendAttachmentsToAgentNF(p); @@ -3811,7 +3811,7 @@ namespace OpenSim.Region.Framework.Scenes if (!remoteClient.IsActive) return; - if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && p.currentParcelUUID != currentParcelUUID && !p.IsViewerUIGod) return; //m_log.DebugFormat("[SCENE PRESENCE]: " + Name + " sending TerseUpdate to " + remoteClient.Name + " : Pos={0} Rot={1} Vel={2}", m_pos, Rotation, m_velocity); @@ -3921,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 && !isViewerUIGod) + if (p.ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !IsViewerUIGod) return; p.SendAppearanceToAgentNF(this); @@ -3969,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.isViewerUIGod) + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) // either just kill the object // p.ControllingClient.SendKillObject(new List {LocalId}); // or also attachments viewer may still know about @@ -3982,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.isViewerUIGod) + if (p != this && ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) // either just kill the object // p.ControllingClient.SendKillObject(new List {LocalId}); // or also attachments viewer may still know about @@ -3996,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.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod) return; avatar.ControllingClient.SendAvatarDataImmediate(this); } @@ -4041,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.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && !avatar.IsViewerUIGod) return; SendAppearanceToAgentNF(avatar); } @@ -4057,7 +4057,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent || Animator == null) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) return; Animator.SendAnimPackToClient(p.ControllingClient); @@ -4068,7 +4068,7 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) return; p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); @@ -4093,7 +4093,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence p) { - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) return; p.ControllingClient.SendAnimations(animations, seqs, ControllingClient.AgentId, objectIDs); }); @@ -4473,9 +4473,9 @@ namespace OpenSim.Region.Framework.Scenes if (IsNPC) return; - bool wasgod = isViewerUIGod; + bool wasgod = IsViewerUIGod; GodController.RequestGodMode(godStatus); - if (wasgod != isViewerUIGod) + if (wasgod != IsViewerUIGod) parcelGodCheck(m_currentParcelUUID); } @@ -4909,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 || isViewerUIGod) + if (Invulnerable || IsViewerUIGod) return; // The following may be better in the ICombatModule @@ -5194,7 +5194,7 @@ namespace OpenSim.Region.Framework.Scenes if (p != this && sog.HasPrivateAttachmentPoint) return; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) return; SendTerseUpdateToAgentNF(p); @@ -5308,7 +5308,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(rootpart, rootflag); @@ -5366,7 +5366,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(rootpart, flag); @@ -5416,7 +5416,7 @@ namespace OpenSim.Region.Framework.Scenes if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(part, flag); @@ -5457,7 +5457,7 @@ namespace OpenSim.Region.Framework.Scenes { if (p == this) continue; - if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.isViewerUIGod) + if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) continue; p.ControllingClient.SendEntityUpdate(part, flag); @@ -6095,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 && - !isViewerUIGod && + !IsViewerUIGod && ((land.LandData.OwnerID != m_uuid && !m_scene.Permissions.IsGod(m_uuid) && !m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(m_uuid)) || @@ -6120,7 +6120,7 @@ namespace OpenSim.Region.Framework.Scenes string reason; // dont mess with gods - if(isViewerUIGod || m_scene.Permissions.IsGod(m_uuid)) + if(IsViewerUIGod || m_scene.Permissions.IsGod(m_uuid)) return true; // respect region owner and managers @@ -6417,7 +6417,7 @@ namespace OpenSim.Region.Framework.Scenes if (p.ParcelHideThisAvatar && p.currentParcelUUID != currentParcelID) { - if (isViewerUIGod) + if (IsViewerUIGod) p.SendViewTo(this); else p.SendKillTo(this); @@ -6468,7 +6468,7 @@ namespace OpenSim.Region.Framework.Scenes continue; // those not on parcel dont see me - if (currentParcelID != p.currentParcelUUID && !p.isViewerUIGod) + if (currentParcelID != p.currentParcelUUID && !p.IsViewerUIGod) { killsToSendto.Add(p); // they dont see me } @@ -6494,9 +6494,9 @@ namespace OpenSim.Region.Framework.Scenes // only those on previus parcel need receive kills if (previusParcelID == p.currentParcelUUID) { - if(!p.isViewerUIGod) + if(!p.IsViewerUIGod) killsToSendto.Add(p); // they dont see me - if(!isViewerUIGod) + if(!IsViewerUIGod) killsToSendme.Add(p); // i dont see them } // only those on new parcel need see @@ -6518,7 +6518,7 @@ namespace OpenSim.Region.Framework.Scenes continue; // those not on new parcel dont see me - if (currentParcelID != p.currentParcelUUID && !p.isViewerUIGod) + if (currentParcelID != p.currentParcelUUID && !p.IsViewerUIGod) { killsToSendto.Add(p); // they dont see me } @@ -6544,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 && !isViewerUIGod) + if (previusParcelID == p.currentParcelUUID && !IsViewerUIGod) { killsToSendme.Add(p); // i dont see them } @@ -6606,7 +6606,7 @@ namespace OpenSim.Region.Framework.Scenes if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.DeleteAttachmentsFromScene(this, true); - if (!ParcelHideThisAvatar || isViewerUIGod) + if (!ParcelHideThisAvatar || IsViewerUIGod) return; List allpresences = m_scene.GetScenePresences(); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 51ab5fd324..ad7fc6c77f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5029,7 +5029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // agent must not be a god - if (presence.isViewerUIGod) return; + if (presence.IsViewerUIGod) return; // agent must be over the owners land ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); @@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; // Pushee is in GodMode this pushing object isn't owned by them - if (avatar.isViewerUIGod && m_host.OwnerID != targetID) + if (avatar.IsViewerUIGod && m_host.OwnerID != targetID) return; pusheeav = avatar; @@ -6687,7 +6687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api delegate (ScenePresence ssp) { // Gods are not listed in SL - if (!ssp.IsDeleted && !ssp.isViewerUIGod && !ssp.IsChildAgent) + if (!ssp.IsDeleted && !ssp.IsViewerUIGod && !ssp.IsChildAgent) { if (!regionWide) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index 40ad2918f2..238fefbe75 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -721,7 +721,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || !sp.isViewerUIGod) + if (sp == null || !sp.IsViewerUIGod) { LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return 0; @@ -768,7 +768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || !sp.isViewerUIGod) + if (sp == null || !sp.IsViewerUIGod) { LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); return; @@ -799,7 +799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ScenePresence sp = World.GetScenePresence(m_host.OwnerID); - if (sp == null || !sp.isViewerUIGod) + if (sp == null || !sp.IsViewerUIGod) { LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners."); return 0; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index bd53700c4b..1808c34507 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -540,7 +540,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } } - if (presence.IsDeleted || presence.IsChildAgent || presence.isViewerUIGod) + if (presence.IsDeleted || presence.IsChildAgent || presence.IsViewerUIGod) return; // if the object the script is in is attached and the avatar is the owner