aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorCharles Krinke2008-06-26 13:45:36 +0000
committerCharles Krinke2008-06-26 13:45:36 +0000
commita58a47a7592799813b92aacfb0af4c0b753c899d (patch)
tree1aa062da5c9d65080c27d8e72347dd143cbea759 /OpenSim/Region/Environment
parentMantis#1602. Thank you, Kinoc for a patch to: (diff)
downloadopensim-SC_OLD-a58a47a7592799813b92aacfb0af4c0b753c899d.zip
opensim-SC_OLD-a58a47a7592799813b92aacfb0af4c0b753c899d.tar.gz
opensim-SC_OLD-a58a47a7592799813b92aacfb0af4c0b753c899d.tar.bz2
opensim-SC_OLD-a58a47a7592799813b92aacfb0af4c0b753c899d.tar.xz
Mantis#1597. Thank you, Melanie for a patch that:
Adds handlers for the reclaim land functionality, plus all needed permissions checks.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs18
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs1
-rw-r--r--OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs25
4 files changed, 52 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
index 984bc4e..05bd983 100644
--- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs
@@ -94,6 +94,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
94 client.OnParcelAccessListRequest += new ParcelAccessListRequest(handleParcelAccessRequest); 94 client.OnParcelAccessListRequest += new ParcelAccessListRequest(handleParcelAccessRequest);
95 client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(handleParcelAccessUpdateRequest); 95 client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(handleParcelAccessUpdateRequest);
96 client.OnParcelAbandonRequest += new ParcelAbandonRequest(handleParcelAbandonRequest); 96 client.OnParcelAbandonRequest += new ParcelAbandonRequest(handleParcelAbandonRequest);
97 client.OnParcelReclaim += new ParcelReclaim(handleParcelReclaim);
97 98
98 if (m_scene.Entities.ContainsKey(client.AgentId)) 99 if (m_scene.Entities.ContainsKey(client.AgentId))
99 { 100 {
@@ -932,6 +933,21 @@ namespace OpenSim.Region.Environment.Modules.World.Land
932 { 933 {
933 landList[local_id].landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; 934 landList[local_id].landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
934 m_scene.Broadcast(SendParcelOverlay); 935 m_scene.Broadcast(SendParcelOverlay);
936 landList[local_id].sendLandUpdateToClient(remote_client);
937 }
938 }
939
940 }
941
942 public void handleParcelReclaim(int local_id, IClientAPI remote_client)
943 {
944 if (landList.ContainsKey(local_id))
945 {
946 if (m_scene.ExternalChecks.ExternalChecksCanReclaimParcel(remote_client.AgentId, landList[local_id]))
947 {
948 landList[local_id].landData.ownerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;
949 m_scene.Broadcast(SendParcelOverlay);
950 landList[local_id].sendLandUpdateToClient(remote_client);
935 } 951 }
936 } 952 }
937 953
@@ -1060,4 +1076,4 @@ namespace OpenSim.Region.Environment.Modules.World.Land
1060 } 1076 }
1061 } 1077 }
1062 1078
1063} \ No newline at end of file 1079}
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index f4d2848..05a4146 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -243,6 +243,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
243 public event ParcelJoinRequest OnParcelJoinRequest; 243 public event ParcelJoinRequest OnParcelJoinRequest;
244 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; 244 public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
245 public event ParcelAbandonRequest OnParcelAbandonRequest; 245 public event ParcelAbandonRequest OnParcelAbandonRequest;
246 public event ParcelReclaim OnParcelReclaim;
246 public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; 247 public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest;
247 public event ParcelAccessListRequest OnParcelAccessListRequest; 248 public event ParcelAccessListRequest OnParcelAccessListRequest;
248 public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; 249 public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest;
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index a851cad..e8defb7 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -143,6 +143,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
143 m_scene.ExternalChecks.addSetBypassPermissions(SetBypassPermissions); //FULLY IMPLEMENTED 143 m_scene.ExternalChecks.addSetBypassPermissions(SetBypassPermissions); //FULLY IMPLEMENTED
144 m_scene.ExternalChecks.addPropagatePermissions(PropagatePermissions); //FULLY IMPLEMENTED 144 m_scene.ExternalChecks.addPropagatePermissions(PropagatePermissions); //FULLY IMPLEMENTED
145 m_scene.ExternalChecks.addCheckAbandonParcel(CanAbandonParcel); //FULLY IMPLEMENTED 145 m_scene.ExternalChecks.addCheckAbandonParcel(CanAbandonParcel); //FULLY IMPLEMENTED
146 m_scene.ExternalChecks.addCheckReclaimParcel(CanReclaimParcel); //FULLY IMPLEMENTED
146 m_scene.ExternalChecks.addGenerateClientFlags(GenerateClientFlags); //NOT YET FULLY IMPLEMENTED 147 m_scene.ExternalChecks.addGenerateClientFlags(GenerateClientFlags); //NOT YET FULLY IMPLEMENTED
147 m_scene.ExternalChecks.addCheckBeGodLike(CanBeGodLike); //FULLY IMPLEMENTED 148 m_scene.ExternalChecks.addCheckBeGodLike(CanBeGodLike); //FULLY IMPLEMENTED
148 m_scene.ExternalChecks.addCheckDuplicateObject(CanDuplicateObject); //FULLY IMPLEMENTED 149 m_scene.ExternalChecks.addCheckDuplicateObject(CanDuplicateObject); //FULLY IMPLEMENTED
@@ -531,6 +532,14 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
531 return GenericParcelPermission(user, parcel); 532 return GenericParcelPermission(user, parcel);
532 } 533 }
533 534
535 private bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene)
536 {
537 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
538 if (m_bypassPermissions) return m_bypassPermissionsValue;
539
540 return GenericParcelPermission(user, parcel);
541 }
542
534 private bool CanBeGodLike(LLUUID user, Scene scene) 543 private bool CanBeGodLike(LLUUID user, Scene scene)
535 { 544 {
536 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 545 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index eac9e25..dba10df 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -899,6 +899,31 @@ namespace OpenSim.Region.Environment.Scenes
899 } 899 }
900 #endregion 900 #endregion
901 901
902 public delegate bool CanReclaimParcel(LLUUID user, ILandObject parcel, Scene scene);
903 private List<CanReclaimParcel> CanReclaimParcelCheckFunctions = new List<CanReclaimParcel>();
904
905 public void addCheckReclaimParcel(CanReclaimParcel delegateFunc)
906 {
907 if (!CanReclaimParcelCheckFunctions.Contains(delegateFunc))
908 CanReclaimParcelCheckFunctions.Add(delegateFunc);
909 }
910 public void removeCheckReclaimParcel(CanReclaimParcel delegateFunc)
911 {
912 if (CanReclaimParcelCheckFunctions.Contains(delegateFunc))
913 CanReclaimParcelCheckFunctions.Remove(delegateFunc);
914 }
915
916 public bool ExternalChecksCanReclaimParcel(LLUUID user, ILandObject parcel)
917 {
918 foreach (CanReclaimParcel check in CanReclaimParcelCheckFunctions)
919 {
920 if (check(user, parcel, m_scene) == false)
921 {
922 return false;
923 }
924 }
925 return true;
926 }
902 public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene); 927 public delegate bool CanBuyLand(LLUUID user, ILandObject parcel, Scene scene);
903 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>(); 928 private List<CanBuyLand> CanBuyLandCheckFunctions = new List<CanBuyLand>();
904 929