- Moved WorldMapModule and HGWorldMapModule to the new region-module system
- Cleaned up some whitespace0.6.5-rc1
parent
2246b4daaa
commit
6a08accde0
|
@ -37,30 +37,51 @@ using OpenSim.Region.Framework.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Hypergrid
|
namespace OpenSim.Region.CoreModules.Hypergrid
|
||||||
{
|
{
|
||||||
public class HGWorldMapModule : WorldMapModule, IRegionModule
|
public class HGWorldMapModule : WorldMapModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
#region IRegionModule Members
|
#region INonSharedRegionModule Members
|
||||||
|
|
||||||
public override void Initialise(Scene scene, IConfigSource config)
|
public override void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
IConfig startupConfig = config.Configs["Startup"];
|
IConfig startupConfig = config.Configs["Startup"];
|
||||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap")
|
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "HGWorldMap")
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddRegion(Scene scene)
|
||||||
|
{
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_log.Info("[HGMap] Initializing...");
|
m_log.Info("[HGMap] Initializing...");
|
||||||
m_scene = scene;
|
lock (scene)
|
||||||
|
{
|
||||||
|
m_scene = scene;
|
||||||
|
|
||||||
m_scene.RegisterModuleInterface<IWorldMapModule>(this);
|
m_scene.RegisterModuleInterface<IWorldMapModule>(this);
|
||||||
|
|
||||||
m_scene.AddCommand(
|
m_scene.AddCommand(
|
||||||
this, "export-map",
|
this, "export-map",
|
||||||
"export-map [<path>]",
|
"export-map [<path>]",
|
||||||
"Save an image of the world map", HandleExportWorldMapConsoleCommand);
|
"Save an image of the world map", HandleExportWorldMapConsoleCommand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void RemoveRegion(Scene scene)
|
||||||
|
{
|
||||||
|
if (!m_Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
lock (m_scene)
|
||||||
|
{
|
||||||
|
m_Enabled = false;
|
||||||
|
m_scene.UnregisterModuleInterface<IWorldMapModule>(this);
|
||||||
|
// TODO: m_scene.RemoveCommand(this, "export-map");
|
||||||
|
m_scene = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
|
@ -158,5 +179,5 @@ namespace OpenSim.Region.CoreModules.Hypergrid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
<Extension path = "/OpenSim/RegionModules">
|
<Extension path = "/OpenSim/RegionModules">
|
||||||
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />
|
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />
|
||||||
|
<RegionModule id="WorldMapModule" type="OpenSim.Region.CoreModules.World.WorldMap.WorldMapModule" />
|
||||||
|
<RegionModule id="HGWorldMapModule" type="OpenSim.Region.CoreModules.Hypergrid.HGWorldMapModule" />
|
||||||
</Extension>
|
</Extension>
|
||||||
|
|
||||||
<Extension path = "/OpenSim/WindModule">
|
<Extension path = "/OpenSim/WindModule">
|
||||||
|
|
|
@ -50,11 +50,11 @@ using OSDMap=OpenMetaverse.StructuredData.OSDMap;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.World.WorldMap
|
namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
{
|
{
|
||||||
public class WorldMapModule : IRegionModule, IWorldMapModule
|
public class WorldMapModule : INonSharedRegionModule, IWorldMapModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log =
|
private static readonly ILog m_log =
|
||||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private static readonly string DEFAULT_WORLD_MAP_EXPORT_PATH = "exportmap.jpg";
|
private static readonly string DEFAULT_WORLD_MAP_EXPORT_PATH = "exportmap.jpg";
|
||||||
|
|
||||||
private static readonly string m_mapLayerPath = "0001/";
|
private static readonly string m_mapLayerPath = "0001/";
|
||||||
|
@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>();
|
private List<MapBlockData> cachedMapBlocks = new List<MapBlockData>();
|
||||||
private int cachedTime = 0;
|
private int cachedTime = 0;
|
||||||
private byte[] myMapImageJPEG;
|
private byte[] myMapImageJPEG;
|
||||||
protected bool m_Enabled = false;
|
protected volatile bool m_Enabled = false;
|
||||||
private Dictionary<UUID, MapRequestState> m_openRequests = new Dictionary<UUID, MapRequestState>();
|
private Dictionary<UUID, MapRequestState> m_openRequests = new Dictionary<UUID, MapRequestState>();
|
||||||
private Dictionary<string, int> m_blacklistedurls = new Dictionary<string, int>();
|
private Dictionary<string, int> m_blacklistedurls = new Dictionary<string, int>();
|
||||||
private Dictionary<ulong, int> m_blacklistedregions = new Dictionary<ulong, int>();
|
private Dictionary<ulong, int> m_blacklistedregions = new Dictionary<ulong, int>();
|
||||||
|
@ -77,33 +77,52 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
|
|
||||||
//private int CacheRegionsDistance = 256;
|
//private int CacheRegionsDistance = 256;
|
||||||
|
|
||||||
#region IRegionModule Members
|
#region INonSharedRegionModule Members
|
||||||
|
public virtual void Initialise (IConfigSource config)
|
||||||
public virtual void Initialise(Scene scene, IConfigSource config)
|
|
||||||
{
|
{
|
||||||
IConfig startupConfig = config.Configs["Startup"];
|
IConfig startupConfig = config.Configs["Startup"];
|
||||||
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap")
|
if (startupConfig.GetString("WorldMapModule", "WorldMap") == "WorldMap")
|
||||||
m_Enabled = true;
|
m_Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void AddRegion (Scene scene)
|
||||||
|
{
|
||||||
if (!m_Enabled)
|
if (!m_Enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_scene = scene;
|
lock (scene)
|
||||||
|
{
|
||||||
m_scene.RegisterModuleInterface<IWorldMapModule>(this);
|
m_scene = scene;
|
||||||
|
|
||||||
m_scene.AddCommand(
|
m_scene.RegisterModuleInterface<IWorldMapModule>(this);
|
||||||
this, "export-map",
|
|
||||||
"export-map [<path>]",
|
m_scene.AddCommand(
|
||||||
"Save an image of the world map", HandleExportWorldMapConsoleCommand);
|
this, "export-map",
|
||||||
}
|
"export-map [<path>]",
|
||||||
|
"Save an image of the world map", HandleExportWorldMapConsoleCommand);
|
||||||
|
|
||||||
public virtual void PostInitialise()
|
|
||||||
{
|
|
||||||
if (m_Enabled)
|
|
||||||
AddHandlers();
|
AddHandlers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void RemoveRegion (Scene scene)
|
||||||
|
{
|
||||||
|
if (!m_Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
lock (m_scene)
|
||||||
|
{
|
||||||
|
m_Enabled = false;
|
||||||
|
RemoveHandlers();
|
||||||
|
m_scene = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void RegionLoaded (Scene scene)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual void Close()
|
public virtual void Close()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -113,13 +132,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
get { return "WorldMapModule"; }
|
get { return "WorldMapModule"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsSharedModule
|
|
||||||
{
|
|
||||||
get { return false; }
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
// this has to be called with a lock on m_scene
|
||||||
protected virtual void AddHandlers()
|
protected virtual void AddHandlers()
|
||||||
{
|
{
|
||||||
myMapImageJPEG = new byte[0];
|
myMapImageJPEG = new byte[0];
|
||||||
|
@ -139,6 +154,22 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
m_scene.EventManager.OnMakeRootAgent += MakeRootAgent;
|
m_scene.EventManager.OnMakeRootAgent += MakeRootAgent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this has to be called with a lock on m_scene
|
||||||
|
protected virtual void RemoveHandlers()
|
||||||
|
{
|
||||||
|
m_scene.EventManager.OnMakeRootAgent -= MakeRootAgent;
|
||||||
|
m_scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
|
||||||
|
m_scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||||
|
m_scene.EventManager.OnNewClient -= OnNewClient;
|
||||||
|
m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
|
||||||
|
|
||||||
|
string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString();
|
||||||
|
regionimage = regionimage.Replace("-", "");
|
||||||
|
m_scene.CommsManager.HttpServer.RemoveLLSDHandler("/MAP/MapItems/" + m_scene.RegionInfo.RegionHandle.ToString(),
|
||||||
|
HandleRemoteMapItemRequest);
|
||||||
|
m_scene.CommsManager.HttpServer.RemoveHTTPHandler("", regionimage);
|
||||||
|
}
|
||||||
|
|
||||||
public void OnRegisterCaps(UUID agentID, Caps caps)
|
public void OnRegisterCaps(UUID agentID, Caps caps)
|
||||||
{
|
{
|
||||||
//m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
|
//m_log.DebugFormat("[WORLD MAP]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
|
||||||
|
@ -246,7 +277,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
private void OnNewClient(IClientAPI client)
|
private void OnNewClient(IClientAPI client)
|
||||||
{
|
{
|
||||||
client.OnRequestMapBlocks += RequestMapBlocks;
|
client.OnRequestMapBlocks += RequestMapBlocks;
|
||||||
client.OnMapItemRequest += HandleMapItemRequest;
|
client.OnMapItemRequest += HandleMapItemRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -269,7 +300,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
if (rootcount <= 1)
|
if (rootcount <= 1)
|
||||||
StopThread();
|
StopThread();
|
||||||
|
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
{
|
{
|
||||||
if (m_rootAgents.Contains(AgentId))
|
if (m_rootAgents.Contains(AgentId))
|
||||||
|
@ -316,7 +347,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
requests.Enqueue(st);
|
requests.Enqueue(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags,
|
public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags,
|
||||||
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
||||||
{
|
{
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
|
@ -330,7 +361,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
if (itemtype == 6) // we only sevice 6 right now (avatar green dots)
|
if (itemtype == 6) // we only sevice 6 right now (avatar green dots)
|
||||||
{
|
{
|
||||||
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
|
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
|
||||||
{
|
{
|
||||||
// Local Map Item Request
|
// Local Map Item Request
|
||||||
List<ScenePresence> avatars = m_scene.GetAvatars();
|
List<ScenePresence> avatars = m_scene.GetAvatars();
|
||||||
int tc = Environment.TickCount;
|
int tc = Environment.TickCount;
|
||||||
|
@ -372,7 +403,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
// Remote Map Item Request
|
// Remote Map Item Request
|
||||||
|
|
||||||
// ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes.
|
// ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes.
|
||||||
// Note that we only start up a remote mapItem Request thread if there's users who could
|
// Note that we only start up a remote mapItem Request thread if there's users who could
|
||||||
// be making requests
|
// be making requests
|
||||||
if (!threadrunning)
|
if (!threadrunning)
|
||||||
{
|
{
|
||||||
|
@ -395,14 +426,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
MapRequestState st = requests.Dequeue();
|
MapRequestState st = requests.Dequeue();
|
||||||
|
|
||||||
// end gracefully
|
// end gracefully
|
||||||
if (st.agentID == UUID.Zero)
|
if (st.agentID == UUID.Zero)
|
||||||
{
|
{
|
||||||
ThreadTracker.Remove(mapItemReqThread);
|
ThreadTracker.Remove(mapItemReqThread);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dorequest = true;
|
bool dorequest = true;
|
||||||
lock (m_rootAgents)
|
lock (m_rootAgents)
|
||||||
{
|
{
|
||||||
|
@ -421,7 +452,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[WORLD MAP]: Map item request thread terminated abnormally with exception {0}", e);
|
m_log.ErrorFormat("[WORLD MAP]: Map item request thread terminated abnormally with exception {0}", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
threadrunning = false;
|
threadrunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,11 +529,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
|
||||||
{
|
{
|
||||||
MapRequestState st = new MapRequestState();
|
MapRequestState st = new MapRequestState();
|
||||||
st.agentID = id;
|
st.agentID = id;
|
||||||
st.flags = flags;
|
st.flags = flags;
|
||||||
st.EstateID = EstateID;
|
st.EstateID = EstateID;
|
||||||
st.godlike = godlike;
|
st.godlike = godlike;
|
||||||
st.itemtype = itemtype;
|
st.itemtype = itemtype;
|
||||||
st.regionhandle = regionhandle;
|
st.regionhandle = regionhandle;
|
||||||
EnqueueMapItemRequest(st);
|
EnqueueMapItemRequest(st);
|
||||||
}
|
}
|
||||||
|
@ -510,7 +541,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Does the actual remote mapitem request
|
/// Does the actual remote mapitem request
|
||||||
/// This should be called from an asynchronous thread
|
/// This should be called from an asynchronous thread
|
||||||
/// Request failures get blacklisted until region restart so we don't
|
/// Request failures get blacklisted until region restart so we don't
|
||||||
/// continue to spend resources trying to contact regions that are down.
|
/// continue to spend resources trying to contact regions that are down.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="httpserver">blank string, we discover this in the process</param>
|
/// <param name="httpserver">blank string, we discover this in the process</param>
|
||||||
|
@ -543,7 +574,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
if (httpserver.Length == 0)
|
if (httpserver.Length == 0)
|
||||||
{
|
{
|
||||||
RegionInfo mreg = m_scene.SceneGridService.RequestNeighbouringRegionInfo(regionhandle);
|
RegionInfo mreg = m_scene.SceneGridService.RequestNeighbouringRegionInfo(regionhandle);
|
||||||
|
|
||||||
if (mreg != null)
|
if (mreg != null)
|
||||||
{
|
{
|
||||||
httpserver = "http://" + mreg.ExternalEndPoint.Address.ToString() + ":" + mreg.HttpPort + "/MAP/MapItems/" + regionhandle.ToString();
|
httpserver = "http://" + mreg.ExternalEndPoint.Address.ToString() + ":" + mreg.HttpPort + "/MAP/MapItems/" + regionhandle.ToString();
|
||||||
|
@ -682,7 +713,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
if ((flag & 0x10000) != 0) // user clicked on the map a tile that isn't visible
|
if ((flag & 0x10000) != 0) // user clicked on the map a tile that isn't visible
|
||||||
{
|
{
|
||||||
List<MapBlockData> response = new List<MapBlockData>();
|
List<MapBlockData> response = new List<MapBlockData>();
|
||||||
|
|
||||||
// this should return one mapblock at most. But make sure: Look whether the one we requested is in there
|
// this should return one mapblock at most. But make sure: Look whether the one we requested is in there
|
||||||
mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
|
mapBlocks = m_scene.SceneGridService.RequestNeighbourMapBlocks(minX, minY, maxX, maxY);
|
||||||
if (mapBlocks != null)
|
if (mapBlocks != null)
|
||||||
|
@ -697,7 +728,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.Count == 0)
|
if (response.Count == 0)
|
||||||
{
|
{
|
||||||
// response still empty => couldn't find the map-tile the user clicked on => tell the client
|
// response still empty => couldn't find the map-tile the user clicked on => tell the client
|
||||||
|
@ -796,13 +827,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Export the world map
|
/// Export the world map
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="fileName"></param>
|
/// <param name="fileName"></param>
|
||||||
public void HandleExportWorldMapConsoleCommand(string module, string[] cmdparams)
|
public void HandleExportWorldMapConsoleCommand(string module, string[] cmdparams)
|
||||||
{
|
{
|
||||||
if (m_scene.ConsoleScene() == null)
|
if (m_scene.ConsoleScene() == null)
|
||||||
{
|
{
|
||||||
// FIXME: If console region is root then this will be printed by every module. Currently, there is no
|
// FIXME: If console region is root then this will be printed by every module. Currently, there is no
|
||||||
|
@ -811,20 +842,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
m_log.InfoFormat("[WORLD MAP]: Please change to a specific region in order to export its world map");
|
m_log.InfoFormat("[WORLD MAP]: Please change to a specific region in order to export its world map");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_scene.ConsoleScene() != m_scene)
|
if (m_scene.ConsoleScene() != m_scene)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string exportPath;
|
string exportPath;
|
||||||
|
|
||||||
if (cmdparams.Length > 1)
|
if (cmdparams.Length > 1)
|
||||||
exportPath = cmdparams[1];
|
exportPath = cmdparams[1];
|
||||||
else
|
else
|
||||||
exportPath = DEFAULT_WORLD_MAP_EXPORT_PATH;
|
exportPath = DEFAULT_WORLD_MAP_EXPORT_PATH;
|
||||||
|
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
"[WORLD MAP]: Exporting world map for {0} to {1}", m_scene.RegionInfo.RegionName, exportPath);
|
"[WORLD MAP]: Exporting world map for {0} to {1}", m_scene.RegionInfo.RegionName, exportPath);
|
||||||
|
|
||||||
List<MapBlockData> mapBlocks =
|
List<MapBlockData> mapBlocks =
|
||||||
m_scene.CommsManager.GridService.RequestNeighbourMapBlocks(
|
m_scene.CommsManager.GridService.RequestNeighbourMapBlocks(
|
||||||
(int)(m_scene.RegionInfo.RegionLocX - 9),
|
(int)(m_scene.RegionInfo.RegionLocX - 9),
|
||||||
|
@ -872,19 +903,19 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
ushort y = (ushort)((mapBlocks[i].Y - m_scene.RegionInfo.RegionLocY) + 10);
|
ushort y = (ushort)((mapBlocks[i].Y - m_scene.RegionInfo.RegionLocY) + 10);
|
||||||
g.DrawImage(bitImages[i], (x * 128), (y * 128), 128, 128);
|
g.DrawImage(bitImages[i], (x * 128), (y * 128), 128, 128);
|
||||||
}
|
}
|
||||||
|
|
||||||
mapTexture.Save(exportPath, ImageFormat.Jpeg);
|
mapTexture.Save(exportPath, ImageFormat.Jpeg);
|
||||||
|
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
"[WORLD MAP]: Successfully exported world map for {0} to {1}",
|
"[WORLD MAP]: Successfully exported world map for {0} to {1}",
|
||||||
m_scene.RegionInfo.RegionName, exportPath);
|
m_scene.RegionInfo.RegionName, exportPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint)
|
public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint)
|
||||||
{
|
{
|
||||||
uint xstart = 0;
|
uint xstart = 0;
|
||||||
uint ystart = 0;
|
uint ystart = 0;
|
||||||
|
|
||||||
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart);
|
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart);
|
||||||
|
|
||||||
OSDMap responsemap = new OSDMap();
|
OSDMap responsemap = new OSDMap();
|
||||||
|
@ -892,7 +923,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
OSDArray responsearr = new OSDArray(avatars.Count);
|
OSDArray responsearr = new OSDArray(avatars.Count);
|
||||||
OSDMap responsemapdata = new OSDMap();
|
OSDMap responsemapdata = new OSDMap();
|
||||||
int tc = Environment.TickCount;
|
int tc = Environment.TickCount;
|
||||||
/*
|
/*
|
||||||
foreach (ScenePresence av in avatars)
|
foreach (ScenePresence av in avatars)
|
||||||
{
|
{
|
||||||
responsemapdata = new OSDMap();
|
responsemapdata = new OSDMap();
|
||||||
|
@ -916,10 +947,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
responsemapdata["Extra"] = OSD.FromInteger(0);
|
responsemapdata["Extra"] = OSD.FromInteger(0);
|
||||||
responsemapdata["Extra2"] = OSD.FromInteger(0);
|
responsemapdata["Extra2"] = OSD.FromInteger(0);
|
||||||
responsearr.Add(responsemapdata);
|
responsearr.Add(responsemapdata);
|
||||||
|
|
||||||
responsemap["6"] = responsearr;
|
responsemap["6"] = responsearr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
responsearr = new OSDArray(avatars.Count);
|
responsearr = new OSDArray(avatars.Count);
|
||||||
foreach (ScenePresence av in avatars)
|
foreach (ScenePresence av in avatars)
|
||||||
|
@ -937,7 +968,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
return responsemap;
|
return responsemap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LazySaveGeneratedMaptile(byte[] data, bool temporary)
|
public void LazySaveGeneratedMaptile(byte[] data, bool temporary)
|
||||||
{
|
{
|
||||||
// Overwrites the local Asset cache with new maptile data
|
// Overwrites the local Asset cache with new maptile data
|
||||||
|
@ -987,19 +1018,19 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
AssetBase asset = new AssetBase();
|
AssetBase asset = new AssetBase();
|
||||||
asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
|
asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
|
||||||
asset.Data = data;
|
asset.Data = data;
|
||||||
asset.Name
|
asset.Name
|
||||||
= "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
|
= "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString();
|
||||||
asset.Description = m_scene.RegionInfo.RegionName;
|
asset.Description = m_scene.RegionInfo.RegionName;
|
||||||
|
|
||||||
asset.Type = 0;
|
asset.Type = 0;
|
||||||
asset.Temporary = temporary;
|
asset.Temporary = temporary;
|
||||||
m_scene.CommsManager.AssetCache.AddAsset(asset);
|
m_scene.CommsManager.AssetCache.AddAsset(asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MakeRootAgent(ScenePresence avatar)
|
private void MakeRootAgent(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
// You may ask, why this is in a threadpool to start with..
|
// You may ask, why this is in a threadpool to start with..
|
||||||
// The reason is so we don't cause the thread to freeze waiting
|
// The reason is so we don't cause the thread to freeze waiting
|
||||||
// for the 1 second it costs to start a thread manually.
|
// for the 1 second it costs to start a thread manually.
|
||||||
if (!threadrunning)
|
if (!threadrunning)
|
||||||
ThreadPool.QueueUserWorkItem(new WaitCallback(this.StartThread));
|
ThreadPool.QueueUserWorkItem(new WaitCallback(this.StartThread));
|
||||||
|
@ -1036,6 +1067,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct MapRequestState
|
public struct MapRequestState
|
||||||
|
|
Loading…
Reference in New Issue