From b01aeff43f8a4dac085017b837624a4e34534226 Mon Sep 17 00:00:00 2001 From: Madpeter Date: Sun, 26 Apr 2020 16:20:34 +0100 Subject: [PATCH] new command: ParcelDeedToGroup --- Core/Commands/Parcel/ParcelDeedToGroup.cs | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Core/Commands/Parcel/ParcelDeedToGroup.cs diff --git a/Core/Commands/Parcel/ParcelDeedToGroup.cs b/Core/Commands/Parcel/ParcelDeedToGroup.cs new file mode 100644 index 0000000..6a58953 --- /dev/null +++ b/Core/Commands/Parcel/ParcelDeedToGroup.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; +using BetterSecondBotShared.logs; +using BetterSecondBotShared.Static; +using OpenMetaverse; + +namespace BSB.Commands.CMD_Parcel +{ + + public class ParcelDeedToGroup : CoreCommand + { + public override string[] ArgTypes { get { return new[] { "UUID" }; } } + public override string[] ArgHints { get { return new[] { "Group UUID" }; } } + public override int MinArgs { get { return 1; } } + + public override string Helpfile { get { return "transfers the current parcel ownership to a group"; } } + + public override bool CallFunction(string[] args) + { + if (base.CallFunction(args) == true) + { + if (UUID.TryParse(args[0], out UUID groupuuid) == true) + { + int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition); + Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid]; + if (parcel_static.has_parcel_perm(p, bot) == true) + { + bot.GetClient.Parcels.DeedToGroup(bot.GetClient.Network.CurrentSim, localid, groupuuid); + return true; + } + else + { + return Failed("Incorrect perms to control parcel"); + } + } + else + { + return Failed("Unable to process group uuid"); + } + } + return false; + } + } +}