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.";
|
2008-07-25 08:55:36 +00:00
|
|
|
Category = CommandCategory.Communication;
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
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,
|
2008-07-25 05:15:05 +00:00
|
|
|
ChatSourceType sourcetype, string fromName, UUID id, UUID ownerid, Vector3 position)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
2008-07-30 06:40:47 +00:00
|
|
|
if (message.Length > 0 && (Client.MasterKey == id || (Client.MasterName == fromName && !Client.AllowObjectMaster)))
|
2007-08-22 18:16:38 +00:00
|
|
|
Client.Self.Chat(message, 0, ChatType.Normal);
|
2007-04-28 20:54:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|