new command: ParcelSetMusicURL
This commit is contained in:
parent
eed5c5fe8a
commit
2bef909af9
1 changed files with 35 additions and 0 deletions
35
Core/Commands/Parcel/ParcelSetMusicurl.cs
Normal file
35
Core/Commands/Parcel/ParcelSetMusicurl.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using BetterSecondBotShared.Static;
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BSB.Commands.CMD_Parcel
|
||||
{
|
||||
class ParcelSetMusicURL : CoreCommand
|
||||
{
|
||||
public override string[] ArgTypes { get { return new[] { "String" }; } }
|
||||
public override string[] ArgHints { get { return new[] { "The url" }; } }
|
||||
public override int MinArgs { get { return 1; } }
|
||||
public override string Helpfile { get { return "Updates the current parcels music url"; } }
|
||||
|
||||
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);
|
||||
Parcel p = bot.GetClient.Network.CurrentSim.Parcels[localid];
|
||||
if (parcel_static.has_parcel_perm(p, bot) == true)
|
||||
{
|
||||
p.MusicURL = args[0];
|
||||
p.Update(bot.GetClient.Network.CurrentSim, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Failed("Do not have expected perms for this parcel!");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue