varregion: add linkage for region size in creations and conversions

of GridRegion. New variables for size and code to initialize same.
varregion
Robert Adams 2013-11-02 15:40:48 -07:00
parent f66737fe56
commit 6df7d4219d
2 changed files with 25 additions and 0 deletions

View File

@ -441,6 +441,8 @@ namespace OpenSim.Services.GridService
RegionData rdata = new RegionData();
rdata.posX = (int)rinfo.RegionLocX;
rdata.posY = (int)rinfo.RegionLocY;
rdata.sizeX = rinfo.RegionSizeX;
rdata.sizeY = rinfo.RegionSizeY;
rdata.RegionID = rinfo.RegionID;
rdata.RegionName = rinfo.RegionName;
rdata.Data = rinfo.ToKeyValuePairs();
@ -454,6 +456,8 @@ namespace OpenSim.Services.GridService
GridRegion rinfo = new GridRegion(rdata.Data);
rinfo.RegionLocX = rdata.posX;
rinfo.RegionLocY = rdata.posY;
rinfo.RegionSizeX = rdata.sizeX;
rinfo.RegionSizeY = rdata.sizeY;
rinfo.RegionID = rdata.RegionID;
rinfo.RegionName = rdata.RegionName;
rinfo.ScopeID = rdata.ScopeID;

View File

@ -185,6 +185,9 @@ namespace OpenSim.Services.Interfaces
}
protected int m_regionLocX;
public int RegionSizeX { get; set; }
public int RegionSizeY { get; set; }
/// <summary>
/// The location of this region in meters.
/// </summary>
@ -222,6 +225,8 @@ namespace OpenSim.Services.Interfaces
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
RegionSizeX = (int)Constants.RegionSize;
RegionSizeY = (int)Constants.RegionSize;
m_internalEndPoint = internalEndPoint;
m_externalHostName = externalUri;
@ -231,6 +236,8 @@ namespace OpenSim.Services.Interfaces
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
RegionSizeX = (int)Constants.RegionSize;
RegionSizeY = (int)Constants.RegionSize;
m_externalHostName = externalUri;
@ -241,6 +248,8 @@ namespace OpenSim.Services.Interfaces
{
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 +257,8 @@ namespace OpenSim.Services.Interfaces
m_regionName = ConvertFrom.RegionName;
m_regionLocX = (int)(ConvertFrom.RegionWorldLocX);
m_regionLocY = (int)(ConvertFrom.RegionWorldLocY);
RegionSizeX = (int)ConvertFrom.RegionSizeX;
RegionSizeY = (int)ConvertFrom.RegionSizeY;
m_internalEndPoint = ConvertFrom.InternalEndPoint;
m_externalHostName = ConvertFrom.ExternalHostName;
m_httpPort = ConvertFrom.HttpPort;
@ -266,6 +277,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 +386,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 +414,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"];