2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2008-07-21 21:12:59 +00:00
|
|
|
using OpenMetaverse;
|
|
|
|
|
using OpenMetaverse.Packets;
|
2007-04-28 20:54:02 +00:00
|
|
|
|
2008-07-21 21:12:59 +00:00
|
|
|
namespace OpenMetaverse.TestClient
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
public class EchoMasterCommand: Command
|
|
|
|
|
{
|
|
|
|
|
public EchoMasterCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "echoMaster";
|
|
|
|
|
Description = "Repeat everything that master says.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Execute(string[] args, LLUUID fromAgentID)
|
|
|
|
|
{
|
|
|
|
|
if (!Active)
|
|
|
|
|
{
|
|
|
|
|
Active = true;
|
2007-11-06 09:26:10 +00:00
|
|
|
Client.Self.OnChat += new AgentManager.ChatCallback(Self_OnChat);
|
2007-04-28 20:54:02 +00:00
|
|
|
return "Echoing is now on.";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Active = false;
|
2007-11-06 09:26:10 +00:00
|
|
|
Client.Self.OnChat -= new AgentManager.ChatCallback(Self_OnChat);
|
2007-04-28 20:54:02 +00:00
|
|
|
return "Echoing is now off.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-22 18:16:38 +00:00
|
|
|
void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type,
|
|
|
|
|
ChatSourceType sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
if (message.Length > 0 && Client.MasterKey == id)
|
2007-08-22 18:16:38 +00:00
|
|
|
Client.Self.Chat(message, 0, ChatType.Normal);
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|