From c0a69bfaab2f945f2f871ce6b93c81931ffc2f9a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 8 May 2011 22:50:04 -0700 Subject: [PATCH 1/2] The map is seriously broken. This doesn't fix it, but at least provides one more piece of data that seems to be required -- agent flags, which seem to be different in Viewer 2. WARNING: changes IClientAPI. --- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 3 +-- .../Region/CoreModules/World/WorldMap/MapSearchModule.cs | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 069987bd71..f3ac2df085 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -77,7 +77,7 @@ namespace OpenSim.Framework public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag); - public delegate void RequestMapName(IClientAPI remoteClient, string mapName); + public delegate void RequestMapName(IClientAPI remoteClient, string mapName, uint flags); public delegate void TeleportLocationRequest( IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 025c6e6984..1635a2dd07 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -8264,13 +8264,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } #endregion - string mapName = Util.UTF8.GetString(map.NameData.Name, 0, map.NameData.Name.Length - 1); RequestMapName handlerMapNameRequest = OnMapNameRequest; if (handlerMapNameRequest != null) { - handlerMapNameRequest(this, mapName); + handlerMapNameRequest(this, mapName, map.AgentData.Flags); } return true; } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index f9ef2864e6..c059a5f95c 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap client.OnMapNameRequest += OnMapNameRequest; } - private void OnMapNameRequest(IClientAPI remoteClient, string mapName) + private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags) { if (mapName.Length < 3) { @@ -139,9 +139,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap data.Y = 0; blocks.Add(data); - // not sure what the flags do here, but seems to be necessary - // to set to "2" for viewer 2 - remoteClient.SendMapBlock(blocks, 2); + // flags are agent flags sent from the viewer. + // they have different values depending on different viewers, apparently + remoteClient.SendMapBlock(blocks, flags); } // private Scene GetClientScene(IClientAPI client) From 8a5f6dc7a534fcdcfc877a6eac2553b18532e760 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 9 May 2011 10:25:42 -0700 Subject: [PATCH 2/2] Fixes gray tiles on map search for viewers 1. --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 1 - .../Region/CoreModules/World/WorldMap/MapSearchModule.cs | 7 +++++-- .../Region/CoreModules/World/WorldMap/WorldMapModule.cs | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 1635a2dd07..1da9d5e87c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1363,7 +1363,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendMapBlock(List mapBlocks, uint flag) { - MapBlockData[] mapBlocks2 = mapBlocks.ToArray(); int maxsend = 10; diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index c059a5f95c..00959b04c4 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap else if (regionInfos.Count == 0 && mapName.StartsWith("http://")) remoteClient.SendAlertMessage("Hyperlink could not be established."); - m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); + m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags); List blocks = new List(); MapBlockData data; @@ -117,7 +117,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap data = new MapBlockData(); data.Agents = 0; data.Access = info.Access; - data.MapImageId = UUID.Zero; // could use info.TerrainImage but it seems to break viewer2 + if (flags == 2) // V2 sends this + data.MapImageId = UUID.Zero; + else + data.MapImageId = info.TerrainImage; data.Name = info.RegionName; data.RegionFlags = 0; // TODO not used? data.WaterHeight = 0; // not used diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 10949701d9..8073f2d918 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -205,8 +205,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { //try //{ - //m_log.DebugFormat("[MAPLAYER]: request: {0}, path: {1}, param: {2}, agent:{3}", - //request, path, param,agentID.ToString()); + //m_log.DebugFormat("[MAPLAYER]: path: {0}, param: {1}, agent:{2}", + // path, param, agentID.ToString()); // this is here because CAPS map requests work even beyond the 10,000 limit. ScenePresence avatarPresence = null; @@ -784,7 +784,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap /// public virtual void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) { - if ((flag & 0x10000) != 0) // user clicked on the map a tile that isn't visible + //m_log.ErrorFormat("[YYY] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag); + if ((flag & 0x10000) != 0) // user clicked on qthe map a tile that isn't visible { List response = new List();