mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user