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