aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2014-05-21 09:34:57 +0300
committerOren Hurvitz2014-05-21 07:39:23 +0100
commita1b291c88966de86a083b60d9784a8bf2f7ae3ba (patch)
treeb48fb6550723ceeb65fdd8b846c0478788a2cd8e /OpenSim
parentminor: Comment out currently unused log setup in TerrainCompressor (diff)
downloadopensim-SC_OLD-a1b291c88966de86a083b60d9784a8bf2f7ae3ba.zip
opensim-SC_OLD-a1b291c88966de86a083b60d9784a8bf2f7ae3ba.tar.gz
opensim-SC_OLD-a1b291c88966de86a083b60d9784a8bf2f7ae3ba.tar.bz2
opensim-SC_OLD-a1b291c88966de86a083b60d9784a8bf2f7ae3ba.tar.xz
Allow map searches for regions that contain the characters "!+|"
These characters are used as placeholders for other characters: ": /". But we should search first for the exact string the user entered, and only if that fails then replace the characters and search again.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs44
1 files changed, 24 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index c35f6b7..1437b1b 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -143,28 +143,32 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
143 } 143 }
144 144
145 145
146 //m_log.DebugFormat("MAP NAME=({0})", mapName); 146 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
147 147
148 // Hack to get around the fact that ll V3 now drops the port from the
149 // map name. See https://jira.secondlife.com/browse/VWR-28570
150 //
151 // Caller, use this magic form instead:
152 // secondlife://http|!!mygrid.com|8002|Region+Name/128/128
153 // or url encode if possible.
154 // the hacks we do with this viewer...
155 //
156 string mapNameOrig = mapName; 148 string mapNameOrig = mapName;
157 if (mapName.Contains("|")) 149 if (regionInfos.Count == 0)
158 mapName = mapName.Replace('|', ':'); 150 {
159 if (mapName.Contains("+")) 151 // Hack to get around the fact that ll V3 now drops the port from the
160 mapName = mapName.Replace('+', ' '); 152 // map name. See https://jira.secondlife.com/browse/VWR-28570
161 if (mapName.Contains("!")) 153 //
162 mapName = mapName.Replace('!', '/'); 154 // Caller, use this magic form instead:
155 // secondlife://http|!!mygrid.com|8002|Region+Name/128/128
156 // or url encode if possible.
157 // the hacks we do with this viewer...
158 //
159 if (mapName.Contains("|"))
160 mapName = mapName.Replace('|', ':');
161 if (mapName.Contains("+"))
162 mapName = mapName.Replace('+', ' ');
163 if (mapName.Contains("!"))
164 mapName = mapName.Replace('!', '/');
165
166 if (mapName != mapNameOrig)
167 regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
168 }
163 169
164 // try to fetch from GridServer
165 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
166
167 m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags); 170 m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags);
171
168 if (regionInfos.Count > 0) 172 if (regionInfos.Count > 0)
169 { 173 {
170 foreach (GridRegion info in regionInfos) 174 foreach (GridRegion info in regionInfos)
@@ -178,7 +182,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
178 data.MapImageId = info.TerrainImage; 182 data.MapImageId = info.TerrainImage;
179 // ugh! V2-3 is very sensitive about the result being 183 // ugh! V2-3 is very sensitive about the result being
180 // exactly the same as the requested name 184 // exactly the same as the requested name
181 if (regionInfos.Count == 1 && mapNameOrig.Contains("|") || mapNameOrig.Contains("+")) 185 if (regionInfos.Count == 1 && (mapName != mapNameOrig))
182 data.Name = mapNameOrig; 186 data.Name = mapNameOrig;
183 else 187 else
184 data.Name = info.RegionName; 188 data.Name = info.RegionName;