From f9a1fd5748a0f33adad3b8b06702f9474dbf6908 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 23 Dec 2011 15:08:13 -0800 Subject: HG: one more adjustment with trailing /s --- .../CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index 81b65c5..d20c9eb 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess public AssetBase FetchAsset(string url, UUID assetID) { - AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString()); + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + "/"; + + AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString()); if (asset != null) { @@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { if (asset != null) { + if (!url.EndsWith("/") && !url.EndsWith("=")) + url = url + "/"; + // See long comment in AssetCache.AddAsset if (!asset.Temporary || asset.Local) { @@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess Copy(asset, asset1); try { - asset1.ID = url + "/" + asset.ID; + asset1.ID = url + asset.ID; } catch { -- cgit v1.1 From b6cfe15c7c0b3697709179cbbf32818576919642 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 24 Dec 2011 07:44:26 -0800 Subject: HG: more / love for Xmas --- OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs | 7 ++++-- .../Connectors/Asset/HGAssetServiceConnector.cs | 21 +++++++++++++++-- .../Connectors/Hypergrid/HeloServiceConnector.cs | 27 ++++++++++++++++++++-- 3 files changed, 49 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs index e9e2dca..1dea87e 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/J2KImage.cs @@ -385,8 +385,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP string assetServerURL = string.Empty; if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) { - m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); - AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); + if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("=")) + assetServerURL = assetServerURL + "/"; + + m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id); + AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived); return; } } diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 5c31639..bb5d51f 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -29,7 +29,9 @@ using log4net; using Nini.Config; using System; using System.Collections.Generic; +using System.Collections.Specialized; using System.Reflection; +using System.Web; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors.Hypergrid; @@ -73,11 +75,26 @@ namespace OpenSim.Services.Connectors if (Uri.TryCreate(id, UriKind.Absolute, out assetUri) && assetUri.Scheme == Uri.UriSchemeHttp) { - url = "http://" + assetUri.Authority; - assetID = assetUri.LocalPath.Trim(new char[] {'/'}); + // Simian + if (assetUri.Query != string.Empty) + { + NameValueCollection qscoll = HttpUtility.ParseQueryString(assetUri.Query); + assetID = qscoll["id"]; + if (assetID != null) + url = id.Replace(assetID, ""); // Malformed again, as simian expects + else + url = id; // !!! best effort + } + else // robust + { + url = "http://" + assetUri.Authority; + assetID = assetUri.LocalPath.Trim(new char[] { '/' }); + } + return true; } + m_log.DebugFormat("[HG ASSET SERVICE]: Malformed URL {0}", id); return false; } diff --git a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index ff1dd5f..8ac89cc 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -47,13 +47,36 @@ namespace OpenSim.Services.Connectors public HeloServicesConnector(string serverURI) { - m_ServerURI = serverURI.TrimEnd('/'); + if (!serverURI.EndsWith("=")) + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + else + { + // Simian sends malformed urls like this: + // http://valley.virtualportland.org/simtest/Grid/?id= + // + try + { + Uri uri = new Uri(serverURI + "xxx"); + if (uri.Query == string.Empty) + m_ServerURI = serverURI.TrimEnd('/') + "/helo/"; + else + { + serverURI = serverURI + "xxx"; + m_ServerURI = serverURI.Replace("?" + uri.Query, ""); + m_ServerURI = m_ServerURI.TrimEnd('/') + "/helo/"; + } + } + catch (UriFormatException e) + { + m_log.WarnFormat("[HELO SERVICE]: Malformed URL {0}", serverURI); + } + } } public virtual string Helo() { - HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo/"); + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI); // Eventually we need to switch to HEAD /* req.Method = "HEAD"; */ -- cgit v1.1 From 5b52440e61648a98d418cff11b588352a3cfff67 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 24 Dec 2011 16:18:01 +0100 Subject: Introduce a LightShare kill packet ans send it when needed. Currently only understood by AVN v0.3 --- .../Region/CoreModules/LightShare/LightShareModule.cs | 17 ++++++++++++----- .../ScriptEngine/Shared/Api/Implementation/LS_Api.cs | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index cabbd31..16cbbf5 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs @@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare public void SendProfileToClient(IClientAPI client, RegionLightShareData wl) { - if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid) + if (m_enableWindlight) { - List param = compileWindlightSettings(wl); - client.SendGenericMessage("Windlight", param); + if (m_scene.RegionInfo.WindlightSettings.valid) + { + List param = compileWindlightSettings(wl); + client.SendGenericMessage("Windlight", param); + } + else + { + List param = new List(); + client.SendGenericMessage("WindlightReset", param); + } } } @@ -175,8 +183,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare private void EventManager_OnSaveNewWindlightProfile() { - if (m_scene.RegionInfo.WindlightSettings.valid) - m_scene.ForEachRootClient(SendProfileToClient); + m_scene.ForEachRootClient(SendProfileToClient); } public void PostInitialise() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index cb0d765..77a784d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -486,6 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; if (m_host.ParentGroup.Scene.SimulationDataService != null) m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); + m_host.ParentGroup.Scene.EventManager.TriggerOnSaveNewWindlightProfile(); } /// /// Set the current Windlight scene to a target avatar -- cgit v1.1