2006-12-16 09:07:28 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using libsecondlife;
|
|
|
|
|
using libsecondlife.Packets;
|
|
|
|
|
|
|
|
|
|
namespace libsecondlife.TestClient
|
|
|
|
|
{
|
|
|
|
|
public class EchoMasterCommand: Command
|
|
|
|
|
{
|
2006-12-21 08:53:08 +00:00
|
|
|
public EchoMasterCommand(TestClient testClient)
|
2006-12-16 09:07:28 +00:00
|
|
|
{
|
|
|
|
|
Name = "echoMaster";
|
|
|
|
|
Description = "Repeat everything that master says.";
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-21 08:53:08 +00:00
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
2006-12-16 09:07:28 +00:00
|
|
|
{
|
|
|
|
|
if (!Active)
|
|
|
|
|
{
|
|
|
|
|
Active = true;
|
2006-12-22 15:28:33 +00:00
|
|
|
Client.Self.OnChat += new MainAvatar.ChatCallback(Self_OnChat);
|
2006-12-16 09:07:28 +00:00
|
|
|
return "Echoing is now on.";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Active = false;
|
2006-12-22 15:28:33 +00:00
|
|
|
Client.Self.OnChat -= new MainAvatar.ChatCallback(Self_OnChat);
|
2006-12-16 09:07:28 +00:00
|
|
|
return "Echoing is now off.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
|
|
|
|
|
{
|
2007-01-04 05:41:23 +00:00
|
|
|
if (message.Length > 0 && Client.Master == fromName)
|
2006-12-16 09:07:28 +00:00
|
|
|
{
|
2007-01-04 05:41:23 +00:00
|
|
|
Client.Self.Chat(message, 0, MainAvatar.ChatType.Normal);
|
2006-12-16 09:07:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|