Fix OAR parcel loading so that old parcels are replaced by the new instead of merged.

The --merge switch will still merge the old and new land parcelling.
viewer-2-initial-appearance
Justin Clark-Casey (justincc) 2011-01-27 18:48:48 +00:00
parent e33cb3db93
commit 5a26dc2743
6 changed files with 44 additions and 0 deletions

View File

@ -230,6 +230,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; parcel.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
landData.Add(parcel); landData.Add(parcel);
} }
if (!m_merge)
m_scene.LandChannel.Clear();
m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData); m_scene.EventManager.TriggerIncomingLandDataFromStorage(landData);
m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count); m_log.InfoFormat("[ARCHIVER]: Restored {0} parcels.", landData.Count);

View File

@ -117,6 +117,12 @@ namespace OpenSim.Region.CoreModules.World.Land
return new List<ILandObject>(); return new List<ILandObject>();
} }
public void Clear()
{
if (m_landManagementModule != null)
m_landManagementModule.Clear();
}
public List<ILandObject> ParcelsNearPoint(Vector3 position) public List<ILandObject> ParcelsNearPoint(Vector3 position)
{ {
if (m_landManagementModule != null) if (m_landManagementModule != null)

View File

@ -637,6 +637,25 @@ namespace OpenSim.Region.CoreModules.World.Land
} }
} }
/// <summary>
/// Clear the scene of all parcels
/// </summary>
public void Clear()
{
lock (m_landList)
{
foreach (ILandObject lo in m_landList.Values)
{
//m_scene.SimulationDataService.RemoveLandObject(lo.LandData.GlobalID);
m_scene.EventManager.TriggerLandObjectRemoved(lo.LandData.GlobalID);
}
m_landList.Clear();
}
ResetSimLandObjects();
}
private void performFinalLandJoin(ILandObject master, ILandObject slave) private void performFinalLandJoin(ILandObject master, ILandObject slave)
{ {
bool[,] landBitmapSlave = slave.GetLandBitmap(); bool[,] landBitmapSlave = slave.GetLandBitmap();

View File

@ -69,6 +69,11 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns></returns> /// <returns></returns>
ILandObject GetLandObject(int localID); ILandObject GetLandObject(int localID);
/// <summary>
/// Clear the land channel of all parcels.
/// </summary>
void Clear();
bool IsLandPrimCountTainted(); bool IsLandPrimCountTainted();
bool IsForcefulBansAllowed(); bool IsForcefulBansAllowed();
void UpdateLandObject(int localID, LandData data); void UpdateLandObject(int localID, LandData data);

View File

@ -63,6 +63,11 @@ public class RegionCombinerLargeLandChannel : ILandChannel
return RootRegionLandChannel.AllParcels(); return RootRegionLandChannel.AllParcels();
} }
public void Clear()
{
RootRegionLandChannel.Clear();
}
public ILandObject GetLandObject(int x, int y) public ILandObject GetLandObject(int x, int y)
{ {
//m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y); //m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y);

View File

@ -56,6 +56,11 @@ namespace OpenSim.Tests.Common.Mock
return new List<ILandObject>(); return new List<ILandObject>();
} }
public void Clear()
{
// Intentionally blank since we don't save any parcel data in the test channel
}
protected ILandObject GetNoLand() protected ILandObject GetNoLand()
{ {
ILandObject obj = new LandObject(UUID.Zero, false, m_scene); ILandObject obj = new LandObject(UUID.Zero, false, m_scene);