From 5b6afeafbc249ba88dcc20d1fbc98ce12418b21b Mon Sep 17 00:00:00 2001 From: gareth Date: Tue, 8 May 2007 00:10:04 +0000 Subject: Brought in TestClient code for teh fork --- ExportBot/Commands/LoadCommand.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ExportBot/Commands/LoadCommand.cs (limited to 'ExportBot/Commands/LoadCommand.cs') diff --git a/ExportBot/Commands/LoadCommand.cs b/ExportBot/Commands/LoadCommand.cs new file mode 100644 index 0000000..70dada4 --- /dev/null +++ b/ExportBot/Commands/LoadCommand.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using libsecondlife; +using libsecondlife.Packets; + +namespace libsecondlife.TestClient +{ + public class LoadCommand: Command + { + public LoadCommand(TestClient testClient) + { + Name = "load"; + Description = "Loads commands from a dll. (Usage: load AssemblyNameWithoutExtension)"; + } + + public override string Execute(string[] args, LLUUID fromAgentID) + { + if (args.Length < 1) + return "Usage: load AssemblyNameWithoutExtension"; + + string filename = AppDomain.CurrentDomain.BaseDirectory + args[0] + ".dll"; + Client.RegisterAllCommands(Assembly.LoadFile(filename)); + return "Assembly " + filename + " loaded."; + } + } +} -- cgit v1.1