Correct an error where the config file name was always considered to be a

local file. This caused llHttpRequest and llSetInventoryPermsMask to fail
on regions that load their config from a web server
0.6.6-post-fixes
Melanie Thielker 2009-06-06 16:39:28 +00:00
parent f94e192b86
commit 5139160ce4
5 changed files with 18 additions and 7 deletions

View File

@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// that has been running too long // that has been running too long
public static MaintenanceThread m_MaintenanceThread; public static MaintenanceThread m_MaintenanceThread;
public IConfigSource ConfigSource; private IConfigSource m_ConfigSource;
public IConfig ScriptConfigSource; public IConfig ScriptConfigSource;
private bool m_enabled = false; private bool m_enabled = false;
@ -82,6 +82,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
get { return ScriptConfigSource; } get { return ScriptConfigSource; }
} }
public IConfigSource ConfigSource
{
get { return m_ConfigSource; }
}
// How many seconds between re-reading config-file. // How many seconds between re-reading config-file.
// 0 = never. ScriptEngine will try to adjust to new config changes. // 0 = never. ScriptEngine will try to adjust to new config changes.
public int RefreshConfigFileSeconds { public int RefreshConfigFileSeconds {
@ -119,7 +124,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
public void Initialise(IConfigSource config) public void Initialise(IConfigSource config)
{ {
ConfigSource = config; m_ConfigSource = config;
} }
public void AddRegion(Scene Sceneworld) public void AddRegion(Scene Sceneworld)

View File

@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
void ApiResetScript(UUID itemID); void ApiResetScript(UUID itemID);
void ResetScript(UUID itemID); void ResetScript(UUID itemID);
IConfig Config { get; } IConfig Config { get; }
IConfigSource ConfigSource { get; }
string ScriptEngineName { get; } string ScriptEngineName { get; }
IScriptApi GetApi(UUID itemID, string name); IScriptApi GetApi(UUID itemID, string name);
} }

View File

@ -7978,11 +7978,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSetObjectPermMask(int mask, int value) public void llSetObjectPermMask(int mask, int value)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IConfigSource config = new IniConfigSource(Application.iniFilePath);
if (config.Configs["XEngine"] == null)
config.AddConfig("XEngine");
if (config.Configs["XEngine"].GetBoolean("AllowGodFunctions", false)) if (m_ScriptEngine.Config.GetBoolean("AllowGodFunctions", false))
{ {
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{ {
@ -8990,7 +8987,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Dictionary<string, string> httpHeaders = new Dictionary<string, string>(); Dictionary<string, string> httpHeaders = new Dictionary<string, string>();
string shard = "OpenSim"; string shard = "OpenSim";
IConfigSource config = new IniConfigSource(Application.iniFilePath); IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["Network"] != null) if (config.Configs["Network"] != null)
{ {
shard shard

View File

@ -950,6 +950,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
"Line ({0}): {1}", scriptLine - 1, "Line ({0}): {1}", scriptLine - 1,
e.InnerException.Message); e.InnerException.Message);
System.Console.WriteLine(e.ToString()+"\n");
return message; return message;
} }
} }

View File

@ -60,6 +60,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private int m_MaxScriptQueue; private int m_MaxScriptQueue;
private Scene m_Scene; private Scene m_Scene;
private IConfig m_ScriptConfig = null; private IConfig m_ScriptConfig = null;
private IConfigSource m_ConfigSource = null;
private ICompiler m_Compiler; private ICompiler m_Compiler;
private int m_MinThreads; private int m_MinThreads;
private int m_MaxThreads ; private int m_MaxThreads ;
@ -148,6 +149,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
get { return m_ScriptConfig; } get { return m_ScriptConfig; }
} }
public IConfigSource ConfigSource
{
get { return m_ConfigSource; }
}
public event ScriptRemoved OnScriptRemoved; public event ScriptRemoved OnScriptRemoved;
public event ObjectRemoved OnObjectRemoved; public event ObjectRemoved OnObjectRemoved;
@ -160,6 +166,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return; return;
m_ScriptConfig = configSource.Configs["XEngine"]; m_ScriptConfig = configSource.Configs["XEngine"];
m_ConfigSource = configSource;
} }
public void AddRegion(Scene scene) public void AddRegion(Scene scene)