Add proper handling for shared vs. unshared modules to the command
interface. Shared modules will now only get added once, so the command handler is called once per module, not once per scene. Removal of scenes has no adverse effects. Nonshared modules will be called for each scene.0.6.3-post-fixes
parent
b4be9baa4a
commit
9bfbfa381a
|
@ -48,6 +48,11 @@ namespace OpenSim.Framework.Console
|
|||
/// </value>
|
||||
public string module;
|
||||
|
||||
/// <value>
|
||||
/// Whether the module is shared
|
||||
/// </value>
|
||||
public bool shared;
|
||||
|
||||
/// <value>
|
||||
/// Very short BNF description
|
||||
/// </value>
|
||||
|
@ -66,7 +71,7 @@ namespace OpenSim.Framework.Console
|
|||
/// <value>
|
||||
/// The method to invoke for this command
|
||||
/// </value>
|
||||
public CommandDelegate fn;
|
||||
public List<CommandDelegate> fn;
|
||||
}
|
||||
|
||||
/// <value>
|
||||
|
@ -172,10 +177,11 @@ namespace OpenSim.Framework.Console
|
|||
/// <param name="help"></param>
|
||||
/// <param name="longhelp"></param>
|
||||
/// <param name="fn"></param>
|
||||
public void AddCommand(
|
||||
string module, string command, string help, string longhelp, CommandDelegate fn)
|
||||
public void AddCommand(string module, bool shared, string command,
|
||||
string help, string longhelp, CommandDelegate fn)
|
||||
{
|
||||
AddCommand(module, command, help, longhelp, String.Empty, fn);
|
||||
AddCommand(module, shared, command, help, longhelp,
|
||||
String.Empty, fn);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -187,8 +193,9 @@ namespace OpenSim.Framework.Console
|
|||
/// <param name="longhelp"></param>
|
||||
/// <param name="descriptivehelp"></param>
|
||||
/// <param name="fn"></param>
|
||||
public void AddCommand(
|
||||
string module, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn)
|
||||
public void AddCommand(string module, bool shared, string command,
|
||||
string help, string longhelp, string descriptivehelp,
|
||||
CommandDelegate fn)
|
||||
{
|
||||
string[] parts = Parser.Parse(command);
|
||||
|
||||
|
@ -212,15 +219,25 @@ namespace OpenSim.Framework.Console
|
|||
}
|
||||
}
|
||||
|
||||
CommandInfo info;
|
||||
|
||||
if (current.ContainsKey(String.Empty))
|
||||
{
|
||||
info = (CommandInfo)current[String.Empty];
|
||||
if (!info.shared && !info.fn.Contains(fn))
|
||||
info.fn.Add(fn);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CommandInfo info = new CommandInfo();
|
||||
info = new CommandInfo();
|
||||
info.module = module;
|
||||
info.shared = shared;
|
||||
info.help_text = help;
|
||||
info.long_help = longhelp;
|
||||
info.descriptive_help = descriptivehelp;
|
||||
info.fn = fn;
|
||||
info.fn = new List<CommandDelegate>();
|
||||
info.fn.Add(fn);
|
||||
current[String.Empty] = info;
|
||||
}
|
||||
|
||||
|
@ -275,7 +292,7 @@ namespace OpenSim.Framework.Console
|
|||
if (s == String.Empty)
|
||||
{
|
||||
CommandInfo ci = (CommandInfo)current[String.Empty];
|
||||
if (ci.fn != null)
|
||||
if (ci.fn.Count != null)
|
||||
addcr = true;
|
||||
}
|
||||
else
|
||||
|
@ -337,9 +354,10 @@ namespace OpenSim.Framework.Console
|
|||
if (current.ContainsKey(String.Empty))
|
||||
{
|
||||
CommandInfo ci = (CommandInfo)current[String.Empty];
|
||||
if (ci.fn == null)
|
||||
if (ci.fn.Count == null)
|
||||
return new string[0];
|
||||
ci.fn(ci.module, result);
|
||||
foreach (CommandDelegate fn in ci.fn)
|
||||
fn(ci.module, result);
|
||||
return result;
|
||||
}
|
||||
return new string[0];
|
||||
|
@ -409,9 +427,8 @@ namespace OpenSim.Framework.Console
|
|||
{
|
||||
DefaultPrompt = defaultPrompt;
|
||||
|
||||
Commands.AddCommand(
|
||||
"console", "help", "help [<command>]",
|
||||
"Get general command list or more detailed help on a specific command", Help);
|
||||
Commands.AddCommand("console", false, "help", "help [<command>]",
|
||||
"Get general command list or more detailed help on a specific command", Help);
|
||||
}
|
||||
|
||||
public void SetGuiMode(bool mode)
|
||||
|
|
|
@ -90,6 +90,6 @@ namespace OpenSim.Framework
|
|||
T RequestModuleInterface<T>();
|
||||
T[] RequestModuleInterfaces<T>();
|
||||
|
||||
void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback);
|
||||
void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,35 +104,35 @@ namespace OpenSim.Framework.Servers
|
|||
{
|
||||
SetConsoleLogLevel(new string[] { "ALL" });
|
||||
|
||||
m_console.Commands.AddCommand("base", "quit",
|
||||
m_console.Commands.AddCommand("base", false, "quit",
|
||||
"quit",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
m_console.Commands.AddCommand("base", "shutdown",
|
||||
m_console.Commands.AddCommand("base", false, "shutdown",
|
||||
"shutdown",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
m_console.Commands.AddCommand("base", "set log level",
|
||||
m_console.Commands.AddCommand("base", false, "set log level",
|
||||
"set log level <level>",
|
||||
"Set the console logging level", HandleLogLevel);
|
||||
|
||||
m_console.Commands.AddCommand("base", "show info",
|
||||
m_console.Commands.AddCommand("base", false, "show info",
|
||||
"show info",
|
||||
"Show general information", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", "show stats",
|
||||
m_console.Commands.AddCommand("base", false, "show stats",
|
||||
"show stats",
|
||||
"Show statistics", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", "show threads",
|
||||
m_console.Commands.AddCommand("base", false, "show threads",
|
||||
"show threads",
|
||||
"Show thread status", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", "show uptime",
|
||||
m_console.Commands.AddCommand("base", false, "show uptime",
|
||||
"show uptime",
|
||||
"Show server uptime", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", "show version",
|
||||
m_console.Commands.AddCommand("base", false, "show version",
|
||||
"show version",
|
||||
"Show server version", HandleShow);
|
||||
}
|
||||
|
|
|
@ -114,15 +114,17 @@ namespace OpenSim.Grid.GridServer
|
|||
|
||||
base.StartupSpecific();
|
||||
|
||||
m_console.Commands.AddCommand("gridserver", "enable registration",
|
||||
m_console.Commands.AddCommand("gridserver", false,
|
||||
"enable registration",
|
||||
"enable registration",
|
||||
"Enable new regions to register", HandleRegistration);
|
||||
|
||||
m_console.Commands.AddCommand("gridserver", "disable registration",
|
||||
m_console.Commands.AddCommand("gridserver", false,
|
||||
"disable registration",
|
||||
"disable registration",
|
||||
"Disable registering new regions", HandleRegistration);
|
||||
|
||||
m_console.Commands.AddCommand("gridserver", "show status",
|
||||
m_console.Commands.AddCommand("gridserver", false, "show status",
|
||||
"show status",
|
||||
"Show registration status", HandleShowStatus);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace OpenSim.Grid.InventoryServer
|
|||
|
||||
base.StartupSpecific();
|
||||
|
||||
m_console.Commands.AddCommand("inventoryserver", "add user",
|
||||
m_console.Commands.AddCommand("inventoryserver", false, "add user",
|
||||
"add user",
|
||||
"Add a random user inventory", HandleAddUser);
|
||||
}
|
||||
|
|
|
@ -127,11 +127,11 @@ namespace OpenSim.Grid.MessagingServer
|
|||
|
||||
base.StartupSpecific();
|
||||
|
||||
m_console.Commands.AddCommand("messageserver", "clear cache",
|
||||
m_console.Commands.AddCommand("messageserver", false, "clear cache",
|
||||
"clear cache",
|
||||
"Clear presence cache", HandleClearCache);
|
||||
|
||||
m_console.Commands.AddCommand("messageserver", "register",
|
||||
m_console.Commands.AddCommand("messageserver", false, "register",
|
||||
"register",
|
||||
"Re-register with user server(s)", HandleRegister);
|
||||
}
|
||||
|
|
|
@ -122,32 +122,32 @@ namespace OpenSim.Grid.UserServer
|
|||
|
||||
base.StartupSpecific();
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "create user",
|
||||
m_console.Commands.AddCommand("userserver", false, "create user",
|
||||
"create user [<first> [<last> [<x> <y> [email]]]]",
|
||||
"Create a new user account", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "reset user password",
|
||||
m_console.Commands.AddCommand("userserver", false, "reset user password",
|
||||
"reset user password [<first> [<last> [<new password>]]]",
|
||||
"Reset a user's password", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "login level",
|
||||
m_console.Commands.AddCommand("userserver", false, "login level",
|
||||
"login level <level>",
|
||||
"Set the minimum user level to log in", HandleLoginCommand);
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "login reset",
|
||||
m_console.Commands.AddCommand("userserver", false, "login reset",
|
||||
"login reset",
|
||||
"Reset the login level to allow all users",
|
||||
HandleLoginCommand);
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "login text",
|
||||
m_console.Commands.AddCommand("userserver", false, "login text",
|
||||
"login text <text>",
|
||||
"Set the text users will see on login", HandleLoginCommand);
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "test-inventory",
|
||||
m_console.Commands.AddCommand("userserver", false, "test-inventory",
|
||||
"test-inventory",
|
||||
"Perform a test inventory transaction", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("userserver", "logoff-user",
|
||||
m_console.Commands.AddCommand("userserver", false, "logoff-user",
|
||||
"logoff-user <first> <last> <message>",
|
||||
"Log off a named user", RunCommand);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ namespace OpenSim
|
|||
|
||||
base.StartupSpecific();
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("hypergrid", "link-mapping", "link-mapping [<x> <y>] <cr>", "Set local coordinate to map HG regions to", RunCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("hypergrid", "link-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "Link a hypergrid region", RunCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", "Set local coordinate to map HG regions to", RunCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", "link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "Link a hypergrid region", RunCommand);
|
||||
}
|
||||
|
||||
protected override void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder)
|
||||
|
|
|
@ -99,185 +99,185 @@ namespace OpenSim
|
|||
m_console.SetGuiMode(m_gui);
|
||||
MainConsole.Instance = m_console;
|
||||
|
||||
m_console.Commands.AddCommand("region", "clear assets",
|
||||
m_console.Commands.AddCommand("region", false, "clear assets",
|
||||
"clear assets",
|
||||
"Clear the asset cache", HandleClearAssets);
|
||||
|
||||
m_console.Commands.AddCommand("region", "force update",
|
||||
m_console.Commands.AddCommand("region", false, "force update",
|
||||
"force update",
|
||||
"Force the update of all objects on clients",
|
||||
HandleForceUpdate);
|
||||
|
||||
m_console.Commands.AddCommand("region", "debug packet",
|
||||
m_console.Commands.AddCommand("region", false, "debug packet",
|
||||
"debug packet <level>",
|
||||
"Turn on packet debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", "debug scene",
|
||||
m_console.Commands.AddCommand("region", false, "debug scene",
|
||||
"debug scene <cripting> <collisions> <physics>",
|
||||
"Turn on scene debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", "change region",
|
||||
m_console.Commands.AddCommand("region", false, "change region",
|
||||
"change region <region name>",
|
||||
"Change current console region", ChangeSelectedRegion);
|
||||
|
||||
m_console.Commands.AddCommand("region", "save xml",
|
||||
m_console.Commands.AddCommand("region", false, "save xml",
|
||||
"save xml",
|
||||
"Save a region's data in XML format", SaveXml);
|
||||
|
||||
m_console.Commands.AddCommand("region", "save xml2",
|
||||
m_console.Commands.AddCommand("region", false, "save xml2",
|
||||
"save xml2",
|
||||
"Save a region's data in XML2 format", SaveXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", "load xml",
|
||||
m_console.Commands.AddCommand("region", false, "load xml",
|
||||
"load xml [-newIDs [<x> <y> <z>]]",
|
||||
"Load a region's data from XML format", LoadXml);
|
||||
|
||||
m_console.Commands.AddCommand("region", "load xml2",
|
||||
m_console.Commands.AddCommand("region", false, "load xml2",
|
||||
"load xml2",
|
||||
"Load a region's data from XML2 format", LoadXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", "save prims xml2",
|
||||
m_console.Commands.AddCommand("region", false, "save prims xml2",
|
||||
"save prims xml2 [<prim name> <file name>]",
|
||||
"Save named prim to XML2", SavePrimsXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", "load oar",
|
||||
m_console.Commands.AddCommand("region", false, "load oar",
|
||||
"load oar <oar name>",
|
||||
"Load a region's data from OAR archive", LoadOar);
|
||||
|
||||
m_console.Commands.AddCommand("region", "save oar",
|
||||
m_console.Commands.AddCommand("region", false, "save oar",
|
||||
"save oar <oar name>",
|
||||
"Save a region's data to an OAR archive",
|
||||
"More information on forthcoming options here soon", SaveOar);
|
||||
|
||||
/*
|
||||
m_console.Commands.AddCommand("region", "save inventory",
|
||||
m_console.Commands.AddCommand("region", false, "save inventory",
|
||||
"save inventory <first> <last> <path> <file>",
|
||||
"Save user inventory data", SaveInv);
|
||||
|
||||
m_console.Commands.AddCommand("region", "load inventory",
|
||||
m_console.Commands.AddCommand("region", false, "load inventory",
|
||||
"load inventory <first> <last> <path> <file>",
|
||||
"Load user inventory data", LoadInv);
|
||||
*/
|
||||
|
||||
m_console.Commands.AddCommand("region", "edit scale",
|
||||
m_console.Commands.AddCommand("region", false, "edit scale",
|
||||
"edit scale <name> <x> <y> <z>",
|
||||
"Change the scale of a named prim", HandleEditScale);
|
||||
|
||||
m_console.Commands.AddCommand("region", "kick user",
|
||||
m_console.Commands.AddCommand("region", false, "kick user",
|
||||
"kick user <first> <last>",
|
||||
"Kick a user off the simulator", KickUserCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "show assets",
|
||||
m_console.Commands.AddCommand("region", false, "show assets",
|
||||
"show assets",
|
||||
"Show asset data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", "show users",
|
||||
m_console.Commands.AddCommand("region", false, "show users",
|
||||
"show users [full]",
|
||||
"Show user data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", "show users full",
|
||||
m_console.Commands.AddCommand("region", false, "show users full",
|
||||
"show users full",
|
||||
String.Empty, HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", "show modules",
|
||||
m_console.Commands.AddCommand("region", false, "show modules",
|
||||
"show modules",
|
||||
"Show module data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", "show regions",
|
||||
m_console.Commands.AddCommand("region", false, "show regions",
|
||||
"show regions",
|
||||
"Show region data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", "show queues",
|
||||
m_console.Commands.AddCommand("region", false, "show queues",
|
||||
"show queues",
|
||||
"Show queue data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", "alert",
|
||||
m_console.Commands.AddCommand("region", false, "alert",
|
||||
"alert <first> <last> <message>",
|
||||
"Send an alert to a user", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "alert general",
|
||||
m_console.Commands.AddCommand("region", false, "alert general",
|
||||
"alert general <message>",
|
||||
"Send an alert everyone", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "backup",
|
||||
m_console.Commands.AddCommand("region", false, "backup",
|
||||
"backup",
|
||||
"Persist objects to the database now", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "create region",
|
||||
m_console.Commands.AddCommand("region", false, "create region",
|
||||
"create region",
|
||||
"Create a new region", HandleCreateRegion);
|
||||
|
||||
m_console.Commands.AddCommand("region", "login enable",
|
||||
m_console.Commands.AddCommand("region", false, "login enable",
|
||||
"login enable",
|
||||
"Enable logins to the simulator", HandleLoginEnable);
|
||||
|
||||
m_console.Commands.AddCommand("region", "login disable",
|
||||
m_console.Commands.AddCommand("region", false, "login disable",
|
||||
"login disable",
|
||||
"Disable logins to the simulator", HandleLoginDisable);
|
||||
|
||||
m_console.Commands.AddCommand("region", "login status",
|
||||
m_console.Commands.AddCommand("region", false, "login status",
|
||||
"login status",
|
||||
"Display status of logins", HandleLoginStatus);
|
||||
|
||||
m_console.Commands.AddCommand("region", "restart",
|
||||
m_console.Commands.AddCommand("region", false, "restart",
|
||||
"restart",
|
||||
"Restart all sims in this instance", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "config set",
|
||||
m_console.Commands.AddCommand("region", false, "config set",
|
||||
"config set <section> <field> <value>",
|
||||
"Set a config option", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", "config get",
|
||||
m_console.Commands.AddCommand("region", false, "config get",
|
||||
"config get <section> <field>",
|
||||
"Read a config option", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", "config save",
|
||||
m_console.Commands.AddCommand("region", false, "config save",
|
||||
"config save",
|
||||
"Save current configuration", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", "command-script",
|
||||
m_console.Commands.AddCommand("region", false, "command-script",
|
||||
"command-script <script>",
|
||||
"Run a command script from file", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "export-map",
|
||||
m_console.Commands.AddCommand("region", false, "export-map",
|
||||
"export-map <file>",
|
||||
"Save an image of the world map", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "remove-region",
|
||||
m_console.Commands.AddCommand("region", false, "remove-region",
|
||||
"remove-region <name>",
|
||||
"Remove a region from this simulator", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "delete-region",
|
||||
m_console.Commands.AddCommand("region", false, "delete-region",
|
||||
"delete-region <name>",
|
||||
"Delete a region from disk", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "predecode-j2k",
|
||||
m_console.Commands.AddCommand("region", false, "predecode-j2k",
|
||||
"predecode-j2k [<num threads>]>",
|
||||
"Precache assets,decode j2k layerdata", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", "modules list",
|
||||
m_console.Commands.AddCommand("region", false, "modules list",
|
||||
"modules list",
|
||||
"List modules", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", "modules load",
|
||||
m_console.Commands.AddCommand("region", false, "modules load",
|
||||
"modules load <name>",
|
||||
"Load a module", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", "modules unload",
|
||||
m_console.Commands.AddCommand("region", false, "modules unload",
|
||||
"modules unload <name>",
|
||||
"Unload a module", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", "Add-InventoryHost",
|
||||
m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
|
||||
"Add-InventoryHost <host>",
|
||||
String.Empty, RunCommand);
|
||||
|
||||
if (ConfigurationSettings.Standalone)
|
||||
{
|
||||
m_console.Commands.AddCommand("region", "create user",
|
||||
m_console.Commands.AddCommand("region", false, "create user",
|
||||
"create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
|
||||
"Create a new user", HandleCreateUser);
|
||||
|
||||
m_console.Commands.AddCommand("region", "reset user password",
|
||||
m_console.Commands.AddCommand("region", false, "reset user password",
|
||||
"reset user password [<first> [<last> [<password>]]]",
|
||||
"Reset a user password", HandleResetUserPassword);
|
||||
}
|
||||
|
|
|
@ -203,12 +203,12 @@ namespace OpenSim
|
|||
|
||||
foreach (string topic in topics)
|
||||
{
|
||||
m_console.Commands.AddCommand("plugin", "help " + topic,
|
||||
m_console.Commands.AddCommand("plugin", false, "help " + topic,
|
||||
"help " + topic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
|
||||
m_console.Commands.AddCommand("plugin", topic,
|
||||
m_console.Commands.AddCommand("plugin", false, topic,
|
||||
topic,
|
||||
"Execute subcommand for plugin '" + topic + "'",
|
||||
null);
|
||||
|
@ -221,7 +221,8 @@ namespace OpenSim
|
|||
|
||||
foreach (string command in commander.Commands.Keys)
|
||||
{
|
||||
m_console.Commands.AddCommand(topic, topic + " " + command,
|
||||
m_console.Commands.AddCommand(topic, false,
|
||||
topic + " " + command,
|
||||
topic + " " + commander.Commands[command].ShortHelp(),
|
||||
String.Empty, HandleCommanderCommand);
|
||||
}
|
||||
|
|
|
@ -171,17 +171,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
|||
|
||||
m_scene.Permissions.AddCanTeleportHandler(CanTeleport); //NOT YET IMPLEMENTED
|
||||
|
||||
m_scene.AddCommand("permissions", "bypass permissions",
|
||||
m_scene.AddCommand(this, "bypass permissions",
|
||||
"bypass permissions <true / false>",
|
||||
"Bypass permission checks",
|
||||
HandleBypassPermissions);
|
||||
|
||||
m_scene.AddCommand("permissions", "force permissions",
|
||||
m_scene.AddCommand(this, "force permissions",
|
||||
"force permissions <true / false>",
|
||||
"Force permissions on or off",
|
||||
HandleForcePermissions);
|
||||
|
||||
m_scene.AddCommand("permissions", "debug permissions",
|
||||
m_scene.AddCommand(this, "debug permissions",
|
||||
"debug permissions <true / false>",
|
||||
"Enable permissions debugging",
|
||||
HandleDebugPermissions);
|
||||
|
|
|
@ -460,11 +460,24 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
public void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback)
|
||||
public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
|
||||
{
|
||||
if (MainConsole.Instance == null)
|
||||
return;
|
||||
MainConsole.Instance.Commands.AddCommand(module, command, shorthelp, longhelp, callback);
|
||||
|
||||
string modulename = String.Empty;
|
||||
bool shared = false;
|
||||
|
||||
if (mod != null)
|
||||
{
|
||||
if (!(mod is IRegionModule))
|
||||
throw new Exception("AddCommand module parameter must be IRegionModule");
|
||||
IRegionModule module = (IRegionModule)mod;
|
||||
modulename = module.Name;
|
||||
shared = module.IsSharedModule;
|
||||
}
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(modulename, shared, command, shorthelp, longhelp, callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,16 +79,16 @@ namespace pCampBot
|
|||
}
|
||||
}
|
||||
|
||||
m_console.Commands.AddCommand("bot", "shutdown",
|
||||
m_console.Commands.AddCommand("bot", false, "shutdown",
|
||||
"shutdown",
|
||||
"Gracefully shut down bots", HandleShutdown);
|
||||
|
||||
m_console.Commands.AddCommand("bot", "quit",
|
||||
m_console.Commands.AddCommand("bot", false, "quit",
|
||||
"quit",
|
||||
"Force quit (DANGEROUS, try shutdown first)",
|
||||
HandleShutdown);
|
||||
|
||||
m_console.Commands.AddCommand("bot", "add bots",
|
||||
m_console.Commands.AddCommand("bot", false, "add bots",
|
||||
"add bots <number>",
|
||||
"Add more bots", HandleAddBots);
|
||||
|
||||
|
|
Loading…
Reference in New Issue