Improve some grid region log messages to express regions at co-ordinate (e.g. 1000, 1000) rather than meter positions (256000, 256000)
parent
63aa448608
commit
06ed824711
|
@ -37,10 +37,30 @@ namespace OpenSim.Data
|
||||||
public UUID RegionID;
|
public UUID RegionID;
|
||||||
public UUID ScopeID;
|
public UUID ScopeID;
|
||||||
public string RegionName;
|
public string RegionName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The position in meters of this region.
|
||||||
|
/// </summary>
|
||||||
public int posX;
|
public int posX;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The position in meters of this region.
|
||||||
|
/// </summary>
|
||||||
public int posY;
|
public int posY;
|
||||||
|
|
||||||
public int sizeX;
|
public int sizeX;
|
||||||
public int sizeY;
|
public int sizeY;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the x-coordinate of this region. We currently assume that every region is the same size.
|
||||||
|
/// </summary>
|
||||||
|
public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the y-coordinate of this region. We currently assume that every region is the same size.
|
||||||
|
/// </summary>
|
||||||
|
public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } }
|
||||||
|
|
||||||
public Dictionary<string, object> Data;
|
public Dictionary<string, object> Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Server.Handlers.MapImage
|
||||||
|
|
||||||
public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
|
// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
|
||||||
StreamReader sr = new StreamReader(requestData);
|
StreamReader sr = new StreamReader(requestData);
|
||||||
string body = sr.ReadToEnd();
|
string body = sr.ReadToEnd();
|
||||||
sr.Close();
|
sr.Close();
|
||||||
|
@ -97,9 +97,14 @@ namespace OpenSim.Server.Handlers.MapImage
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
Int32.TryParse(request["X"].ToString(), out x);
|
Int32.TryParse(request["X"].ToString(), out x);
|
||||||
Int32.TryParse(request["Y"].ToString(), out y);
|
Int32.TryParse(request["Y"].ToString(), out y);
|
||||||
string type = "image/jpeg";
|
|
||||||
if (request.ContainsKey("TYPE"))
|
m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y);
|
||||||
type = request["TYPE"].ToString();
|
|
||||||
|
// string type = "image/jpeg";
|
||||||
|
//
|
||||||
|
// if (request.ContainsKey("TYPE"))
|
||||||
|
// type = request["TYPE"].ToString();
|
||||||
|
|
||||||
byte[] data = Convert.FromBase64String(request["DATA"].ToString());
|
byte[] data = Convert.FromBase64String(request["DATA"].ToString());
|
||||||
|
|
||||||
string reason = string.Empty;
|
string reason = string.Empty;
|
||||||
|
@ -117,7 +122,6 @@ namespace OpenSim.Server.Handlers.MapImage
|
||||||
}
|
}
|
||||||
|
|
||||||
return FailureResult("Unexpected server error");
|
return FailureResult("Unexpected server error");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] SuccessResult()
|
private byte[] SuccessResult()
|
||||||
|
|
|
@ -232,7 +232,7 @@ namespace OpenSim.Services.GridService
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
|
m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
|
||||||
regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
|
regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY);
|
||||||
|
|
||||||
return String.Empty;
|
return String.Empty;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ namespace OpenSim.Services.GridService
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}",
|
"[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}",
|
||||||
region.RegionName, region.RegionID, region.posX, region.posY);
|
region.RegionName, region.RegionID, region.coordX, region.coordY);
|
||||||
|
|
||||||
int flags = Convert.ToInt32(region.Data["flags"]);
|
int flags = Convert.ToInt32(region.Data["flags"]);
|
||||||
|
|
||||||
|
|
|
@ -103,9 +103,8 @@ namespace OpenSim.Services.Interfaces
|
||||||
int GetRegionFlags(UUID scopeID, UUID regionID);
|
int GetRegionFlags(UUID scopeID, UUID regionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GridRegion : Object
|
public class GridRegion
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The port by which http communication occurs with the region
|
/// The port by which http communication occurs with the region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -149,6 +148,19 @@ namespace OpenSim.Services.Interfaces
|
||||||
|
|
||||||
protected IPEndPoint m_internalEndPoint;
|
protected IPEndPoint m_internalEndPoint;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The co-ordinate of this region.
|
||||||
|
/// </summary>
|
||||||
|
public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The co-ordinate of this region
|
||||||
|
/// </summary>
|
||||||
|
public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The location of this region in meters.
|
||||||
|
/// </summary>
|
||||||
public int RegionLocX
|
public int RegionLocX
|
||||||
{
|
{
|
||||||
get { return m_regionLocX; }
|
get { return m_regionLocX; }
|
||||||
|
@ -156,6 +168,9 @@ namespace OpenSim.Services.Interfaces
|
||||||
}
|
}
|
||||||
protected int m_regionLocX;
|
protected int m_regionLocX;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The location of this region in meters.
|
||||||
|
/// </summary>
|
||||||
public int RegionLocY
|
public int RegionLocY
|
||||||
{
|
{
|
||||||
get { return m_regionLocY; }
|
get { return m_regionLocY; }
|
||||||
|
@ -407,8 +422,6 @@ namespace OpenSim.Services.Interfaces
|
||||||
|
|
||||||
if (kvp.ContainsKey("Token"))
|
if (kvp.ContainsKey("Token"))
|
||||||
Token = kvp["Token"].ToString();
|
Token = kvp["Token"].ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ namespace OpenSim.Services.MapImageService
|
||||||
|
|
||||||
private bool CreateTile(uint zoomLevel, int x, int y)
|
private bool CreateTile(uint zoomLevel, int x, int y)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel);
|
// m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel);
|
||||||
int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2);
|
int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2);
|
||||||
int thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1);
|
int thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue