Added optional channel support to Say/Shout/Whisper in TestClient.

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@670 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
otakup0pe
2006-12-02 03:12:37 +00:00
parent f278271ae3
commit 6f28081c40
3 changed files with 72 additions and 19 deletions

View File

@@ -16,14 +16,31 @@ namespace libsecondlife.TestClient
public override string Execute(SecondLife Client, string[] args, LLUUID fromAgentID)
{
if (args.Length < 1)
return "usage: say whatever";
int channel = 0;
int startIndex = 0;
string message = String.Empty;
if (args.Length < 1)
{
return "usage: say (optional channel) whatever";
}
else if (args.Length > 1)
{
try
{
channel = Convert.ToInt32(args[0]);
startIndex = 1;
}
catch (FormatException)
{
channel = 0;
}
}
for (int i = startIndex; i < args.Length; i++) {
message += args[i] + " ";
}
string message = String.Empty;
foreach (string s in args)
message += s + " ";
Client.Self.Chat(message, 0, MainAvatar.ChatType.Normal);
Client.Self.Chat(message, channel, MainAvatar.ChatType.Normal);
return "Said " + message;
}