replace godlevel compares by the new faster bool isViewerUIGod

melanie
UbitUmarov 2017-01-07 18:41:46 +00:00
parent 5bcb1c0e72
commit effa32cfa4
8 changed files with 13 additions and 13 deletions

View File

@ -11455,7 +11455,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ScenePresence p; ScenePresence p;
if (scene.TryGetScenePresence(sender.AgentId, out p)) if (scene.TryGetScenePresence(sender.AgentId, out p))
{ {
if (p.GodController.GodLevel >= 200) if (p.isViewerUIGod)
{ {
groupProfileReply.GroupData.OpenEnrollment = true; groupProfileReply.GroupData.OpenEnrollment = true;
groupProfileReply.GroupData.MembershipFee = 0; groupProfileReply.GroupData.MembershipFee = 0;

View File

@ -229,7 +229,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
fromPos = avatar.AbsolutePosition; fromPos = avatar.AbsolutePosition;
fromName = avatar.Name; fromName = avatar.Name;
fromID = c.Sender.AgentId; fromID = c.Sender.AgentId;
if (avatar.GodController.GodLevel >= 200) if (avatar.isViewerUIGod)
{ // let gods speak to outside or things may get confusing { // let gods speak to outside or things may get confusing
fromNamePrefix = m_adminPrefix; fromNamePrefix = m_adminPrefix;
checkParcelHide = false; checkParcelHide = false;
@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{ {
if (checkParcelHide) if (checkParcelHide)
{ {
if (sourceParcelID != Presencecheck.LandData.GlobalID && presence.GodController.GodLevel < 200) if (sourceParcelID != Presencecheck.LandData.GlobalID && !presence.isViewerUIGod)
return; return;
} }
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// If we're in god mode, we reverse the meaning. Offer // If we're in god mode, we reverse the meaning. Offer
// calling card becomes "Take a calling card" for that // calling card becomes "Take a calling card" for that
// person, no matter if they agree or not. // person, no matter if they agree or not.
if (sp.GodController.GodLevel >= 200) if (sp.isViewerUIGod)
{ {
CreateCallingCard(client.AgentId, destID, UUID.Zero, true); CreateCallingCard(client.AgentId, destID, UUID.Zero, true);
return; return;

View File

@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
sp.GrantGodlikePowers(token, godLike); 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"); DialogModule.SendAlertToUser(agentID, "Request for god powers denied");
} }

View File

@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
GridInstantMessage m; 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, m = new GridInstantMessage(scene, client.AgentId,
client.FirstName+" "+client.LastName, targetid, client.FirstName+" "+client.LastName, targetid,

View File

@ -5029,7 +5029,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else else
{ {
// agent must not be a god // agent must not be a god
if (presence.GodController.GodLevel >= 200) return; if (presence.isViewerUIGod) return;
// agent must be over the owners land // agent must be over the owners land
ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition);
@ -5256,7 +5256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
// Pushee is in GodMode this pushing object isn't owned by them // 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; return;
pusheeav = avatar; pusheeav = avatar;
@ -6687,7 +6687,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
delegate (ScenePresence ssp) delegate (ScenePresence ssp)
{ {
// Gods are not listed in SL // 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) if (!regionWide)
{ {

View File

@ -721,7 +721,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
ScenePresence sp = World.GetScenePresence(m_host.OwnerID); 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."); LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
return 0; return 0;
@ -768,7 +768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
ScenePresence sp = World.GetScenePresence(m_host.OwnerID); 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."); LSShoutError("lsSetWindlightScene can only be used by estate managers or owners.");
return; return;
@ -799,7 +799,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
ScenePresence sp = World.GetScenePresence(m_host.OwnerID); 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."); LSShoutError("lsSetWindlightSceneTargeted can only be used by estate managers or owners.");
return 0; return 0;

View File

@ -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; return;
// if the object the script is in is attached and the avatar is the owner // if the object the script is in is attached and the avatar is the owner