From 7d77e0e703cc383c2bf68bb283518bf9fd2e009c Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 16 Feb 2009 01:22:37 +0000 Subject: Thank you, patnad, for a patch that adds 3 new discovery functions to OSSL. Applied with changes. Fixes Mantis #3172 --- .../Shared/Api/Implementation/OSSL_Api.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index fa09b0a..697fdb4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -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; + } } } -- cgit v1.1