aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/GodController.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-01-07 18:10:30 +0000
committerUbitUmarov2017-01-07 18:10:30 +0000
commit5bcb1c0e721322238e84eee21cf2513d6111fb69 (patch)
treebc895cd69030571383c02f124dd4af5a3a648d2d /OpenSim/Region/Framework/Scenes/GodController.cs
parentupdate permissions module with the new options (diff)
downloadopensim-SC-5bcb1c0e721322238e84eee21cf2513d6111fb69.zip
opensim-SC-5bcb1c0e721322238e84eee21cf2513d6111fb69.tar.gz
opensim-SC-5bcb1c0e721322238e84eee21cf2513d6111fb69.tar.bz2
opensim-SC-5bcb1c0e721322238e84eee21cf2513d6111fb69.tar.xz
rename same variables to make their meaning more clear
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/GodController.cs51
1 files changed, 25 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/GodController.cs b/OpenSim/Region/Framework/Scenes/GodController.cs
index 8035760..ac11ba9 100644
--- a/OpenSim/Region/Framework/Scenes/GodController.cs
+++ b/OpenSim/Region/Framework/Scenes/GodController.cs
@@ -66,9 +66,9 @@ namespace OpenSim.Region.Framework.Scenes
66 // the god level from local or grid user rights 66 // the god level from local or grid user rights
67 protected int m_rightsGodLevel = 0; 67 protected int m_rightsGodLevel = 0;
68 // the level seen by viewers 68 // the level seen by viewers
69 protected int m_godlevel = 0; 69 protected int m_viewergodlevel = 0;
70 // new level that can be fixed or equal to godlevel, acording to options 70 // new level that can be fixed or equal to godlevel, acording to options
71 protected int m_effectivegodlevel = 0; 71 protected int m_godlevel = 0;
72 protected int m_lastLevelToViewer = 0; 72 protected int m_lastLevelToViewer = 0;
73 73
74 public GodController(Scene scene, ScenePresence sp, int userlevel) 74 public GodController(Scene scene, ScenePresence sp, int userlevel)
@@ -127,19 +127,18 @@ namespace OpenSim.Region.Framework.Scenes
127 127
128 if(m_allowGodActionsWithoutGodMode) 128 if(m_allowGodActionsWithoutGodMode)
129 { 129 {
130 m_effectivegodlevel = m_rightsGodLevel; 130 m_godlevel = m_rightsGodLevel;
131
132 m_forceGodModeAlwaysOn = false; 131 m_forceGodModeAlwaysOn = false;
133 } 132 }
134 133
135 else if(m_forceGodModeAlwaysOn) 134 else if(m_forceGodModeAlwaysOn)
136 { 135 {
136 m_viewergodlevel = m_rightsGodLevel;
137 m_godlevel = m_rightsGodLevel; 137 m_godlevel = m_rightsGodLevel;
138 m_effectivegodlevel = m_rightsGodLevel;
139 } 138 }
140 139
141 m_scenePresence.isGod = (m_effectivegodlevel >= 200); 140 m_scenePresence.isGod = (m_godlevel >= 200);
142 m_scenePresence.isLegacyGod = (m_godlevel >= 200); 141 m_scenePresence.isViewerUIGod = (m_viewergodlevel >= 200);
143 } 142 }
144 143
145 // calculates god level at sp creation from local and grid user god rights 144 // calculates god level at sp creation from local and grid user god rights
@@ -175,10 +174,10 @@ namespace OpenSim.Region.Framework.Scenes
175 { 174 {
176 if(!CanBeGod()) 175 if(!CanBeGod())
177 { 176 {
177 m_viewergodlevel = 0;
178 m_godlevel = 0; 178 m_godlevel = 0;
179 m_effectivegodlevel = 0;
180 m_scenePresence.isGod = false; 179 m_scenePresence.isGod = false;
181 m_scenePresence.isLegacyGod = false; 180 m_scenePresence.isViewerUIGod = false;
182 return; 181 return;
183 } 182 }
184 183
@@ -186,58 +185,58 @@ namespace OpenSim.Region.Framework.Scenes
186 if(m_allowGodActionsWithoutGodMode) 185 if(m_allowGodActionsWithoutGodMode)
187 { 186 {
188 if(viewerState) 187 if(viewerState)
189 m_godlevel = m_rightsGodLevel; 188 m_viewergodlevel = m_rightsGodLevel;
190 else 189 else
191 m_godlevel = 0; 190 m_viewergodlevel = 0;
192 191
193 m_effectivegodlevel = m_rightsGodLevel; 192 m_godlevel = m_rightsGodLevel;
194 } 193 }
195 else 194 else
196 { 195 {
197 // new all change with viewer 196 // new all change with viewer
198 if(viewerState) 197 if(viewerState)
199 { 198 {
199 m_viewergodlevel = m_rightsGodLevel;
200 m_godlevel = m_rightsGodLevel; 200 m_godlevel = m_rightsGodLevel;
201 m_effectivegodlevel = m_rightsGodLevel;
202 } 201 }
203 else 202 else
204 { 203 {
204 m_viewergodlevel = 0;
205 m_godlevel = 0; 205 m_godlevel = 0;
206 m_effectivegodlevel = 0;
207 } 206 }
208 } 207 }
209 m_scenePresence.isGod = (m_effectivegodlevel >= 200); 208 m_scenePresence.isGod = (m_godlevel >= 200);
210 m_scenePresence.isLegacyGod = (m_godlevel >= 200); 209 m_scenePresence.isViewerUIGod = (m_viewergodlevel >= 200);
211 } 210 }
212 211
213 public void SyncViewerState() 212 public void SyncViewerState()
214 { 213 {
215 if(m_lastLevelToViewer == m_godlevel) 214 if(m_lastLevelToViewer == m_viewergodlevel)
216 return; 215 return;
217 216
218 m_lastLevelToViewer = m_godlevel; 217 m_lastLevelToViewer = m_viewergodlevel;
219 218
220 if(m_scenePresence.IsChildAgent) 219 if(m_scenePresence.IsChildAgent)
221 return; 220 return;
222 221
223 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); 222 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_viewergodlevel);
224 } 223 }
225 224
226 public void RequestGodMode(bool god) 225 public void RequestGodMode(bool god)
227 { 226 {
228 UpdateGodLevels(god); 227 UpdateGodLevels(god);
229 228
230 if(m_lastLevelToViewer != m_godlevel) 229 if(m_lastLevelToViewer != m_viewergodlevel)
231 { 230 {
232 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_godlevel); 231 m_scenePresence.ControllingClient.SendAdminResponse(UUID.Zero, (uint)m_viewergodlevel);
233 m_lastLevelToViewer = m_godlevel; 232 m_lastLevelToViewer = m_viewergodlevel;
234 } 233 }
235 } 234 }
236 235
237 public OSD State() 236 public OSD State()
238 { 237 {
239 OSDMap godMap = new OSDMap(2); 238 OSDMap godMap = new OSDMap(2);
240 bool m_viewerUiIsGod = m_godlevel >= 200; 239 bool m_viewerUiIsGod = m_viewergodlevel >= 200;
241 godMap.Add("ViewerUiIsGod", OSD.FromBoolean(m_viewerUiIsGod)); 240 godMap.Add("ViewerUiIsGod", OSD.FromBoolean(m_viewerUiIsGod));
242 241
243 return godMap; 242 return godMap;
@@ -256,7 +255,7 @@ namespace OpenSim.Region.Framework.Scenes
256 255
257 if (s.ContainsKey("ViewerUiIsGod")) 256 if (s.ContainsKey("ViewerUiIsGod"))
258 newstate = s["ViewerUiIsGod"].AsBoolean(); 257 newstate = s["ViewerUiIsGod"].AsBoolean();
259 m_lastLevelToViewer = m_godlevel; // we are not changing viewer level by default 258 m_lastLevelToViewer = m_viewergodlevel; // we are not changing viewer level by default
260 } 259 }
261 } 260 }
262 UpdateGodLevels(newstate); 261 UpdateGodLevels(newstate);
@@ -275,12 +274,12 @@ namespace OpenSim.Region.Framework.Scenes
275 274
276 public int GodLevel 275 public int GodLevel
277 { 276 {
278 get { return m_godlevel; } 277 get { return m_viewergodlevel; }
279 } 278 }
280 279
281 public int EffectiveLevel 280 public int EffectiveLevel
282 { 281 {
283 get { return m_effectivegodlevel; } 282 get { return m_godlevel; }
284 } 283 }
285 } 284 }
286} 285}