Files
libremetaverse/libsecondlife/examples/TestClient/Commands/System/SetMasterKeyCommand.cs
John Hurliman 47f8a88162 * Moved all simulator statistic information to a new struct at Simulator.Stats
* Added per-sim avatar and prim tracking through Simulator.Objects, use Settings.ALWAYS_DECODE_OBJECTS = true to enable
* Handle DisconnectSim packet and don't send CloseCircuit packets on sim-triggered disconnects
* Interpolation timer now does angular velocity and linear movement interpolation for all objects in the object tracker(s)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1363 52acb1d6-8a22-11de-b505-999d5b087335
2007-08-20 09:26:21 +00:00

46 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class SetMasterKeyCommand : Command
{
public DateTime Created = DateTime.Now;
public SetMasterKeyCommand(TestClient testClient)
{
Name = "setMasterKey";
Description = "Sets the key of the master user. The master user can IM to run commands.";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
Client.MasterKey = LLUUID.Parse(args[0]);
lock (Client.Network.Simulators)
{
for (int i = 0; i < Client.Network.Simulators.Count; i++)
{
lock (Client.Network.Simulators[i].Objects.Avatars)
{
foreach (Avatar avatar in Client.Network.Simulators[i].Objects.Avatars.Values)
{
if (avatar.ID == Client.MasterKey)
{
Client.Self.InstantMessage(avatar.ID,
"You are now my master. IM me with \"help\" for a command list.");
break;
}
}
}
}
}
return "Master set to " + Client.MasterKey.ToStringHyphenated();
}
}
}