From ba8850f25446fafd0fe49b80be84a25d06303d65 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 13 May 2009 03:09:30 +0000 Subject: [PATCH] Plumb request and return URL functions. Implements llRequestURL, llRequestSecureURL, llReleaseURL --- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 11 +++++++++-- OpenSim/Region/Framework/Interfaces/IUrlModule.cs | 5 +++-- .../Shared/Api/Implementation/LSL_Api.cs | 13 ++++++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 457de992cf..a79975c6c6 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -92,12 +92,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp { } - public void RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) + public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) { + return UUID.Zero; } - public void RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID) + public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID) { + return UUID.Zero; } public void ReleaseURL(string url) @@ -112,5 +114,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp { return String.Empty; } + + public int GetFreeUrls() + { + return 0; + } } } diff --git a/OpenSim/Region/Framework/Interfaces/IUrlModule.cs b/OpenSim/Region/Framework/Interfaces/IUrlModule.cs index 494a22313e..fcf9228843 100644 --- a/OpenSim/Region/Framework/Interfaces/IUrlModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IUrlModule.cs @@ -34,10 +34,11 @@ namespace OpenSim.Region.Framework.Interfaces { public interface IUrlModule { - void RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID); - void RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID); + UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID); + UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID); void ReleaseURL(string url); void HttpResponse(UUID request, int status, string body); string GetHttpHeader(UUID request, string header); + int GetFreeUrls(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index a6080d6323..cdb91fbf95 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -82,6 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private bool m_automaticLinkPermission=false; private IMessageTransferModule m_TransferModule = null; private int m_notecardLineReadCharsMax = 255; + private IUrlModule m_UrlModule = null; //private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); @@ -107,6 +108,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_TransferModule = m_ScriptEngine.World.RequestModuleInterface(); + m_UrlModule = m_ScriptEngine.World.RequestModuleInterface(); + AsyncCommands = new AsyncCommandManager(ScriptEngine); } @@ -2700,7 +2703,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llReleaseURL(string url) { m_host.AddScriptLPS(1); - NotImplemented("llReleaseURL"); + if (m_UrlModule != null) + m_UrlModule.ReleaseURL(url); } public void llAttachToAvatar(int attachment) @@ -8030,7 +8034,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llRequestSecureURL() { m_host.AddScriptLPS(1); - NotImplemented("llRequestSecureURL"); + if (m_UrlModule != null) + return m_UrlModule.RequestSecureURL(m_ScriptEngine.ScriptModule, m_host, m_itemID).ToString(); return UUID.Zero.ToString(); } @@ -8110,7 +8115,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llRequestURL() { m_host.AddScriptLPS(1); - NotImplemented("llRequestURL"); + + if (m_UrlModule != null) + return m_UrlModule.RequestURL(m_ScriptEngine.ScriptModule, m_host, m_itemID).ToString(); return UUID.Zero.ToString(); }