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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user