2007-04-28 20:54:02 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Reflection;
|
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 LoadCommand: Command
|
|
|
|
|
{
|
|
|
|
|
public LoadCommand(TestClient testClient)
|
|
|
|
|
{
|
|
|
|
|
Name = "load";
|
|
|
|
|
Description = "Loads commands from a dll. (Usage: load AssemblyNameWithoutExtension)";
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-25 05:15:05 +00:00
|
|
|
public override string Execute(string[] args, UUID fromAgentID)
|
2007-04-28 20:54:02 +00:00
|
|
|
{
|
|
|
|
|
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.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|