a few more changes on Multiregion control file load

LSLKeyTest
UbitUmarov 2015-11-22 07:18:11 +00:00
parent a6187db2a7
commit b80cbf5060
2 changed files with 19 additions and 9 deletions

View File

@ -1150,7 +1150,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version);
}
if (xtr.Name.ToString() == "datetime")
else if (xtr.Name.ToString() == "datetime")
{
int value;
if (Int32.TryParse(xtr.ReadElementContentAsString(), out value))
@ -1169,7 +1169,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
{
string id = xtr.ReadElementContentAsString();
dearchivedScenes.DefaultOriginalID = id;
if (multiRegion)
if(multiRegion)
dearchivedScenes.SetRegionOriginalID(id);
}
else if (xtr.Name.ToString() == "dir")
@ -1183,21 +1183,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (Vector3.TryParse(size, out value))
{
m_incomingRegionSize = value;
dearchivedScenes.SetRegionSize(m_incomingRegionSize);
m_log.DebugFormat("[ARCHIVER]: Found region_size info {0}", m_incomingRegionSize.ToString());
if(multiRegion)
dearchivedScenes.SetRegionSize(m_incomingRegionSize);
m_log.DebugFormat("[ARCHIVER]: Found region_size info {0}",
m_incomingRegionSize.ToString());
}
}
}
}
dearchivedScenes.MultiRegionFormat = multiRegion;
if (!multiRegion && dearchivedScenes.GetScenesCount() == 0)
if (!multiRegion)
{
// Add the single scene
dearchivedScenes.StartRow();
dearchivedScenes.StartRegion();
dearchivedScenes.SetRegionOriginalID(dearchivedScenes.DefaultOriginalID);
dearchivedScenes.SetRegionDirectory("");
dearchivedScenes.SetRegionSize(m_incomingRegionSize);
}
ControlFileLoaded = true;

View File

@ -129,20 +129,27 @@ namespace OpenSim.Region.CoreModules.World.Archiver
public void SetRegionOriginalID(string id)
{
m_curRegion = new RegionInfo();
m_curRegion.Location = new Point((int)m_curX, (int)m_curY);
int x = (int)((m_curX == null) ? 0 : m_curX);
int y = (int)((m_curY == null) ? 0 : m_curY);
m_curRegion.Location = new Point(x, y);
m_curRegion.OriginalID = id;
// 'curRegion' will be saved in 'm_directory2region' when SetRegionDir() is called
}
public void SetRegionDirectory(string directory)
{
m_curRegion.Directory = directory;
m_directory2region[directory] = m_curRegion;
if(m_curRegion != null)
{
m_curRegion.Directory = directory;
m_directory2region[directory] = m_curRegion;
}
}
public void SetRegionSize(Vector3 size)
{
m_curRegion.RegionSize = size;
if(m_curRegion != null)
m_curRegion.RegionSize = size;
}
/// <summary>