aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-19 00:29:52 +0000
committerJustin Clark-Casey (justincc)2011-11-19 00:29:52 +0000
commitd05d065d859c8877cb910cf5748e32e1560086a6 (patch)
treeb4b6d1053da7b49810cdd72ae265e2457d2e43e4 /OpenSim
parentimprove region deregistration log message (diff)
downloadopensim-SC_OLD-d05d065d859c8877cb910cf5748e32e1560086a6.zip
opensim-SC_OLD-d05d065d859c8877cb910cf5748e32e1560086a6.tar.gz
opensim-SC_OLD-d05d065d859c8877cb910cf5748e32e1560086a6.tar.bz2
opensim-SC_OLD-d05d065d859c8877cb910cf5748e32e1560086a6.tar.xz
Improve some grid region log messages to express regions at co-ordinate (e.g. 1000, 1000) rather than meter positions (256000, 256000)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/IRegionData.cs20
-rw-r--r--OpenSim/Server/Handlers/Map/MapAddServerConnector.cs14
-rw-r--r--OpenSim/Services/GridService/GridService.cs6
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs21
-rw-r--r--OpenSim/Services/MapImageService/MapImageService.cs2
5 files changed, 50 insertions, 13 deletions
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
37 public UUID RegionID; 37 public UUID RegionID;
38 public UUID ScopeID; 38 public UUID ScopeID;
39 public string RegionName; 39 public string RegionName;
40
41 /// <summary>
42 /// The position in meters of this region.
43 /// </summary>
40 public int posX; 44 public int posX;
45
46 /// <summary>
47 /// The position in meters of this region.
48 /// </summary>
41 public int posY; 49 public int posY;
50
42 public int sizeX; 51 public int sizeX;
43 public int sizeY; 52 public int sizeY;
53
54 /// <summary>
55 /// Return the x-coordinate of this region. We currently assume that every region is the same size.
56 /// </summary>
57 public int coordX { get { return (sizeX != 0) ? posX / sizeX : -1; } }
58
59 /// <summary>
60 /// Return the y-coordinate of this region. We currently assume that every region is the same size.
61 /// </summary>
62 public int coordY { get { return (sizeY != 0) ? posY / sizeY : -1; } }
63
44 public Dictionary<string, object> Data; 64 public Dictionary<string, object> Data;
45 } 65 }
46 66
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
79 79
80 public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse) 80 public override byte[] Handle(string path, Stream requestData, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
81 { 81 {
82 m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); 82// m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path);
83 StreamReader sr = new StreamReader(requestData); 83 StreamReader sr = new StreamReader(requestData);
84 string body = sr.ReadToEnd(); 84 string body = sr.ReadToEnd();
85 sr.Close(); 85 sr.Close();
@@ -97,9 +97,14 @@ namespace OpenSim.Server.Handlers.MapImage
97 int x = 0, y = 0; 97 int x = 0, y = 0;
98 Int32.TryParse(request["X"].ToString(), out x); 98 Int32.TryParse(request["X"].ToString(), out x);
99 Int32.TryParse(request["Y"].ToString(), out y); 99 Int32.TryParse(request["Y"].ToString(), out y);
100 string type = "image/jpeg"; 100
101 if (request.ContainsKey("TYPE")) 101 m_log.DebugFormat("[MAP ADD SERVER CONNECTOR]: Received map data for region at {0}-{1}", x, y);
102 type = request["TYPE"].ToString(); 102
103// string type = "image/jpeg";
104//
105// if (request.ContainsKey("TYPE"))
106// type = request["TYPE"].ToString();
107
103 byte[] data = Convert.FromBase64String(request["DATA"].ToString()); 108 byte[] data = Convert.FromBase64String(request["DATA"].ToString());
104 109
105 string reason = string.Empty; 110 string reason = string.Empty;
@@ -117,7 +122,6 @@ namespace OpenSim.Server.Handlers.MapImage
117 } 122 }
118 123
119 return FailureResult("Unexpected server error"); 124 return FailureResult("Unexpected server error");
120
121 } 125 }
122 126
123 private byte[] SuccessResult() 127 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
237 } 237 }
238 238
239 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}", 239 m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
240 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY); 240 regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionCoordX, regionInfos.RegionCoordY);
241 241
242 return String.Empty; 242 return String.Empty;
243 } 243 }
@@ -250,8 +250,8 @@ namespace OpenSim.Services.GridService
250 250
251 m_log.DebugFormat( 251 m_log.DebugFormat(
252 "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}", 252 "[GRID SERVICE]: Degistering region {0} ({1}) at {2}-{3}",
253 region.RegionName, region.RegionID, region.posX, region.posY); 253 region.RegionName, region.RegionID, region.coordX, region.coordY);
254 254
255 int flags = Convert.ToInt32(region.Data["flags"]); 255 int flags = Convert.ToInt32(region.Data["flags"]);
256 256
257 if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0) 257 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
103 int GetRegionFlags(UUID scopeID, UUID regionID); 103 int GetRegionFlags(UUID scopeID, UUID regionID);
104 } 104 }
105 105
106 public class GridRegion : Object 106 public class GridRegion
107 { 107 {
108
109 /// <summary> 108 /// <summary>
110 /// The port by which http communication occurs with the region 109 /// The port by which http communication occurs with the region
111 /// </summary> 110 /// </summary>
@@ -149,6 +148,19 @@ namespace OpenSim.Services.Interfaces
149 148
150 protected IPEndPoint m_internalEndPoint; 149 protected IPEndPoint m_internalEndPoint;
151 150
151 /// <summary>
152 /// The co-ordinate of this region.
153 /// </summary>
154 public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } }
155
156 /// <summary>
157 /// The co-ordinate of this region
158 /// </summary>
159 public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } }
160
161 /// <summary>
162 /// The location of this region in meters.
163 /// </summary>
152 public int RegionLocX 164 public int RegionLocX
153 { 165 {
154 get { return m_regionLocX; } 166 get { return m_regionLocX; }
@@ -156,6 +168,9 @@ namespace OpenSim.Services.Interfaces
156 } 168 }
157 protected int m_regionLocX; 169 protected int m_regionLocX;
158 170
171 /// <summary>
172 /// The location of this region in meters.
173 /// </summary>
159 public int RegionLocY 174 public int RegionLocY
160 { 175 {
161 get { return m_regionLocY; } 176 get { return m_regionLocY; }
@@ -407,8 +422,6 @@ namespace OpenSim.Services.Interfaces
407 422
408 if (kvp.ContainsKey("Token")) 423 if (kvp.ContainsKey("Token"))
409 Token = kvp["Token"].ToString(); 424 Token = kvp["Token"].ToString();
410
411 } 425 }
412 } 426 }
413
414} 427}
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
208 208
209 private bool CreateTile(uint zoomLevel, int x, int y) 209 private bool CreateTile(uint zoomLevel, int x, int y)
210 { 210 {
211 m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel); 211// m_log.DebugFormat("[MAP IMAGE SERVICE]: Create tile for {0} {1}, zoom {2}", x, y, zoomLevel);
212 int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2); 212 int prevWidth = (int)Math.Pow(2, (double)zoomLevel - 2);
213 int thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1); 213 int thisWidth = (int)Math.Pow(2, (double)zoomLevel - 1);
214 214