From 6869633d76b2a6664743a608e4284b8dd7df85a6 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Sat, 28 Dec 2013 06:58:15 -0800
Subject: Add serialization/deserialization of region size to RegionInfo,
GridRegion, and RegionData. This does not modify interfaces or handling of
variable sized regions. This only enables the loading and storing of the
region size and the reporting of the region size in grid service responses.
The database tables already have the code to load and store the region size.
---
OpenSim/Services/Interfaces/IGridService.cs | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
(limited to 'OpenSim/Services/Interfaces')
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 88ac5b3..651bd97 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -177,6 +177,7 @@ namespace OpenSim.Services.Interfaces
///
/// The location of this region in meters.
+ /// DANGER DANGER! Note that this name means something different in RegionInfo.
///
public int RegionLocX
{
@@ -185,8 +186,12 @@ namespace OpenSim.Services.Interfaces
}
protected int m_regionLocX;
+ public int RegionSizeX { get; set; }
+ public int RegionSizeY { get; set; }
+
///
/// The location of this region in meters.
+ /// DANGER DANGER! Note that this name means something different in RegionInfo.
///
public int RegionLocY
{
@@ -218,10 +223,13 @@ namespace OpenSim.Services.Interfaces
m_serverURI = string.Empty;
}
+ /*
public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
+ RegionSizeX = (int)Constants.RegionSize;
+ RegionSizeY = (int)Constants.RegionSize;
m_internalEndPoint = internalEndPoint;
m_externalHostName = externalUri;
@@ -231,16 +239,21 @@ namespace OpenSim.Services.Interfaces
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
+ RegionSizeX = (int)Constants.RegionSize;
+ RegionSizeY = (int)Constants.RegionSize;
m_externalHostName = externalUri;
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)port);
}
+ */
public GridRegion(uint xcell, uint ycell)
{
m_regionLocX = (int)(xcell * Constants.RegionSize);
m_regionLocY = (int)(ycell * Constants.RegionSize);
+ RegionSizeX = (int)Constants.RegionSize;
+ RegionSizeY = (int)Constants.RegionSize;
}
public GridRegion(RegionInfo ConvertFrom)
@@ -248,6 +261,8 @@ namespace OpenSim.Services.Interfaces
m_regionName = ConvertFrom.RegionName;
m_regionLocX = (int)(ConvertFrom.RegionLocX * Constants.RegionSize);
m_regionLocY = (int)(ConvertFrom.RegionLocY * Constants.RegionSize);
+ RegionSizeX = (int)ConvertFrom.RegionSizeX;
+ RegionSizeY = (int)ConvertFrom.RegionSizeY;
m_internalEndPoint = ConvertFrom.InternalEndPoint;
m_externalHostName = ConvertFrom.ExternalHostName;
m_httpPort = ConvertFrom.HttpPort;
@@ -266,6 +281,8 @@ namespace OpenSim.Services.Interfaces
m_regionName = ConvertFrom.RegionName;
m_regionLocX = ConvertFrom.RegionLocX;
m_regionLocY = ConvertFrom.RegionLocY;
+ RegionSizeX = ConvertFrom.RegionSizeX;
+ RegionSizeY = ConvertFrom.RegionSizeY;
m_internalEndPoint = ConvertFrom.InternalEndPoint;
m_externalHostName = ConvertFrom.ExternalHostName;
m_httpPort = ConvertFrom.HttpPort;
@@ -373,6 +390,8 @@ namespace OpenSim.Services.Interfaces
kvp["uuid"] = RegionID.ToString();
kvp["locX"] = RegionLocX.ToString();
kvp["locY"] = RegionLocY.ToString();
+ kvp["sizeX"] = RegionSizeX.ToString();
+ kvp["sizeY"] = RegionSizeY.ToString();
kvp["regionName"] = RegionName;
kvp["serverIP"] = ExternalHostName; //ExternalEndPoint.Address.ToString();
kvp["serverHttpPort"] = HttpPort.ToString();
@@ -399,6 +418,12 @@ namespace OpenSim.Services.Interfaces
if (kvp.ContainsKey("locY"))
RegionLocY = Convert.ToInt32((string)kvp["locY"]);
+ if (kvp.ContainsKey("sizeX"))
+ RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]);
+
+ if (kvp.ContainsKey("sizeY"))
+ RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]);
+
if (kvp.ContainsKey("regionName"))
RegionName = (string)kvp["regionName"];
--
cgit v1.1
From eab9390e05920ac848df4e4c9681858b70858b34 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Sat, 28 Dec 2013 07:20:14 -0800
Subject: Initialize default region size in GridRegion in the no parameter
constructor as is used by the grid connector tests.
---
OpenSim/Services/Interfaces/IGridService.cs | 2 ++
1 file changed, 2 insertions(+)
(limited to 'OpenSim/Services/Interfaces')
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 651bd97..59d6167 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -220,6 +220,8 @@ namespace OpenSim.Services.Interfaces
public GridRegion()
{
+ RegionSizeX = (int)Constants.RegionSize;
+ RegionSizeY = (int)Constants.RegionSize;
m_serverURI = string.Empty;
}
--
cgit v1.1
From 7e32313a491defe8f5fb62ce0036c1692d4b4af9 Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Fri, 3 Jan 2014 07:41:06 -0800
Subject: varregion: Add region size to teleport event messages
(EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service
return the region size. Many teleport related debug log messages. Can be
removed when teleport works (like that's ever going to happen).
Conflicts:
OpenSim/Framework/RegionInfo.cs
---
OpenSim/Services/Interfaces/IGridService.cs | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'OpenSim/Services/Interfaces')
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 59d6167..9459ecd 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -29,9 +29,13 @@ using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
+using System.Reflection;
+
using OpenSim.Framework;
using OpenMetaverse;
+using log4net;
+
namespace OpenSim.Services.Interfaces
{
public interface IGridService
@@ -119,6 +123,9 @@ namespace OpenSim.Services.Interfaces
public class GridRegion
{
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+ private static readonly string LogHeader = "[GRID REGION]";
+
///
/// The port by which http communication occurs with the region
///
@@ -422,9 +429,13 @@ namespace OpenSim.Services.Interfaces
if (kvp.ContainsKey("sizeX"))
RegionSizeX = Convert.ToInt32((string)kvp["sizeX"]);
+ else
+ RegionSizeX = (int)Constants.RegionSize;
if (kvp.ContainsKey("sizeY"))
RegionSizeY = Convert.ToInt32((string)kvp["sizeY"]);
+ else
+ RegionSizeX = (int)Constants.RegionSize;
if (kvp.ContainsKey("regionName"))
RegionName = (string)kvp["regionName"];
@@ -473,6 +484,9 @@ namespace OpenSim.Services.Interfaces
if (kvp.ContainsKey("Token"))
Token = kvp["Token"].ToString();
+
+ m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>",
+ LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY);
}
}
}
--
cgit v1.1
From 8ff2ff1a3667a679c4e8e8502a80e03e7e2ca69d Mon Sep 17 00:00:00 2001
From: Robert Adams
Date: Sat, 4 Jan 2014 15:10:35 -0800
Subject: Remove some chatty DebugFormat statements. No functional changes.
---
OpenSim/Services/Interfaces/IGridService.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Services/Interfaces')
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 9459ecd..739e279 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -485,8 +485,8 @@ namespace OpenSim.Services.Interfaces
if (kvp.ContainsKey("Token"))
Token = kvp["Token"].ToString();
- m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>",
- LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY);
+ // m_log.DebugFormat("{0} New GridRegion. id={1}, loc=<{2},{3}>, size=<{4},{5}>",
+ // LogHeader, RegionID, RegionLocX, RegionLocY, RegionSizeX, RegionSizeY);
}
}
}
--
cgit v1.1