From 18d1d6d3b4658b2b00c738d54ff4230868c02c6c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 15 Mar 2012 16:03:09 -0700 Subject: More on SLURLs and V3. This is hacky, but it works. Basically, we have to redefine the encoding of HG URLs because the viewer messes them up. Examples of what works and doesn't work: - secondlife://ucigrid00.nacs.uci.edu|8002/128/128 <-- works throughout the viewer - secondlife://http|!!ucigrid00.nacs.uci.edu|8002+Test+Zone+1/128/128 <-- works throughout the viewer - secondlife://http|!!grid.sciencesim.com!grid!hypergrid.php+Yellowstone01+74/128/128 <-- works throughout - secondlife://http%3A%2F%2Fucigrid00.nacs.uci.edu%3A8002%20UCI%20Central%201/128/128 <-- works in chat, but not as URLs in the webkit --- .../Region/CoreModules/World/WorldMap/MapSearchModule.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 2064ce3..83ec6c3 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -97,14 +97,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // Hack to get around the fact that ll V3 now drops the port from the // map name. See https://jira.secondlife.com/browse/VWR-28570 // - // Caller, use this form instead: - // secondlife://mygrid.com|8002|Region+Name/128/128 + // Caller, use this magic form instead: + // secondlife://http|!!mygrid.com|8002|Region+Name/128/128 + // or url encode if possible. // the hacks we do with this viewer... // + string mapNameOrig = mapName; if (mapName.Contains("|")) mapName = mapName.Replace('|', ':'); if (mapName.Contains("+")) mapName = mapName.Replace('+', ' '); + if (mapName.Contains("!")) + mapName = mapName.Replace('!', '/'); // try to fetch from GridServer List regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); @@ -126,7 +130,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap data.MapImageId = UUID.Zero; else data.MapImageId = info.TerrainImage; - data.Name = info.RegionName; + // ugh! V2-3 is very sensitive about the result being + // exactly the same as the requested name + if (regionInfos.Count == 1) + data.Name = mapNameOrig; + else + data.Name = info.RegionName; data.RegionFlags = 0; // TODO not used? data.WaterHeight = 0; // not used data.X = (ushort)(info.RegionLocX / Constants.RegionSize); -- cgit v1.1