Thank you, patnad, for a patch that adds 3 new discovery functions

to OSSL.
Applied with changes.
Fixes Mantis #3172
This commit is contained in:
Melanie Thielker
2009-02-16 01:22:37 +00:00
parent 312b0f91c4
commit 7d77e0e703
3 changed files with 59 additions and 0 deletions

View File

@@ -1066,5 +1066,44 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.Inventory.AddInventoryItem(taskItem, false);
}
/// Threat level is Moderate because intentional abuse, for instance
/// scripts that are written to be malicious only on one grid,
/// for instance in a HG scenario, are a distinct possibility.
///
/// Use value from the config file and return it.
///
public string osGetGridNick()
{
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridNick");
m_host.AddScriptLPS(1);
string nick = "hippogrid";
IConfigSource config = new IniConfigSource(Application.iniFilePath);
if (config.Configs["GridInfo"] != null)
nick = config.Configs["GridInfo"].GetString("gridnick", nick);
return nick;
}
public string osGetGridName()
{
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridName");
m_host.AddScriptLPS(1);
string name = "the lost continent of hippo";
IConfigSource config = new IniConfigSource(Application.iniFilePath);
if (config.Configs["GridInfo"] != null)
name = config.Configs["GridInfo"].GetString("gridname", name);
return name;
}
public string osGetGridLoginURI()
{
CheckThreatLevel(ThreatLevel.Moderate, "osGetGridLoginURI");
m_host.AddScriptLPS(1);
string loginURI = "http://127.0.0.1:9000/";
IConfigSource config = new IniConfigSource(Application.iniFilePath);
if (config.Configs["GridInfo"] != null)
loginURI = config.Configs["GridInfo"].GetString("login", loginURI);
return loginURI;
}
}
}