parcel in memory checks
This commit is contained in:
parent
3c572a2682
commit
1e4d916e5a
15 changed files with 340 additions and 235 deletions
|
|
@ -17,6 +17,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -28,6 +30,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Incorrect perms to control parcel");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,15 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace BSB.Commands.CMD_Parcel
|
|||
}
|
||||
else
|
||||
{
|
||||
Failed("Enhance your calm");
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -20,8 +20,15 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
int expected_price = -1;
|
||||
if (args.Length == 1)
|
||||
|
|
@ -33,6 +35,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Expected price is not -1 or matchs: " + expected_price.ToString() + "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -117,6 +119,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Incorrect perms to control parcel");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (bot.GetCommandsInterface.SmartCommandReply(args[0], "Vaildate", CommandName, true) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
if (bot.CreateAwaitEventReply("parcelobjectowners", this, args) == true)
|
||||
{
|
||||
bot.GetClient.Parcels.RequestObjectOwners(bot.GetClient.Network.CurrentSim, localid);
|
||||
|
|
@ -49,6 +51,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Arg 1 is not a vaild smart target");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
bot.GetClient.Parcels.ReturnObjects(bot.GetClient.Network.CurrentSim, localid, ObjectReturnType.List, owner_uuids);
|
||||
|
|
@ -36,12 +38,19 @@ namespace BSB.Commands.CMD_Parcel
|
|||
base.Callback(args, e, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Callback(args, e, false);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CallFunction(string[] args)
|
||||
{
|
||||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
if (bot.CreateAwaitEventReply("parcelobjectowners", this, args) == true)
|
||||
{
|
||||
bot.GetClient.Parcels.RequestObjectOwners(bot.GetClient.Network.CurrentSim, localid);
|
||||
|
|
@ -52,6 +61,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Unable to await reply");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (UUID.TryParse(args[0], out UUID avatarUUID) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -31,6 +33,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Invaild avatar UUID");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -177,6 +179,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Do not have expected perms for this parcel!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
public override bool CallFunction(string[] args)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -57,5 +59,10 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Required parcel perms missing!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -32,6 +34,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Incorrect perms to control parcel");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -32,6 +34,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Incorrect perms to control parcel");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (setflags.Count > 0)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -75,6 +77,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("No accepted flags");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ namespace BSB.Commands.CMD_Parcel
|
|||
if (base.CallFunction(args) == true)
|
||||
{
|
||||
int localid = bot.GetClient.Parcels.GetParcelLocalID(bot.GetClient.Network.CurrentSim, bot.GetClient.Self.SimPosition);
|
||||
if (bot.GetClient.Network.CurrentSim.Parcels.ContainsKey(localid) == true)
|
||||
{
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
|
|
@ -66,6 +68,11 @@ namespace BSB.Commands.CMD_Parcel
|
|||
return Failed("Incorrect perms to control parcel");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Unable to find parcel in memory, please wait and try again");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue