Fixed a compilation problem. Also added a lengthy comment on the Map hack, so that it never goes unnoticed again.

bulletsim
Diva Canto 2011-06-08 16:38:25 -07:00
parent 1bd712c541
commit 2a46f756d6
2 changed files with 51 additions and 39 deletions

View File

@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
#endregion #endregion
protected override List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) protected override void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
{ {
List<MapBlockData> mapBlocks = new List<MapBlockData>(); List<MapBlockData> mapBlocks = new List<MapBlockData>();
List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
@ -96,7 +96,6 @@ namespace OpenSim.Region.CoreModules.Hypergrid
remoteClient.SendMapBlock(mapBlocks, 0); remoteClient.SendMapBlock(mapBlocks, 0);
return mapBlocks;
} }

View File

@ -208,7 +208,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
//m_log.DebugFormat("[MAPLAYER]: path: {0}, param: {1}, agent:{2}", //m_log.DebugFormat("[MAPLAYER]: path: {0}, param: {1}, agent:{2}",
// path, param, agentID.ToString()); // path, param, agentID.ToString());
// this is here because CAPS map requests work even beyond the 10,000 limit. // There is a major hack going on in this method. The viewer doesn't request
// map blocks (RequestMapBlocks) above 4096. That means that if we don't hack,
// grids above that cell don't have a map at all. So, here's the hack: we wait
// for this CAP request to come, and we inject the map blocks at this point.
// In a normal scenario, this request simply sends back the MapLayer (the blue color).
// In the hacked scenario, it also sends the map blocks via UDP.
//
// 6/8/2011 -- I'm adding an explicit 4096 check, so that we never forget that there is
// a hack here, and so that regions below 4096 don't get spammed with unnecessary map blocks.
if (m_scene.RegionInfo.RegionLocX >= 4096 || m_scene.RegionInfo.RegionLocY > 4096)
{
ScenePresence avatarPresence = null; ScenePresence avatarPresence = null;
m_scene.TryGetScenePresence(agentID, out avatarPresence); m_scene.TryGetScenePresence(agentID, out avatarPresence);
@ -254,6 +265,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
cachedTime = Util.UnixTimeSinceEpoch(); cachedTime = Util.UnixTimeSinceEpoch();
} }
} }
}
LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse();
mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse()); mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse());
return mapResponse.ToString(); return mapResponse.ToString();