From d834996bbef445565ac17a3e1eb4fe9c491cad5b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 6 Oct 2008 08:19:18 +0000 Subject: [PATCH] Implement Parcel -> ForceOwnerToMe god mode packet --- OpenSim/Framework/IClientAPI.cs | 2 ++ .../Region/ClientStack/LindenUDP/LLClientView.cs | 11 +++++++++++ .../Modules/World/Land/LandManagementModule.cs | 15 +++++++++++++++ .../Environment/Modules/World/NPC/NPCAvatar.cs | 1 + .../Examples/SimpleModule/MyNpcCharacter.cs | 1 + 5 files changed, 30 insertions(+) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index dbaa0a8ec0..1a6a5a4b31 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -167,6 +167,7 @@ namespace OpenSim.Framework public delegate void ParcelObjectOwnerRequest(int local_id, IClientAPI remote_client); public delegate void ParcelAbandonRequest(int local_id, IClientAPI remote_client); + public delegate void ParcelGodForceOwner(int local_id, UUID ownerID, IClientAPI remote_client); public delegate void ParcelReclaim(int local_id, IClientAPI remote_client); public delegate void ParcelReturnObjectsRequest(int local_id, uint return_type, UUID[] agent_ids, UUID[] selected_ids, IClientAPI remote_client); @@ -486,6 +487,7 @@ namespace OpenSim.Framework event ParcelSelectObjects OnParcelSelectObjects; event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; event ParcelAbandonRequest OnParcelAbandonRequest; + event ParcelGodForceOwner OnParcelGodForceOwner; event ParcelReclaim OnParcelReclaim; event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; event RegionInfoRequest OnRegionInfoRequest; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 102b9c4944..ff35c3252a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -211,6 +211,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private ParcelSelectObjects handlerParcelSelectObjects = null; //OnParcelSelectObjects; private ParcelObjectOwnerRequest handlerParcelObjectOwnerRequest = null; //OnParcelObjectOwnerRequest; private ParcelAbandonRequest handlerParcelAbandonRequest = null; + private ParcelGodForceOwner handlerParcelGodForceOwner = null; private ParcelReclaim handlerParcelReclaim = null; private ParcelReturnObjectsRequest handlerParcelReturnObjectsRequest = null; private RegionInfoRequest handlerRegionInfoRequest = null; //OnRegionInfoRequest; @@ -938,6 +939,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event ParcelSelectObjects OnParcelSelectObjects; public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; public event ParcelAbandonRequest OnParcelAbandonRequest; + public event ParcelGodForceOwner OnParcelGodForceOwner; public event ParcelReclaim OnParcelReclaim; public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; public event RegionInfoRequest OnRegionInfoRequest; @@ -5678,6 +5680,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); } break; + case PacketType.ParcelGodForceOwner: + ParcelGodForceOwnerPacket godForceOwnerPacket = (ParcelGodForceOwnerPacket)Pack; + + handlerParcelGodForceOwner = OnParcelGodForceOwner; + if (handlerParcelGodForceOwner != null) + { + handlerParcelGodForceOwner(godForceOwnerPacket.Data.LocalID, godForceOwnerPacket.Data.OwnerID, this); + } + break; case PacketType.ParcelRelease: ParcelReleasePacket releasePacket = (ParcelReleasePacket)Pack; diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 77a31c7d54..253eec677b 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -103,6 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land client.OnParcelAccessListRequest += new ParcelAccessListRequest(handleParcelAccessRequest); client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(handleParcelAccessUpdateRequest); client.OnParcelAbandonRequest += new ParcelAbandonRequest(handleParcelAbandonRequest); + client.OnParcelGodForceOwner += new ParcelGodForceOwner(handleParcelGodForceOwner); client.OnParcelReclaim += new ParcelReclaim(handleParcelReclaim); client.OnParcelInfoRequest += new ParcelInfoRequest(handleParcelInfo); if (m_scene.Entities.ContainsKey(client.AgentId)) @@ -912,6 +913,20 @@ namespace OpenSim.Region.Environment.Modules.World.Land } } + public void handleParcelGodForceOwner(int local_id, UUID ownerID, IClientAPI remote_client) + { + if (landList.ContainsKey(local_id)) + { + if (m_scene.ExternalChecks.ExternalChecksCanBeGodLike(remote_client.AgentId)) + { + landList[local_id].landData.OwnerID = ownerID; + + m_scene.Broadcast(SendParcelOverlay); + landList[local_id].sendLandUpdateToClient(remote_client); + } + } + } + public void handleParcelAbandonRequest(int local_id, IClientAPI remote_client) { if (landList.ContainsKey(local_id)) diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 972491d929..a236ccd1b9 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -258,6 +258,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event ParcelJoinRequest OnParcelJoinRequest; public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; public event ParcelAbandonRequest OnParcelAbandonRequest; + public event ParcelGodForceOwner OnParcelGodForceOwner; public event ParcelReclaim OnParcelReclaim; public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; public event ParcelAccessListRequest OnParcelAccessListRequest; diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index b7ff8791fb..9c8152d759 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -153,6 +153,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event ParcelJoinRequest OnParcelJoinRequest; public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; public event ParcelAbandonRequest OnParcelAbandonRequest; + public event ParcelGodForceOwner OnParcelGodForceOwner; public event ParcelReclaim OnParcelReclaim; public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; public event ParcelAccessListRequest OnParcelAccessListRequest;