From 4de10a45e9136c75e33f31b448720db35c2c23b1 Mon Sep 17 00:00:00 2001 From: Freaky Tech Date: Thu, 5 Mar 2015 23:52:13 +0100 Subject: revised GetMesh to not use intermediate base64 coding scheme it delivers binary and has binary as input. base64 intermediate coding makes no sense. Signed-off-by: BlueWall --- .../ClientStack/Linden/Caps/GetMeshModule.cs | 59 +++++++++++++++++----- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 4aecc99..f57d857 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs @@ -57,6 +57,9 @@ namespace OpenSim.Region.ClientStack.Linden private IAssetService m_AssetService; private bool m_Enabled = true; private string m_URL; + private string m_URL2; + private string m_RedirectURL = null; + private string m_RedirectURL2 = null; #region Region Module interfaceBase Members @@ -74,7 +77,18 @@ namespace OpenSim.Region.ClientStack.Linden m_URL = config.GetString("Cap_GetMesh", string.Empty); // Cap doesn't exist if (m_URL != string.Empty) + { + m_Enabled = true; + m_RedirectURL = config.GetString("GetMeshRedirectURL"); + } + + m_URL2 = config.GetString("Cap_GetMesh2", string.Empty); + // Cap doesn't exist + if (m_URL2 != string.Empty) + { m_Enabled = true; + m_RedirectURL2 = config.GetString("GetMesh2RedirectURL"); + } } public void AddRegion(Scene pScene) @@ -110,29 +124,46 @@ namespace OpenSim.Region.ClientStack.Linden #endregion + public void RegisterCaps(UUID agentID, Caps caps) { + UUID capID = UUID.Random(); + bool getMeshRegistered = false; - //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); - if (m_URL == "localhost") + if (m_URL == string.Empty) { - // m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); - - UUID capID = UUID.Random(); + } + else if (m_URL == "localhost") + { + getMeshRegistered = true; caps.RegisterHandler( "GetMesh", - new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh", agentID.ToString())); + new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh", agentID.ToString(), m_RedirectURL)); } else { - // m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); - IExternalCapsModule handler = m_scene.RequestModuleInterface(); - if (handler != null) - handler.RegisterExternalUserCapsHandler(agentID, caps, "GetMesh", m_URL); - else - caps.RegisterHandler("GetMesh", m_URL); + caps.RegisterHandler("GetMesh", m_URL); } - } + + if(m_URL2 == string.Empty) + { + + } + else if (m_URL2 == "localhost") + { + if (!getMeshRegistered) + { + caps.RegisterHandler( + "GetMesh2", + new GetMeshHandler("/CAPS/" + capID + "/", m_AssetService, "GetMesh2", agentID.ToString(), m_RedirectURL2)); + } + } + else + { + caps.RegisterHandler("GetMesh2", m_URL2); + } + } + } -} \ No newline at end of file +} -- cgit v1.1