From 6ab5b523f8b6bdd056cb033c17811ae720564428 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 6 Oct 2008 00:09:49 +0000 Subject: Implements ObjectOwner god mode packet (Set Owner To Me admin option) --- .../Region/Environment/Modules/World/NPC/NPCAvatar.cs | 1 + OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 16 ++++++++++++++++ OpenSim/Region/Environment/Scenes/Scene.cs | 2 ++ 3 files changed, 19 insertions(+) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index ff54ed3..972491d 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -321,6 +321,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event ActivateGesture OnActivateGesture; public event DeactivateGesture OnDeactivateGesture; + public event ObjectOwner OnObjectOwner; public event DirPlacesQuery OnDirPlacesQuery; diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 729572a..04076da 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -2340,5 +2340,21 @@ namespace OpenSim.Region.Environment.Scenes { EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID); } + + void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List localIDs) + { + if (!ExternalChecks.ExternalChecksCanBeGodLike(remoteClient.AgentId)) + return; + + foreach (uint localID in localIDs) + { + SceneObjectPart part = GetSceneObjectPart(localID); + if (part != null && part.ParentGroup != null) + { + part.ParentGroup.SetOwnerId(ownerID); + part.ParentGroup.SetGroup(groupID, remoteClient); + } + } + } } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index fcd50a9..735de7e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2227,6 +2227,8 @@ namespace OpenSim.Region.Environment.Scenes client.OnActivateGesture += ActivateGesture; client.OnDeactivateGesture += DeactivateGesture; + client.OnObjectOwner += ObjectOwner; + // EventManager.TriggerOnNewClient(client); } -- cgit v1.1