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 ShoutCommand : Command
|
|
|
|
|
{
|
|
|
|
|
public ShoutCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "shout";
|
|
|
|
|
Description = "Shout something.";
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
int channel = 0;
|
|
|
|
|
int startIndex = 0;
|
|
|
|
|
string message = String.Empty;
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return "usage: shout (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] + " ";
|
|
|
|
|
}
|
|
|
|
|
|
2007-08-22 18:16:38 +00:00
|
|
|
Client.Self.Chat(message, channel, ChatType.Shout);
|
2007-04-28 20:54:02 +00:00
|
|
|
|
|
|
|
|
return "Shouted " + message;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|