diff options
Diffstat (limited to 'OpenSim/Region/Environment')
4 files changed, 133 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs index c757461..0ea2c03 100644 --- a/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Environment/Interfaces/IRegionDataStore.cs | |||
@@ -72,6 +72,12 @@ namespace OpenSim.Region.Environment.Interfaces | |||
72 | void RemoveLandObject(LLUUID globalID); | 72 | void RemoveLandObject(LLUUID globalID); |
73 | List<LandData> LoadLandObjects(LLUUID regionUUID); | 73 | List<LandData> LoadLandObjects(LLUUID regionUUID); |
74 | 74 | ||
75 | List<RegionBanListItem> LoadRegionBanList(LLUUID regionUUID); | ||
76 | void AddToRegionBanlist(RegionBanListItem item); | ||
77 | void RemoveFromRegionBanlist(RegionBanListItem item); | ||
78 | |||
79 | |||
80 | |||
75 | void Shutdown(); | 81 | void Shutdown(); |
76 | } | 82 | } |
77 | } | 83 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs index 147e4aa..b6d2ab4 100644 --- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs | |||
@@ -51,6 +51,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
51 | { | 51 | { |
52 | remote_client.sendDetailedEstateData(invoice,m_scene.RegionInfo.EstateSettings.estateName,m_scene.RegionInfo.EstateSettings.estateID); | 52 | remote_client.sendDetailedEstateData(invoice,m_scene.RegionInfo.EstateSettings.estateName,m_scene.RegionInfo.EstateSettings.estateID); |
53 | remote_client.sendEstateManagersList(invoice,m_scene.RegionInfo.EstateSettings.estateManagers,m_scene.RegionInfo.EstateSettings.estateID); | 53 | remote_client.sendEstateManagersList(invoice,m_scene.RegionInfo.EstateSettings.estateManagers,m_scene.RegionInfo.EstateSettings.estateID); |
54 | remote_client.sendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); | ||
54 | } | 55 | } |
55 | 56 | ||
56 | private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, | 57 | private void estateSetRegionInfoHandler(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, |
@@ -206,6 +207,89 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
206 | 207 | ||
207 | switch (estateAccessType) | 208 | switch (estateAccessType) |
208 | { | 209 | { |
210 | case 64: | ||
211 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) | ||
212 | { | ||
213 | RegionBanListItem[] banlistcheck = m_scene.RegionInfo.regionBanlist.ToArray(); | ||
214 | |||
215 | bool alreadyInList = false; | ||
216 | |||
217 | for (int i = 0; i < banlistcheck.Length; i++) | ||
218 | { | ||
219 | if (user == banlistcheck[i].bannedUUID) | ||
220 | { | ||
221 | alreadyInList = true; | ||
222 | break; | ||
223 | } | ||
224 | |||
225 | } | ||
226 | if (!alreadyInList) | ||
227 | { | ||
228 | |||
229 | RegionBanListItem item = new RegionBanListItem(); | ||
230 | |||
231 | item.bannedUUID = user; | ||
232 | item.regionUUID = m_scene.RegionInfo.RegionID; | ||
233 | item.bannedIP = "0.0.0.0"; | ||
234 | item.bannedIPHostMask = "0.0.0.0"; | ||
235 | |||
236 | m_scene.RegionInfo.regionBanlist.Add(item); | ||
237 | m_scene.AddToRegionBanlist(item); | ||
238 | |||
239 | ScenePresence s = m_scene.GetScenePresence(user); | ||
240 | if (s != null) | ||
241 | { | ||
242 | m_scene.TeleportClientHome(user, s.ControllingClient); | ||
243 | } | ||
244 | |||
245 | } | ||
246 | else | ||
247 | { | ||
248 | remote_client.SendAlertMessage("User is already on the region ban list"); | ||
249 | } | ||
250 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | ||
251 | remote_client.sendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); | ||
252 | } | ||
253 | else | ||
254 | { | ||
255 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
256 | } | ||
257 | break; | ||
258 | case 128: | ||
259 | if (m_scene.ExternalChecks.ExternalChecksCanIssueEstateCommand(remote_client.AgentId) || m_scene.ExternalChecks.ExternalChecksBypassPermissions()) | ||
260 | { | ||
261 | RegionBanListItem[] banlistcheck = m_scene.RegionInfo.regionBanlist.ToArray(); | ||
262 | |||
263 | bool alreadyInList = false; | ||
264 | RegionBanListItem listitem = null; | ||
265 | |||
266 | for (int i = 0; i < banlistcheck.Length; i++) | ||
267 | { | ||
268 | if (user == banlistcheck[i].bannedUUID) | ||
269 | { | ||
270 | alreadyInList = true; | ||
271 | listitem = banlistcheck[i]; | ||
272 | break; | ||
273 | } | ||
274 | |||
275 | } | ||
276 | if (alreadyInList && listitem != null) | ||
277 | { | ||
278 | m_scene.RegionInfo.regionBanlist.Remove(listitem); | ||
279 | m_scene.RemoveFromRegionBanlist(listitem); | ||
280 | } | ||
281 | else | ||
282 | { | ||
283 | remote_client.SendAlertMessage("User is not on the region ban list"); | ||
284 | } | ||
285 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | ||
286 | remote_client.sendBannedUserList(invoice, m_scene.RegionInfo.regionBanlist, m_scene.RegionInfo.EstateSettings.estateID); | ||
287 | } | ||
288 | else | ||
289 | { | ||
290 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
291 | } | ||
292 | break; | ||
209 | case 256: | 293 | case 256: |
210 | 294 | ||
211 | // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml | 295 | // This needs to be updated for SuperEstateOwnerUser.. a non existing user in the estatesettings.xml |
@@ -237,7 +321,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate | |||
237 | 321 | ||
238 | default: | 322 | default: |
239 | 323 | ||
240 | m_log.Error("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta"); | 324 | m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString()); |
241 | break; | 325 | break; |
242 | } | 326 | } |
243 | } | 327 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index a242ebe..50403b9 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs | |||
@@ -743,6 +743,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC | |||
743 | public void sendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID) | 743 | public void sendEstateManagersList(LLUUID invoice, LLUUID[] EstateManagers, uint estateID) |
744 | { | 744 | { |
745 | } | 745 | } |
746 | |||
747 | public void sendBannedUserList(LLUUID invoice, List<RegionBanListItem> banlist, uint estateID) | ||
748 | { | ||
749 | } | ||
750 | |||
746 | public void sendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) | 751 | public void sendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) |
747 | { | 752 | { |
748 | } | 753 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index cfebd14..73b3a49 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1437,6 +1437,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1437 | } | 1437 | } |
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | public void LoadRegionBanlist() | ||
1441 | { | ||
1442 | List<RegionBanListItem> regionbanlist = m_storageManager.DataStore.LoadRegionBanList(m_regInfo.RegionID); | ||
1443 | m_regInfo.regionBanlist = regionbanlist; | ||
1444 | } | ||
1445 | public void AddToRegionBanlist(RegionBanListItem item) | ||
1446 | { | ||
1447 | m_storageManager.DataStore.AddToRegionBanlist(item); | ||
1448 | } | ||
1449 | |||
1450 | public void RemoveFromRegionBanlist(RegionBanListItem item) | ||
1451 | { | ||
1452 | m_storageManager.DataStore.RemoveFromRegionBanlist(item); | ||
1453 | } | ||
1440 | #endregion | 1454 | #endregion |
1441 | 1455 | ||
1442 | #region Primitives Methods | 1456 | #region Primitives Methods |
@@ -1854,6 +1868,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
1854 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | 1868 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); |
1855 | if (RootPrim != null) | 1869 | if (RootPrim != null) |
1856 | { | 1870 | { |
1871 | if (m_regInfo.CheckIfUserBanned(RootPrim.OwnerID)) | ||
1872 | { | ||
1873 | SceneObjectGroup grp = RootPrim.ParentGroup; | ||
1874 | if (grp != null) | ||
1875 | { | ||
1876 | DeleteSceneObject(grp); | ||
1877 | } | ||
1878 | |||
1879 | m_log.Info("[INTERREGION]: Denied prim crossing for banned avatar"); | ||
1880 | |||
1881 | return false; | ||
1882 | } | ||
1857 | if (RootPrim.Shape.PCode == (byte)PCode.Prim) | 1883 | if (RootPrim.Shape.PCode == (byte)PCode.Prim) |
1858 | { | 1884 | { |
1859 | SceneObjectGroup grp = RootPrim.ParentGroup; | 1885 | SceneObjectGroup grp = RootPrim.ParentGroup; |
@@ -2333,6 +2359,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
2333 | { | 2359 | { |
2334 | if (regionHandle == m_regInfo.RegionHandle) | 2360 | if (regionHandle == m_regInfo.RegionHandle) |
2335 | { | 2361 | { |
2362 | if (m_regInfo.CheckIfUserBanned(agent.AgentID)) | ||
2363 | { | ||
2364 | m_log.WarnFormat( | ||
2365 | "[CONNECTION DEBUGGING]: Denied access to: {0} [{1}] at {2} because the user is on the region banlist", | ||
2366 | agent.AgentID, regionHandle, RegionInfo.RegionName); | ||
2367 | } | ||
2368 | |||
2336 | capsPaths[agent.AgentID] = agent.CapsPath; | 2369 | capsPaths[agent.AgentID] = agent.CapsPath; |
2337 | 2370 | ||
2338 | if (!agent.child) | 2371 | if (!agent.child) |
@@ -3599,5 +3632,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
3599 | } | 3632 | } |
3600 | 3633 | ||
3601 | #endregion | 3634 | #endregion |
3635 | |||
3636 | |||
3602 | } | 3637 | } |
3603 | } | 3638 | } |
3639 | |||
3640 | \ No newline at end of file | ||