From d05d065d859c8877cb910cf5748e32e1560086a6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 19 Nov 2011 00:29:52 +0000
Subject: Improve some grid region log messages to express regions at
co-ordinate (e.g. 1000, 1000) rather than meter positions (256000, 256000)
---
OpenSim/Data/IRegionData.cs | 20 ++++++++++++++++++++
.../Server/Handlers/Map/MapAddServerConnector.cs | 14 +++++++++-----
OpenSim/Services/GridService/GridService.cs | 6 +++---
OpenSim/Services/Interfaces/IGridService.cs | 21 +++++++++++++++++----
OpenSim/Services/MapImageService/MapImageService.cs | 2 +-
5 files changed, 50 insertions(+), 13 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 46dc4fb..4761a7a 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -37,10 +37,30 @@ namespace OpenSim.Data
public UUID RegionID;
public UUID ScopeID;
public string RegionName;
+
+ ///
+ /// The position in meters of this region.
+ ///
public int posX;
+
+ ///
+ /// The position in meters of this region.
+ ///
public int posY;
+
public int sizeX;
public int sizeY;
+
+ ///
+ /// Return the x-coordinate of this region. We currently assume that every region is the same size.
+ ///
+ public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } }
+
+ ///
+ /// Return the y-coordinate of this region. We currently assume that every region is the same size.
+ ///
+ public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } }
+
public Dictionary Data;
}
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
index 99f98b6..8291107 100644
--- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
+++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Server.Handlers.MapImage
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);
string body = sr.ReadToEnd();
sr.Close();
@@ -97,9 +97,14 @@ namespace OpenSim.Server.Handlers.MapImage
int x = 0, y = 0;
Int32.TryParse(request["X"].ToString(), out x);
Int32.TryParse(request["Y"].ToString(), out y);
- string type = "image/jpeg";
- if (request.ContainsKey("TYPE"))
- type = request["TYPE"].ToString();
+
+ m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y);
+
+// string type = "image/jpeg";
+//
+// if (request.ContainsKey("TYPE"))
+// type = request["TYPE"].ToString();
+
byte[] data = Convert.FromBase64String(request["DATA"].ToString());
string reason = string.Empty;
@@ -117,7 +122,6 @@ namespace OpenSim.Server.Handlers.MapImage
}
return FailureResult("Unexpected server error");
-
}
private byte[] SuccessResult()
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 82a9193..eae10e8 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -237,7 +237,7 @@ namespace OpenSim.Services.GridService
}
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;
}
@@ -250,8 +250,8 @@ namespace OpenSim.Services.GridService
m_log.DebugFormat(
"[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"]);
if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0)
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 41dd20c..7137f9a 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -103,9 +103,8 @@ namespace OpenSim.Services.Interfaces
int GetRegionFlags(UUID scopeID, UUID regionID);
}
- public class GridRegion : Object
+ public class GridRegion
{
-
///
/// The port by which http communication occurs with the region
///
@@ -149,6 +148,19 @@ namespace OpenSim.Services.Interfaces
protected IPEndPoint m_internalEndPoint;
+ ///
+ /// The co-ordinate of this region.
+ ///
+ public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } }
+
+ ///
+ /// The co-ordinate of this region
+ ///
+ public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } }
+
+ ///
+ /// The location of this region in meters.
+ ///
public int RegionLocX
{
get { return m_regionLocX; }
@@ -156,6 +168,9 @@ namespace OpenSim.Services.Interfaces
}
protected int m_regionLocX;
+ ///
+ /// The location of this region in meters.
+ ///
public int RegionLocY
{
get { return m_regionLocY; }
@@ -407,8 +422,6 @@ namespace OpenSim.Services.Interfaces
if (kvp.ContainsKey("Token"))
Token = kvp["Token"].ToString();
-
}
}
-
}
diff --git a/OpenSim/Services/MapImageService/MapImageService.cs b/OpenSim/Services/MapImageService/MapImageService.cs
index 83727b6..a85ee70 100644
--- a/OpenSim/Services/MapImageService/MapImageService.cs
+++ b/OpenSim/Services/MapImageService/MapImageService.cs
@@ -208,7 +208,7 @@ namespace OpenSim.Services.MapImageService
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 thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1);
--
cgit v1.1