Implements ObjectOwner god mode packet (Set Owner To Me admin option)
parent
f8acdeb437
commit
6ab5b523f8
|
@ -308,6 +308,7 @@ namespace OpenSim.Framework
|
|||
public delegate void DeactivateGesture(IClientAPI client, UUID gestureid);
|
||||
|
||||
public delegate void TerrainUnacked(IClientAPI remoteClient, int patchX, int patchY);
|
||||
public delegate void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> localIDs);
|
||||
|
||||
public delegate void DirPlacesQuery(IClientAPI remoteClient, UUID queryID, string queryText, int queryFlags, int category, string simName, int queryStart);
|
||||
|
||||
|
@ -546,6 +547,7 @@ namespace OpenSim.Framework
|
|||
event TerrainUnacked OnUnackedTerrain;
|
||||
event ActivateGesture OnActivateGesture;
|
||||
event DeactivateGesture OnDeactivateGesture;
|
||||
event ObjectOwner OnObjectOwner;
|
||||
|
||||
event DirPlacesQuery OnDirPlacesQuery;
|
||||
|
||||
|
|
|
@ -259,6 +259,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
//Gesture
|
||||
private ActivateGesture handlerActivateGesture = null;
|
||||
private DeactivateGesture handlerDeactivateGesture = null;
|
||||
private ObjectOwner handlerObjectOwner = null;
|
||||
|
||||
private DirPlacesQuery handlerDirPlacesQuery = null;
|
||||
|
||||
|
@ -987,6 +988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
public event ActivateGesture OnActivateGesture;
|
||||
public event DeactivateGesture OnDeactivateGesture;
|
||||
public event ObjectOwner OnObjectOwner;
|
||||
|
||||
public event DirPlacesQuery OnDirPlacesQuery;
|
||||
|
||||
|
@ -6186,6 +6188,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
handlerDeactivateGesture(this, deactivateGesturePacket.Data[0].ItemID);
|
||||
}
|
||||
break;
|
||||
case PacketType.ObjectOwner:
|
||||
ObjectOwnerPacket objectOwnerPacket = (ObjectOwnerPacket)Pack;
|
||||
|
||||
List<uint> localIDs = new List<uint>();
|
||||
|
||||
foreach (ObjectOwnerPacket.ObjectDataBlock d in objectOwnerPacket.ObjectData)
|
||||
localIDs.Add(d.ObjectLocalID);
|
||||
|
||||
handlerObjectOwner = OnObjectOwner;
|
||||
if (handlerObjectOwner != null)
|
||||
{
|
||||
handlerObjectOwner(this, objectOwnerPacket.HeaderData.OwnerID, objectOwnerPacket.HeaderData.GroupID, localIDs);
|
||||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -2340,5 +2340,21 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID);
|
||||
}
|
||||
|
||||
void ObjectOwner(IClientAPI remoteClient, UUID ownerID, UUID groupID, List<uint> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2227,6 +2227,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
client.OnActivateGesture += ActivateGesture;
|
||||
client.OnDeactivateGesture += DeactivateGesture;
|
||||
|
||||
client.OnObjectOwner += ObjectOwner;
|
||||
|
||||
// EventManager.TriggerOnNewClient(client);
|
||||
}
|
||||
|
||||
|
|
|
@ -216,6 +216,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
|||
|
||||
public event ActivateGesture OnActivateGesture;
|
||||
public event DeactivateGesture OnDeactivateGesture;
|
||||
public event ObjectOwner OnObjectOwner;
|
||||
|
||||
public event DirPlacesQuery OnDirPlacesQuery;
|
||||
|
||||
|
|
Loading…
Reference in New Issue