From 75873b6253e3d8c7ee0aae5c8cb33a1e8279850c Mon Sep 17 00:00:00 2001 From: diva Date: Sun, 5 Apr 2009 16:41:27 +0000 Subject: Thanks BlueWall for a patch that adds Hypergrid dynamic linking to osTeleportAgent. Fixes mantis #3408. --- .../Shared/Api/Implementation/OSSL_Api.cs | 20 ++++++++++++++++++++ .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 1 + 2 files changed, 21 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 491a971..18e97da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -38,6 +38,7 @@ using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Scenes.Hypergrid; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; using OpenSim.Region.ScriptEngine.Shared.ScriptBase; @@ -506,6 +507,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api == World.LandChannel.GetLandObject( presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) { + + // Check for hostname , attempt to make a hglink + // and convert the regionName to the target region + if ( regionName.Contains(".") && regionName.Contains(":")) + { + // Try to link the region + RegionInfo regInfo = HGHyperlink.TryLinkRegion(World, + presence.ControllingClient, + regionName); + // Get the region name + if (regInfo != null) + { + regionName = regInfo.RegionName; + } + else + { + // Might need to ping the client here in case of failure?? + } + } presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionName, new Vector3((float)position.x, (float)position.y, (float)position.z), diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 3884138..66691b7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -707,6 +707,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } catch (Exception e) { + m_log.DebugFormat("[Script] Exception: {0}", e.Message); m_InEvent = false; m_CurrentEvent = String.Empty; -- cgit v1.1