Moving examples, mapgenerator, and VisualParamGenerator to Programs folder (SVN is seriously ruined still, don't check out yet)
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1961 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenMetaverse.TestClient
|
||||
{
|
||||
public class SayCommand: Command
|
||||
{
|
||||
public SayCommand(TestClient testClient)
|
||||
{
|
||||
Name = "say";
|
||||
Description = "Say something. (usage: say (optional channel) whatever)";
|
||||
}
|
||||
|
||||
public override string Execute(string[] args, LLUUID fromAgentID)
|
||||
{
|
||||
int channel = 0;
|
||||
int startIndex = 0;
|
||||
|
||||
if (args.Length < 1)
|
||||
{
|
||||
return "usage: say (optional channel) whatever";
|
||||
}
|
||||
else if (args.Length > 1)
|
||||
{
|
||||
if (Int32.TryParse(args[0], out channel))
|
||||
startIndex = 1;
|
||||
}
|
||||
|
||||
StringBuilder message = new StringBuilder();
|
||||
|
||||
for (int i = startIndex; i < args.Length; i++)
|
||||
{
|
||||
message.Append(args[i]);
|
||||
if (i != args.Length - 1) message.Append(" ");
|
||||
}
|
||||
|
||||
Client.Self.Chat(message.ToString(), channel, ChatType.Normal);
|
||||
|
||||
return "Said " + message.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user