mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user