2006-11-22 00:09:31 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
2006-11-24 22:27:15 +00:00
|
|
|
namespace libsecondlife.TestClient
|
2006-11-22 00:09:31 +00:00
|
|
|
{
|
|
|
|
|
public class SetMasterCommand: Command
|
|
|
|
|
{
|
2006-12-21 08:53:08 +00:00
|
|
|
SecondLife Client;
|
2006-11-22 00:09:31 +00:00
|
|
|
public DateTime Created = DateTime.Now;
|
|
|
|
|
|
2006-12-21 08:53:08 +00:00
|
|
|
public SetMasterCommand(TestClient testClient)
|
2006-11-22 00:09:31 +00:00
|
|
|
{
|
2006-12-21 08:53:08 +00:00
|
|
|
TestClient = testClient;
|
|
|
|
|
Client = (SecondLife)TestClient;
|
|
|
|
|
|
2006-11-22 00:09:31 +00:00
|
|
|
Name = "setMaster";
|
|
|
|
|
Description = "Sets the user name of the master user. The master user can IM to run commands.";
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-21 08:53:08 +00:00
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
2006-11-22 00:09:31 +00:00
|
|
|
{
|
|
|
|
|
string masterName = String.Empty;
|
|
|
|
|
for (int ct = 0; ct < args.Length;ct++)
|
|
|
|
|
masterName = masterName + args[ct] + " ";
|
2006-11-24 22:27:15 +00:00
|
|
|
TestClient.Master = masterName.TrimEnd();
|
2006-11-22 00:09:31 +00:00
|
|
|
|
2006-12-19 04:16:34 +00:00
|
|
|
foreach (Avatar av in TestClient.AvatarList.Values)
|
2006-11-24 22:15:13 +00:00
|
|
|
{
|
2006-12-16 09:07:28 +00:00
|
|
|
if (av.Name == TestClient.Master)
|
|
|
|
|
{
|
|
|
|
|
Client.Self.InstantMessage(av.ID, "You are now my master. IM me with \"help\" for a command list.");
|
|
|
|
|
break;
|
|
|
|
|
}
|
2006-11-24 22:15:13 +00:00
|
|
|
}
|
|
|
|
|
|
2006-11-22 00:09:31 +00:00
|
|
|
return "Master set to " + masterName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|