aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2017-01-06 10:28:10 +0000
committerUbitUmarov2017-01-06 10:28:10 +0000
commitc7079555174bf34fc7df9622a3601f8a305cd2b7 (patch)
treec41d06b276947e73ddf3ff9bb4ec391bae98a932 /OpenSim/Region
parentfix/simplify validation of god_data update field (diff)
downloadopensim-SC-c7079555174bf34fc7df9622a3601f8a305cd2b7.zip
opensim-SC-c7079555174bf34fc7df9622a3601f8a305cd2b7.tar.gz
opensim-SC-c7079555174bf34fc7df9622a3601f8a305cd2b7.tar.bz2
opensim-SC-c7079555174bf34fc7df9622a3601f8a305cd2b7.tar.xz
restore parcels avatars visibility god level change correct handling; try to reduced the increased change of user error on config options setting
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/GodController.cs44
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs8
2 files changed, 28 insertions, 24 deletions
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
50 ScenePresence m_scenePresence; 50 ScenePresence m_scenePresence;
51 Scene m_scene; 51 Scene m_scene;
52 protected bool m_allowGridGods; 52 protected bool m_allowGridGods;
53 protected bool m_forceGridGods; 53 protected bool m_forceGridGodsOnly;
54 protected bool m_regionOwnerIsGod; 54 protected bool m_regionOwnerIsGod;
55 protected bool m_regionManagerIsGod; 55 protected bool m_regionManagerIsGod;
56 protected bool m_parcelOwnerIsGod; 56 protected bool m_parcelOwnerIsGod;
@@ -78,25 +78,30 @@ namespace OpenSim.Region.Framework.Scenes
78 "allow_grid_gods", sections, false); 78 "allow_grid_gods", sections, false);
79 79
80 // If grid gods are active, dont allow any other gods 80 // If grid gods are active, dont allow any other gods
81 m_forceGridGods = 81 m_forceGridGodsOnly =
82 Util.GetConfigVarFromSections<bool>(config, 82 Util.GetConfigVarFromSections<bool>(config,
83 "force_grid_gods", sections, false); 83 "force_grid_gods_only", sections, false);
84 84
85 // The owner of a region is a god in his region only. 85 if(!m_forceGridGodsOnly) // damm redundant and error prone option
86 m_regionOwnerIsGod = 86 {
87 // The owner of a region is a god in his region only.
88 m_regionOwnerIsGod =
87 Util.GetConfigVarFromSections<bool>(config, 89 Util.GetConfigVarFromSections<bool>(config,
88 "region_owner_is_god", sections, true); 90 "region_owner_is_god", sections, true);
89 91
90 // Region managers are gods in the regions they manage. 92 // Region managers are gods in the regions they manage.
91 m_regionManagerIsGod = 93 m_regionManagerIsGod =
92 Util.GetConfigVarFromSections<bool>(config, 94 Util.GetConfigVarFromSections<bool>(config,
93 "region_manager_is_god", sections, false); 95 "region_manager_is_god", sections, false);
94 96
95 // Parcel owners are gods in their own parcels only. 97 // Parcel owners are gods in their own parcels only.
96 m_parcelOwnerIsGod = 98 m_parcelOwnerIsGod =
97 Util.GetConfigVarFromSections<bool>(config, 99 Util.GetConfigVarFromSections<bool>(config,
98 "parcel_owner_is_god", sections, false); 100 "parcel_owner_is_god", sections, false);
99 101 }
102 else
103 m_allowGridGods = true; // reduce user mistakes increased by this over complex options set
104
100 // God mode should be turned on in the viewer whenever 105 // God mode should be turned on in the viewer whenever
101 // the user has god rights somewhere. They may choose 106 // the user has god rights somewhere. They may choose
102 // to turn it off again, though. 107 // to turn it off again, though.
@@ -110,13 +115,12 @@ namespace OpenSim.Region.Framework.Scenes
110 m_allowGodActionsWithoutGodMode = 115 m_allowGodActionsWithoutGodMode =
111 Util.GetConfigVarFromSections<bool>(config, 116 Util.GetConfigVarFromSections<bool>(config,
112 "implicit_gods", sections, false); 117 "implicit_gods", sections, false);
113
114 } 118 }
115 119
116 protected int PotentialGodLevel() 120 protected int PotentialGodLevel()
117 { 121 {
118 int godLevel = m_allowGridGods ? m_userLevel : 200; 122 int godLevel = m_allowGridGods ? m_userLevel : 200;
119 if ((!m_forceGridGods) && m_userLevel < 200) 123 if ((!m_forceGridGodsOnly) && m_userLevel < 200)
120 godLevel = 200; 124 godLevel = 200;
121 125
122 return godLevel; 126 return godLevel;
@@ -127,6 +131,9 @@ namespace OpenSim.Region.Framework.Scenes
127 if (m_allowGridGods && m_userLevel > 0) 131 if (m_allowGridGods && m_userLevel > 0)
128 return true; 132 return true;
129 133
134 if(m_forceGridGodsOnly)
135 return false;
136
130 if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID)) 137 if (m_regionOwnerIsGod && m_scene.RegionInfo.EstateSettings.IsEstateOwner(m_scenePresence.UUID))
131 return true; 138 return true;
132 139
@@ -164,13 +171,12 @@ namespace OpenSim.Region.Framework.Scenes
164 171
165 public bool RequestGodMode(bool god) 172 public bool RequestGodMode(bool god)
166 { 173 {
174 // this is used by viewer protocol
175 // and they may want a answer
167 if (!god) 176 if (!god)
168 { 177 {
169 if (m_viewerUiIsGod) 178 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, 0);
170 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, 0);
171
172 m_viewerUiIsGod = false; 179 m_viewerUiIsGod = false;
173
174 return true; 180 return true;
175 } 181 }
176 182
@@ -178,12 +184,8 @@ namespace OpenSim.Region.Framework.Scenes
178 return false; 184 return false;
179 185
180 int godLevel = PotentialGodLevel(); 186 int godLevel = PotentialGodLevel();
181 187 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel);
182 if (!m_viewerUiIsGod)
183 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)godLevel);
184
185 m_viewerUiIsGod = true; 188 m_viewerUiIsGod = true;
186
187 return true; 189 return true;
188 } 190 }
189 191
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
4509 if (isNPC) 4509 if (isNPC)
4510 return; 4510 return;
4511 4511
4512 bool success = GodController.RequestGodMode(godStatus); 4512 bool wasgod = (GodController.GodLevel >= 200);
4513 if (success && godStatus) 4513 GodController.RequestGodMode(godStatus);
4514 parcelGodCheck(m_currentParcelUUID, GodController.GodLevel >= 200); 4514 bool isgod = GodController.GodLevel >= 200;
4515 if (wasgod != isgod)
4516 parcelGodCheck(m_currentParcelUUID, isgod);
4515 } 4517 }
4516 4518
4517 #region Child Agent Updates 4519 #region Child Agent Updates