OpenMetaverse.ObjectManager.DeedObjects C# (CSharp) Method

DeedObjects() public method

Deed multiple objects (prims) to a group, Objects must be shared with group which can be accomplished with SetPermissions()
public DeedObjects ( Simulator simulator, List localIDs, UUID groupOwner ) : void
simulator Simulator A reference to the object where the object resides
localIDs List An array which contains the IDs of the objects to deed
groupOwner UUID The of the group to deed the object to
return void
        public void DeedObjects(Simulator simulator, List<uint> localIDs, UUID groupOwner)
        {
            ObjectOwnerPacket packet = new ObjectOwnerPacket();
            packet.AgentData.AgentID = Client.Self.AgentID;
            packet.AgentData.SessionID = Client.Self.SessionID;

            // Can only be use in God mode
            packet.HeaderData.Override = false;
            packet.HeaderData.OwnerID = UUID.Zero;
            packet.HeaderData.GroupID = groupOwner;

            packet.ObjectData = new ObjectOwnerPacket.ObjectDataBlock[localIDs.Count];

            for (int i = 0; i < localIDs.Count; i++)
            {
                packet.ObjectData[i] = new ObjectOwnerPacket.ObjectDataBlock();
                packet.ObjectData[i].ObjectLocalID = localIDs[i];
            }
            Client.Network.SendPacket(packet, simulator);
        }