corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using OpenMetaverse;
5  
6 namespace OpenMetaverse.TestClient
7 {
8 public class SayCommand: Command
9 {
10 public SayCommand(TestClient testClient)
11 {
12 Name = "say";
13 Description = "Say something. (usage: say (optional channel) whatever)";
14 Category = CommandCategory.Communication;
15 }
16  
17 public override string Execute(string[] args, UUID fromAgentID)
18 {
19 int channel = 0;
20 int startIndex = 0;
21  
22 if (args.Length < 1)
23 {
24 return "usage: say (optional channel) whatever";
25 }
26 else if (args.Length > 1)
27 {
28 if (Int32.TryParse(args[0], out channel))
29 startIndex = 1;
30 }
31  
32 String message = String.Empty;
33  
34 for (int i = startIndex; i < args.Length; i++)
35 {
36 // Append a space before the next arg
37 if( i > 0 )
38 message += " ";
39 message += args[i];
40 }
41  
42 Client.Self.Chat(message, channel, ChatType.Normal);
43  
44 return "Said " + message.ToString();
45 }
46 }
47 }