Files
libremetaverse/libsecondlife-cs/examples/TestClient/Commands/EchoMasterCommand.cs
John Hurliman b3fc7de42f * Moved several stranded delegates and enums inside parent classes
* Updated the various clients to reflect the moved delegates and enums
* Redid Avatar, AvatarManager, and MainAvatar almost from the ground up
* Moved the avatar caching to AvatarTracker in libsecondlife.Utilities, AvatarManager only does lookups now
* Added support for fuzzy avatar searching through the Picker packets (alternative to directory searches)
* Added a unit test for AvatarTracker.GetAvatarName()
* Removed unused references from SLProxy
* Whitespace reformatting in ImageManager
* Renamed Tests.cs to NetworkTests.cs to reflect its contents properly

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@754 52acb1d6-8a22-11de-b505-999d5b087335
2006-12-22 15:28:33 +00:00

47 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace libsecondlife.TestClient
{
public class EchoMasterCommand: Command
{
SecondLife Client;
public EchoMasterCommand(TestClient testClient)
{
TestClient = testClient;
Client = (SecondLife)TestClient;
Name = "echoMaster";
Description = "Repeat everything that master says.";
}
public override string Execute(string[] args, LLUUID fromAgentID)
{
if (!Active)
{
Active = true;
Client.Self.OnChat += new MainAvatar.ChatCallback(Self_OnChat);
return "Echoing is now on.";
}
else
{
Active = false;
Client.Self.OnChat -= new MainAvatar.ChatCallback(Self_OnChat);
return "Echoing is now off.";
}
}
void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
{
if (message.Length > 0 && TestClient.Master == fromName)
{
TestClient.Self.Chat(message, 0, MainAvatar.ChatType.Normal);
}
}
}
}