Prevent OSSL from crashing if the sim was loaded from a remote config and

osGetGridName, osGetGridNick or osGetGridLoginURI is used.
mysql-performance
Melanie 2009-12-15 15:42:51 +00:00
parent 9e54e61a43
commit 0f616d2ffe
1 changed files with 3 additions and 3 deletions

View File

@ -1739,7 +1739,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick");
m_host.AddScriptLPS(1);
string nick = "hippogrid";
IConfigSource config = new IniConfigSource(Application.iniFilePath);
IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null)
nick = config.Configs["GridInfo"].GetString("gridnick", nick);
return nick;
@ -1750,7 +1750,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName");
m_host.AddScriptLPS(1);
string name = "the lost continent of hippo";
IConfigSource config = new IniConfigSource(Application.iniFilePath);
IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null)
name = config.Configs["GridInfo"].GetString("gridname", name);
return name;
@ -1761,7 +1761,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI");
m_host.AddScriptLPS(1);
string loginURI = "http://127.0.0.1:9000/";
IConfigSource config = new IniConfigSource(Application.iniFilePath);
IConfigSource config = m_ScriptEngine.ConfigSource;
if (config.Configs["GridInfo"] != null)
loginURI = config.Configs["GridInfo"].GetString("login", loginURI);
return loginURI;