mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Thank you very much, Hashbox for:
Changed the public IsAdministrator back to protected, now checks Config to see whether it is allowed to run or not. Defaults to false (not allowed). To use add the following to OpenSim.ini [LL-Functions] AllowosConsoleCommand=true
This commit is contained in:
@@ -1865,7 +1865,7 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
m_LSL_Functions.osRegionNotice(msg);
|
||||
}
|
||||
|
||||
public int osConsoleCommand(string Command)
|
||||
public bool osConsoleCommand(string Command)
|
||||
{
|
||||
return m_LSL_Functions.osConsoleCommand(Command);
|
||||
}
|
||||
|
||||
@@ -3676,14 +3676,21 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
return LLUUID.Zero.ToString();
|
||||
}
|
||||
|
||||
public int osConsoleCommand(string Command)
|
||||
public bool osConsoleCommand(string Command)
|
||||
{
|
||||
if (World.PermissionsMngr.IsAdministrator(m_host.OwnerID)) {
|
||||
OpenSim.Framework.Console.MainConsole.Instance.RunCommand(Command);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
m_host.AddScriptLPS(1);
|
||||
Nini.Config.IConfigSource config = new Nini.Config.IniConfigSource(Application.iniFilePath);
|
||||
if (config.Configs["LL-Functions"] == null)
|
||||
config.AddConfig("LL-Functions");
|
||||
|
||||
if (config.Configs["LL-Functions"].GetBoolean("AllowosConsoleCommand", false)) {
|
||||
if (World.PermissionsMngr.CanRunConsoleCommand(m_host.OwnerID)) {
|
||||
OpenSim.Framework.Console.MainConsole.Instance.RunCommand(Command);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void NotImplemented(string Command)
|
||||
|
||||
@@ -641,6 +641,6 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||
int osTerrainSetHeight(int x, int y, double val);
|
||||
int osRegionRestart(double seconds);
|
||||
void osRegionNotice(string msg);
|
||||
int osConsoleCommand(string Command);
|
||||
bool osConsoleCommand(string Command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user