shared codeblock updates
This commit is contained in:
parent
1ff8fd7228
commit
a4deb6857a
9 changed files with 190 additions and 334 deletions
|
|
@ -8,7 +8,7 @@ using OpenMetaverse;
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
|
|
||||||
public class AbandonLand : CoreCommand
|
public class AbandonLand : ParcelCommand_RequirePerms
|
||||||
{
|
{
|
||||||
public override string Helpfile { get { return "Abandons the parcel the bot is currently on, returning it to Linden's or Estate owner"; } }
|
public override string Helpfile { get { return "Abandons the parcel the bot is currently on, returning it to Linden's or Estate owner"; } }
|
||||||
|
|
||||||
|
|
@ -16,24 +16,8 @@ namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
bot.GetClient.Parcels.ReleaseParcel(bot.GetClient.Network.CurrentSim, targetparcel.LocalID);
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
return true;
|
||||||
{
|
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
|
||||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
|
||||||
{
|
|
||||||
bot.GetClient.Parcels.ReleaseParcel(bot.GetClient.Network.CurrentSim, localid);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Incorrect perms to control parcel");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,26 +8,15 @@ using OpenMetaverse;
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
|
|
||||||
public class GetParcelDesc : CoreCommand
|
public class GetParcelDesc : ParcelCommand_CheckParcel_1arg_smart
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "Smart"}; } }
|
|
||||||
public override string[] ArgHints { get { return new[] { "Smart reply [Channel|Avatar|http url]" }; } }
|
|
||||||
public override int MinArgs { get { return 1; } }
|
|
||||||
public override string Helpfile { get { return "Fetchs the current parcels desc and sends it to the smart reply target on [ARG 1]"; } }
|
public override string Helpfile { get { return "Fetchs the current parcels desc and sends it to the smart reply target on [ARG 1]"; } }
|
||||||
|
|
||||||
public override bool CallFunction(string[] args)
|
public override bool CallFunction(string[] args)
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
return bot.GetCommandsInterface.SmartCommandReply(args[0], targetparcel.Desc, CommandName);
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
|
||||||
{
|
|
||||||
return bot.GetCommandsInterface.SmartCommandReply(args[0], bot.GetClient.Network.CurrentSim.Parcels[localid].Desc, CommandName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,26 +8,15 @@ using OpenMetaverse;
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
|
|
||||||
public class GetParcelName : CoreCommand
|
public class GetParcelName : ParcelCommand_CheckParcel_1arg_smart
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "Smart"}; } }
|
|
||||||
public override string[] ArgHints { get { return new[] { "Smart reply [Channel|Avatar|http url]" }; } }
|
|
||||||
public override int MinArgs { get { return 1; } }
|
|
||||||
public override string Helpfile { get { return "Fetchs the current parcels name and sends it to the smart reply target on [ARG 1]"; } }
|
public override string Helpfile { get { return "Fetchs the current parcels name and sends it to the smart reply target on [ARG 1]"; } }
|
||||||
|
|
||||||
public override bool CallFunction(string[] args)
|
public override bool CallFunction(string[] args)
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
return bot.GetCommandsInterface.SmartCommandReply(args[0], targetparcel.Name, CommandName);
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
|
||||||
{
|
|
||||||
return bot.GetCommandsInterface.SmartCommandReply(args[0], bot.GetClient.Network.CurrentSim.Parcels[localid].Name, CommandName);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Text;
|
||||||
|
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
class ParcelBuy : CoreCommand
|
class ParcelBuy : ParcelCommand_CheckParcel
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "Number" }; } }
|
public override string[] ArgTypes { get { return new[] { "Number" }; } }
|
||||||
public override string[] ArgHints { get { return new[] { "expected price to pay" }; } }
|
public override string[] ArgHints { get { return new[] { "expected price to pay" }; } }
|
||||||
|
|
@ -16,28 +16,19 @@ namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
int expected_price = -1;
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
if (args.Length == 1)
|
||||||
{
|
{
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
int.TryParse(args[0], out expected_price);
|
||||||
int expected_price = -1;
|
}
|
||||||
if (args.Length == 1)
|
if ((targetparcel.SalePrice == expected_price) || (expected_price == -1))
|
||||||
{
|
{
|
||||||
int.TryParse(args[0], out expected_price);
|
bot.GetClient.Parcels.Buy(bot.GetClient.Network.CurrentSim, targetparcel.LocalID, false, UUID.Zero, false, targetparcel.Area, targetparcel.SalePrice);
|
||||||
}
|
return true;
|
||||||
if ((p.SalePrice == expected_price) || (expected_price == -1))
|
|
||||||
{
|
|
||||||
bot.GetClient.Parcels.Buy(bot.GetClient.Network.CurrentSim, localid, false, UUID.Zero, false, p.Area, p.SalePrice);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Expected price is not -1 or matchs: " + expected_price.ToString() + "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
return Failed("Expected price is not -1 or matchs: " + expected_price.ToString() + "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,21 @@
|
||||||
using System;
|
using System.Threading;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using BetterSecondBotShared.logs;
|
|
||||||
using BetterSecondBotShared.Static;
|
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
|
public class ParcelDeedToGroup : ParcelCommand_RequirePerms_1arg_Group
|
||||||
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 string Helpfile { get { return "transfers the current parcel ownership to a group"; } }
|
||||||
|
|
||||||
public override bool CallFunction(string[] args)
|
public override bool CallFunction(string[] args)
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
if (UUID.TryParse(args[0], out UUID groupuuid) == true)
|
targetparcel.GroupID = groupuuid;
|
||||||
{
|
targetparcel.Update(bot.GetClient.Network.CurrentSim, false);
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
Thread.Sleep(1000);
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
bot.GetClient.Parcels.DeedToGroup(bot.GetClient.Network.CurrentSim, targetparcel.LocalID, groupuuid);
|
||||||
{
|
return true;
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
|
||||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
|
||||||
{
|
|
||||||
p.GroupID = groupuuid;
|
|
||||||
p.Update(bot.GetClient.Network.CurrentSim, false);
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
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 find parcel in memory, please wait and try again");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Unable to process group uuid");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System.Text;
|
||||||
|
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
class ParcelReturnTargeted : CoreCommand
|
class ParcelReturnTargeted : ParcelCommand_RequirePerms
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "Avatar" }; } }
|
public override string[] ArgTypes { get { return new[] { "Avatar" }; } }
|
||||||
public override string[] ArgHints { get { return new[] { "Avatar [UUID or Firstname Lastname]" }; } }
|
public override string[] ArgHints { get { return new[] { "Avatar [UUID or Firstname Lastname]" }; } }
|
||||||
|
|
@ -18,24 +18,8 @@ namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
if (UUID.TryParse(args[0], out UUID avatarUUID) == true)
|
if (UUID.TryParse(args[0], out UUID avatarUUID) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
bot.GetClient.Parcels.ReturnObjects(bot.GetClient.Network.CurrentSim, targetparcel.LocalID, ObjectReturnType.None, new List<UUID>() { avatarUUID });
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
return true;
|
||||||
{
|
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
|
||||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
|
||||||
{
|
|
||||||
bot.GetClient.Parcels.ReturnObjects(bot.GetClient.Network.CurrentSim, localid, ObjectReturnType.None, new List<UUID>() { avatarUUID });
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Parcel perm check failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using System.Text;
|
||||||
|
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
class ParcelSetMedia : CoreCommand
|
class ParcelSetMedia : ParcelCommand_RequirePerms
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "Flag [Repeatable]" }; } }
|
public override string[] ArgTypes { get { return new[] { "Flag [Repeatable]" }; } }
|
||||||
public override string[] ArgHints { get { return new[] { "See flags table" }; } }
|
public override string[] ArgHints { get { return new[] { "See flags table" }; } }
|
||||||
|
|
@ -17,171 +17,155 @@ namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
bool all_flags_ok = true;
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
string why_failed = "";
|
||||||
|
int loop = 1;
|
||||||
|
foreach (string A in args)
|
||||||
{
|
{
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
bool format_failed = false;
|
||||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
string[] bits = A.Split('=');
|
||||||
|
if (bits.Length == 2)
|
||||||
{
|
{
|
||||||
bool all_flags_ok = true;
|
switch (bits[0])
|
||||||
string why_failed = "";
|
|
||||||
int loop = 1;
|
|
||||||
foreach (string A in args)
|
|
||||||
{
|
{
|
||||||
bool format_failed = false;
|
case "MediaType":
|
||||||
string[] bits = A.Split('=');
|
|
||||||
if (bits.Length == 2)
|
|
||||||
{
|
|
||||||
switch (bits[0])
|
|
||||||
{
|
{
|
||||||
case "MediaType":
|
if (bits[1] == "IMG-PNG")
|
||||||
{
|
{
|
||||||
if (bits[1] == "IMG-PNG")
|
targetparcel.Media.MediaType = "image/png";
|
||||||
{
|
}
|
||||||
p.Media.MediaType = "image/png";
|
else if (bits[1] == "IMG-JPG")
|
||||||
}
|
{
|
||||||
else if (bits[1] == "IMG-JPG")
|
targetparcel.Media.MediaType = "image/jpeg";
|
||||||
{
|
}
|
||||||
p.Media.MediaType = "image/jpeg";
|
else if (bits[1] == "VID-MP4")
|
||||||
}
|
{
|
||||||
else if (bits[1] == "VID-MP4")
|
targetparcel.Media.MediaType = "video/mp4";
|
||||||
{
|
}
|
||||||
p.Media.MediaType = "video/mp4";
|
else if (bits[1] == "VID-AVI")
|
||||||
}
|
{
|
||||||
else if (bits[1] == "VID-AVI")
|
targetparcel.Media.MediaType = "video/x-msvideo";
|
||||||
{
|
}
|
||||||
p.Media.MediaType = "video/x-msvideo";
|
else if (bits[1].StartsWith("Custom-") == true)
|
||||||
}
|
{
|
||||||
else if (bits[1].StartsWith("Custom-") == true)
|
string mime = bits[1];
|
||||||
{
|
mime = mime.Replace("Custom-", "");
|
||||||
string mime = bits[1];
|
targetparcel.Media.MediaType = mime;
|
||||||
mime = mime.Replace("Custom-", "");
|
}
|
||||||
p.Media.MediaType = mime;
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true;
|
||||||
{
|
}
|
||||||
format_failed = true;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case "MediaWidth":
|
||||||
}
|
case "MediaHeight":
|
||||||
case "MediaWidth":
|
{
|
||||||
case "MediaHeight":
|
if (int.TryParse(bits[1], out int size) == true)
|
||||||
{
|
{
|
||||||
if (int.TryParse(bits[1], out int size) == true)
|
if ((size >= 256) || (size <= 1024))
|
||||||
{
|
{
|
||||||
if ((size >= 256) || (size <= 1024))
|
if (bits[0] == "MediaHeight")
|
||||||
{
|
{
|
||||||
if (bits[0] == "MediaHeight")
|
targetparcel.Media.MediaHeight = size;
|
||||||
{
|
}
|
||||||
p.Media.MediaHeight = size;
|
else if (bits[0] == "MediaWidth")
|
||||||
}
|
{
|
||||||
else if (bits[0] == "MediaWidth")
|
targetparcel.Media.MediaWidth = size;
|
||||||
{
|
}
|
||||||
p.Media.MediaWidth = size;
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true; // not sure how this happened
|
||||||
{
|
}
|
||||||
format_failed = true; // not sure how this happened
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true;
|
||||||
{
|
}
|
||||||
format_failed = true;
|
}
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true;
|
||||||
{
|
}
|
||||||
format_failed = true;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case "MediaID":
|
||||||
}
|
{
|
||||||
case "MediaID":
|
if (UUID.TryParse(bits[1], out UUID texture) == true)
|
||||||
{
|
{
|
||||||
if (UUID.TryParse(bits[1], out UUID texture) == true)
|
targetparcel.Media.MediaID = texture;
|
||||||
{
|
}
|
||||||
p.Media.MediaID = texture;
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true;
|
||||||
{
|
}
|
||||||
format_failed = true;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case "MediaURL":
|
||||||
}
|
{
|
||||||
case "MediaURL":
|
targetparcel.Media.MediaURL = bits[1];
|
||||||
{
|
break;
|
||||||
p.Media.MediaURL = bits[1];
|
}
|
||||||
break;
|
case "MediaDesc":
|
||||||
}
|
{
|
||||||
case "MediaDesc":
|
targetparcel.Media.MediaDesc = bits[1];
|
||||||
{
|
break;
|
||||||
p.Media.MediaDesc = bits[1];
|
}
|
||||||
break;
|
case "MediaAutoScale":
|
||||||
}
|
{
|
||||||
case "MediaAutoScale":
|
if (bool.TryParse(bits[1], out bool output) == true)
|
||||||
{
|
{
|
||||||
if (bool.TryParse(bits[1], out bool output) == true)
|
targetparcel.Media.MediaAutoScale = output;
|
||||||
{
|
}
|
||||||
p.Media.MediaAutoScale = output;
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true;
|
||||||
{
|
}
|
||||||
format_failed = true;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
case "MediaLoop":
|
||||||
}
|
{
|
||||||
case "MediaLoop":
|
if (bool.TryParse(bits[1], out bool output) == true)
|
||||||
{
|
{
|
||||||
if (bool.TryParse(bits[1], out bool output) == true)
|
targetparcel.Media.MediaLoop = output;
|
||||||
{
|
}
|
||||||
p.Media.MediaLoop = output;
|
else
|
||||||
}
|
{
|
||||||
else
|
format_failed = true;
|
||||||
{
|
}
|
||||||
format_failed = true;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
default:
|
||||||
}
|
{
|
||||||
default:
|
why_failed = "Arg:" + loop.ToString() + " is not a supported media option!";
|
||||||
{
|
all_flags_ok = false;
|
||||||
why_failed = "Arg:" + loop.ToString() + " is not a supported media option!";
|
break;
|
||||||
all_flags_ok = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
format_failed = true;
|
|
||||||
}
|
|
||||||
if (format_failed == true)
|
|
||||||
{
|
|
||||||
why_failed = "Arg:" + loop.ToString() + " Not formated correctly";
|
|
||||||
all_flags_ok = false;
|
|
||||||
}
|
|
||||||
if (all_flags_ok == false)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
loop++;
|
|
||||||
}
|
|
||||||
if (all_flags_ok == true)
|
|
||||||
{
|
|
||||||
p.Update(bot.GetClient.Network.CurrentSim, false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed(why_failed);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Failed("Do not have expected perms for this parcel!");
|
format_failed = true;
|
||||||
}
|
}
|
||||||
|
if (format_failed == true)
|
||||||
|
{
|
||||||
|
why_failed = "Arg:" + loop.ToString() + " Not formated correctly";
|
||||||
|
all_flags_ok = false;
|
||||||
|
}
|
||||||
|
if (all_flags_ok == false)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
loop++;
|
||||||
|
}
|
||||||
|
if (all_flags_ok == true)
|
||||||
|
{
|
||||||
|
targetparcel.Update(bot.GetClient.Network.CurrentSim, false);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
return Failed(why_failed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using OpenMetaverse;
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
|
|
||||||
public class SetParcelDesc : CoreCommand
|
public class SetParcelDesc : ParcelCommand_RequirePerms
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "String" }; } }
|
public override string[] ArgTypes { get { return new[] { "String" }; } }
|
||||||
public override string[] ArgHints { get { return new[] { "The new desc" }; } }
|
public override string[] ArgHints { get { return new[] { "The new desc" }; } }
|
||||||
|
|
@ -19,25 +19,9 @@ namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
targetparcel.Desc = args[0];
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
targetparcel.Update(bot.GetClient.Network.CurrentSim, false);
|
||||||
{
|
return true;
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
|
||||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
|
||||||
{
|
|
||||||
p.Desc = args[0];
|
|
||||||
p.Update(bot.GetClient.Network.CurrentSim, false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Incorrect perms to control parcel");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ using OpenMetaverse;
|
||||||
namespace BSB.Commands.CMD_Parcel
|
namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
|
|
||||||
public class SetParcelSale : CoreCommand
|
public class SetParcelSale : ParcelCommand_RequirePerms
|
||||||
{
|
{
|
||||||
public override string[] ArgTypes { get { return new[] { "Number","Avatar" }; } }
|
public override string[] ArgTypes { get { return new[] { "Number","Avatar" }; } }
|
||||||
public override string[] ArgHints { get { return new[] { "L$ amount to mark the parcel for sale as (Range: 1 to 99999 unless [ARG 2] is set)", "Avatar who can buy the land (If set allows you to set the sell price to zero)" }; } }
|
public override string[] ArgHints { get { return new[] { "L$ amount to mark the parcel for sale as (Range: 1 to 99999 unless [ARG 2] is set)", "Avatar who can buy the land (If set allows you to set the sell price to zero)" }; } }
|
||||||
|
|
@ -20,57 +20,41 @@ namespace BSB.Commands.CMD_Parcel
|
||||||
{
|
{
|
||||||
if (base.CallFunction(args) == true)
|
if (base.CallFunction(args) == true)
|
||||||
{
|
{
|
||||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
if (int.TryParse(args[0], out int price) == true)
|
||||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
|
||||||
{
|
{
|
||||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
UUID target_buyer = UUID.Zero;
|
||||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
int low_limit = 1;
|
||||||
|
if (args.Length == 2)
|
||||||
{
|
{
|
||||||
if (int.TryParse(args[0], out int price) == true)
|
if (UUID.TryParse(args[1], out target_buyer) == true)
|
||||||
{
|
{
|
||||||
UUID target_buyer = UUID.Zero;
|
low_limit = 0;
|
||||||
int low_limit = 1;
|
}
|
||||||
if (args.Length == 2)
|
}
|
||||||
{
|
if (price >= low_limit)
|
||||||
if (UUID.TryParse(args[1], out target_buyer) == true)
|
{
|
||||||
{
|
if (price <= 99999)
|
||||||
low_limit = 0;
|
{
|
||||||
}
|
targetparcel.SalePrice = price;
|
||||||
}
|
targetparcel.AuthBuyerID = target_buyer;
|
||||||
if (price >= low_limit)
|
parcel_static.ParcelSetFlag(ParcelFlags.ForSale, targetparcel, true);
|
||||||
{
|
parcel_static.ParcelSetFlag(ParcelFlags.ForSaleObjects, targetparcel, false);
|
||||||
if (price <= 99999)
|
targetparcel.Update(bot.GetClient.Network.CurrentSim, false);
|
||||||
{
|
return true;
|
||||||
p.SalePrice = price;
|
|
||||||
p.AuthBuyerID = target_buyer;
|
|
||||||
parcel_static.ParcelSetFlag(ParcelFlags.ForSale, p, true);
|
|
||||||
parcel_static.ParcelSetFlag(ParcelFlags.ForSaleObjects, p, false);
|
|
||||||
p.Update(bot.GetClient.Network.CurrentSim, false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Price must be 99999 or less");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Failed("Price must be " + low_limit.ToString() + " or more");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Failed("Unable to process price");
|
return Failed("Price must be 99999 or less");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Failed("Incorrect perms to control parcel");
|
return Failed("Price must be " + low_limit.ToString() + " or more");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
return Failed("Unable to process price");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue