diff options
author | Melanie Thielker | 2017-01-06 00:55:14 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-01-06 00:55:14 +0000 |
commit | ad8915f154d2ce6ba1b3a021b1725a0b0a671635 (patch) | |
tree | 431a20d28837bc3b002dcb65b60450729eb5ed8a /OpenSim/Region/CoreModules | |
parent | Add GodController class (diff) | |
download | opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.zip opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.tar.gz opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.tar.bz2 opensim-SC_OLD-ad8915f154d2ce6ba1b3a021b1725a0b0a671635.tar.xz |
Restructure god level and permissions
Create a class GodController which controls all aspects of god level,
viewer modes and user levels at ScenePresence level.
Diffstat (limited to 'OpenSim/Region/CoreModules')
10 files changed, 18 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 89fdf09..7d9f3b3 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
255 | // check user level | 255 | // check user level |
256 | if (avatar != null) | 256 | if (avatar != null) |
257 | { | 257 | { |
258 | if (avatar.UserLevel < m_levelUpload) | 258 | if (avatar.GodController.UserLevel < m_levelUpload) |
259 | { | 259 | { |
260 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false); | 260 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false); |
261 | return; | 261 | return; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 53800bb..adf5c68 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 | |||
229 | fromPos = avatar.AbsolutePosition; | 229 | fromPos = avatar.AbsolutePosition; |
230 | fromName = avatar.Name; | 230 | fromName = avatar.Name; |
231 | fromID = c.Sender.AgentId; | 231 | fromID = c.Sender.AgentId; |
232 | if (avatar.GodLevel >= 200) | 232 | if (avatar.GodController.GodLevel >= 200) |
233 | { // let gods speak to outside or things may get confusing | 233 | { // let gods speak to outside or things may get confusing |
234 | fromNamePrefix = m_adminPrefix; | 234 | fromNamePrefix = m_adminPrefix; |
235 | checkParcelHide = false; | 235 | checkParcelHide = false; |
@@ -305,7 +305,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
305 | { | 305 | { |
306 | if (checkParcelHide) | 306 | if (checkParcelHide) |
307 | { | 307 | { |
308 | if (sourceParcelID != Presencecheck.LandData.GlobalID && presence.GodLevel < 200) | 308 | if (sourceParcelID != Presencecheck.LandData.GlobalID && presence.GodController.GodLevel < 200) |
309 | return; | 309 | return; |
310 | } | 310 | } |
311 | if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true) | 311 | 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 e5bf919..9843f2e 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 | |||
118 | // If we're in god mode, we reverse the meaning. Offer | 118 | // If we're in god mode, we reverse the meaning. Offer |
119 | // calling card becomes "Take a calling card" for that | 119 | // calling card becomes "Take a calling card" for that |
120 | // person, no matter if they agree or not. | 120 | // person, no matter if they agree or not. |
121 | if (sp.GodLevel >= 200) | 121 | if (sp.GodController.GodLevel >= 200) |
122 | { | 122 | { |
123 | CreateCallingCard(client.AgentId, destID, UUID.Zero, true); | 123 | CreateCallingCard(client.AgentId, destID, UUID.Zero, true); |
124 | return; | 124 | return; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index ac05a6e..82154bc 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
141 | if (avatar == null) | 141 | if (avatar == null) |
142 | return; | 142 | return; |
143 | 143 | ||
144 | if (avatar.UserLevel < m_levelHGFriends) | 144 | if (avatar.GodController.UserLevel < m_levelHGFriends) |
145 | { | 145 | { |
146 | client.SendAgentAlertMessage("Unable to send friendship invitation to foreigner. Insufficient permissions.", false); | 146 | client.SendAgentAlertMessage("Unable to send friendship invitation to foreigner. Insufficient permissions.", false); |
147 | return; | 147 | return; |
@@ -844,4 +844,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
844 | return false; | 844 | return false; |
845 | } | 845 | } |
846 | } | 846 | } |
847 | } \ No newline at end of file | 847 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 8d3c10d..b7ae298 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 | |||
173 | 173 | ||
174 | sp.GrantGodlikePowers(token, godLike); | 174 | sp.GrantGodlikePowers(token, godLike); |
175 | 175 | ||
176 | if (godLike && sp.GodLevel < 200 && DialogModule != null) | 176 | if (godLike && sp.GodController.GodLevel < 200 && DialogModule != null) |
177 | DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); | 177 | DialogModule.SendAlertToUser(agentID, "Request for god powers denied"); |
178 | } | 178 | } |
179 | 179 | ||
@@ -194,14 +194,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
194 | int godlevel = 200; | 194 | int godlevel = 200; |
195 | // update level so higher gods can kick lower ones | 195 | // update level so higher gods can kick lower ones |
196 | ScenePresence god = m_scene.GetScenePresence(godID); | 196 | ScenePresence god = m_scene.GetScenePresence(godID); |
197 | if(god != null && god.GodLevel > godlevel) | 197 | if(god != null && god.GodController.GodLevel > godlevel) |
198 | godlevel = god.GodLevel; | 198 | godlevel = god.GodController.GodLevel; |
199 | 199 | ||
200 | if(agentID == ALL_AGENTS) | 200 | if(agentID == ALL_AGENTS) |
201 | { | 201 | { |
202 | m_scene.ForEachRootScenePresence(delegate(ScenePresence p) | 202 | m_scene.ForEachRootScenePresence(delegate(ScenePresence p) |
203 | { | 203 | { |
204 | if (p.UUID != godID && godlevel > p.GodLevel) | 204 | if (p.UUID != godID && godlevel > p.GodController.GodLevel) |
205 | doKickmodes(godID, p, kickflags, reason); | 205 | doKickmodes(godID, p, kickflags, reason); |
206 | }); | 206 | }); |
207 | return; | 207 | return; |
@@ -224,7 +224,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
224 | return; | 224 | return; |
225 | } | 225 | } |
226 | 226 | ||
227 | if (godlevel <= sp.GodLevel) // no god wars | 227 | if (godlevel <= sp.GodController.GodLevel) // no god wars |
228 | return; | 228 | return; |
229 | 229 | ||
230 | if(sp.UUID == godID) | 230 | if(sp.UUID == godID) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs index c517a30..bd95ff0 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 | |||
169 | 169 | ||
170 | GridInstantMessage m; | 170 | GridInstantMessage m; |
171 | 171 | ||
172 | if (scene.Permissions.IsAdministrator(client.AgentId) && presence.GodLevel >= 200 && (!scene.Permissions.IsAdministrator(targetid))) | 172 | if (scene.Permissions.IsAdministrator(client.AgentId) && presence.GodController.GodLevel >= 200 && (!scene.Permissions.IsAdministrator(targetid))) |
173 | { | 173 | { |
174 | m = new GridInstantMessage(scene, client.AgentId, | 174 | m = new GridInstantMessage(scene, client.AgentId, |
175 | client.FirstName+" "+client.LastName, targetid, | 175 | client.FirstName+" "+client.LastName, targetid, |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ebebfd0..d0e5d86 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -2077,7 +2077,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2077 | agentpos.Position = sp.AbsolutePosition; | 2077 | agentpos.Position = sp.AbsolutePosition; |
2078 | agentpos.Velocity = sp.Velocity; | 2078 | agentpos.Velocity = sp.Velocity; |
2079 | agentpos.RegionHandle = currentRegionHandler; | 2079 | agentpos.RegionHandle = currentRegionHandler; |
2080 | agentpos.GodLevel = sp.GodLevel; | 2080 | //agentpos.GodLevel = sp.GodLevel; |
2081 | agentpos.GodData = sp.GodController.State(); | ||
2081 | agentpos.Throttles = spClient.GetThrottlesPacked(1); | 2082 | agentpos.Throttles = spClient.GetThrottlesPacked(1); |
2082 | // agentpos.ChildrenCapSeeds = seeds; | 2083 | // agentpos.ChildrenCapSeeds = seeds; |
2083 | 2084 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 4ad500a..1ce6927 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -272,7 +272,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
272 | { | 272 | { |
273 | // this user is going to another grid | 273 | // this user is going to another grid |
274 | // for local users, check if HyperGrid teleport is allowed, based on user level | 274 | // for local users, check if HyperGrid teleport is allowed, based on user level |
275 | if (Scene.UserManagementModule.IsLocalGridUser(sp.UUID) && sp.UserLevel < m_levelHGTeleport) | 275 | if (Scene.UserManagementModule.IsLocalGridUser(sp.UUID) && sp.GodController.UserLevel < m_levelHGTeleport) |
276 | { | 276 | { |
277 | m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel."); | 277 | m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel."); |
278 | reason = "Hypergrid teleport not allowed"; | 278 | reason = "Hypergrid teleport not allowed"; |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 63b8de0..3a8d6b7 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1977,7 +1977,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1977 | ScenePresence SP; | 1977 | ScenePresence SP; |
1978 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP); | 1978 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP); |
1979 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); | 1979 | List<SceneObjectGroup> returns = new List<SceneObjectGroup>(); |
1980 | if (SP.UserLevel != 0) | 1980 | if (SP.GodController.UserLevel != 0) |
1981 | { | 1981 | { |
1982 | if (flags == 0) //All parcels, scripted or not | 1982 | if (flags == 0) //All parcels, scripted or not |
1983 | { | 1983 | { |
@@ -2043,7 +2043,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
2043 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); | 2043 | ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager); |
2044 | System.Threading.Timer Timer; | 2044 | System.Threading.Timer Timer; |
2045 | 2045 | ||
2046 | if (targetAvatar.UserLevel == 0) | 2046 | if (targetAvatar.GodController.UserLevel == 0) |
2047 | { | 2047 | { |
2048 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); | 2048 | ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y); |
2049 | if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true)) | 2049 | if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze, true)) |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 1a61771..02d0e02 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -547,7 +547,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
547 | { | 547 | { |
548 | ScenePresence sp = m_scene.GetScenePresence(user); | 548 | ScenePresence sp = m_scene.GetScenePresence(user); |
549 | if (sp != null) | 549 | if (sp != null) |
550 | return (sp.UserLevel >= 200); | 550 | return (sp.GodController.UserLevel >= 200); |
551 | 551 | ||
552 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); | 552 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); |
553 | if (account != null) | 553 | if (account != null) |