diff --git a/OpenSim/Framework/GridInfo.cs b/OpenSim/Framework/GridInfo.cs index f8504c6998..58a1b66e2f 100644 --- a/OpenSim/Framework/GridInfo.cs +++ b/OpenSim/Framework/GridInfo.cs @@ -331,6 +331,26 @@ namespace OpenSim.Framework } } + public string HGHomeURL + { + get + { + if (m_homeURL.URLType != UriHostNameType.Unknown && m_hasHGconfig) + return m_homeURL.URL; + return null; + } + } + + public string HGHomeURLNoEndSlash + { + get + { + if (m_homeURL.URLType != UriHostNameType.Unknown && m_hasHGconfig) + return m_homeURL.URL.Substring(0, m_gateKeeperURL.URL.Length - 1); + return null; + } + } + // -2 dns failed // -1 if bad url // 0 if not local diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a30972190a..917e4c4ddc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -784,7 +784,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Float llSin(double f) { m_host.AddScriptLPS(1); - return (double)Math.Sin(f); + return Math.Sin(f); } public LSL_Float llCos(double f) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 863f4068ad..0816f70086 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2667,39 +2667,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI"); - IConfigSource config = m_ScriptEngine.ConfigSource; - string HomeURI = Util.GetConfigVarFromSections(config, "HomeURI", - new string[] { "Startup", "Hypergrid" }, String.Empty); - - if (!string.IsNullOrEmpty(HomeURI)) - return HomeURI; - - // Legacy. Remove soon! - if (config.Configs["LoginService"] != null) - HomeURI = config.Configs["LoginService"].GetString("SRV_HomeURI", HomeURI); - - if (String.IsNullOrEmpty(HomeURI)) - HomeURI = GridUserInfo(InfoType.Home); - - return HomeURI; + return World.SceneGridInfo.HGHomeURLNoEndSlash; } public string osGetGridGatekeeperURI() { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridGatekeeperURI"); - IConfigSource config = m_ScriptEngine.ConfigSource; - string gatekeeperURI = Util.GetConfigVarFromSections(config, "GatekeeperURI", - new string[] { "Startup", "Hypergrid" }, String.Empty); - - if (!string.IsNullOrEmpty(gatekeeperURI)) - return gatekeeperURI; - - // Legacy. Remove soon! - if (config.Configs["GridService"] != null) - gatekeeperURI = config.Configs["GridService"].GetString("Gatekeeper", gatekeeperURI); - - return gatekeeperURI; + return World.SceneGridInfo.HGGateKeeperURLNoEndSlash; } public string osGetGridCustom(string key)