diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 05f9f26..4e11150 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -915,10 +915,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
915 | 915 | ||
916 | landID = m_lastLandLocalID; | 916 | landID = m_lastLandLocalID; |
917 | } | 917 | } |
918 | else | ||
919 | { | ||
920 | // XXX: We're not currently doing anything if there are no parcels, as this might indicate a race | ||
921 | // condition where this method is being called before land data is loaded. May need to address | ||
922 | // this in another way. | ||
918 | 923 | ||
919 | // XXX: We're not currently doing anything if there are no parcels, as this might indicate a race | 924 | m_log.WarnFormat( |
920 | // condition where this method is being called before land data is loaded. May need to address | 925 | "[{0}]: Ignoring request to auto-create parcel in {1} as there are no other parcels present", |
921 | // this in another way. | 926 | LogHeader, m_scene.Name); |
927 | } | ||
922 | } | 928 | } |
923 | 929 | ||
924 | ret = m_landList[landID]; | 930 | ret = m_landList[landID]; |
@@ -1545,16 +1551,21 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1545 | 1551 | ||
1546 | #region Land Object From Storage Functions | 1552 | #region Land Object From Storage Functions |
1547 | 1553 | ||
1548 | public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) | 1554 | private void EventManagerOnIncomingLandDataFromStorage(List<LandData> data) |
1549 | { | 1555 | { |
1550 | // m_log.DebugFormat( | 1556 | // m_log.DebugFormat( |
1551 | // "[LAND MANAGMENT MODULE]: Processing {0} incoming parcels on {1}", data.Count, m_scene.Name); | 1557 | // "[LAND MANAGMENT MODULE]: Processing {0} incoming parcels on {1}", data.Count, m_scene.Name); |
1552 | 1558 | ||
1553 | for (int i = 0; i < data.Count; i++) | 1559 | // Prevent race conditions from any auto-creation of new parcels for varregions whilst we are still loading |
1554 | IncomingLandObjectFromStorage(data[i]); | 1560 | // the existing parcels. |
1561 | lock (m_landList) | ||
1562 | { | ||
1563 | for (int i = 0; i < data.Count; i++) | ||
1564 | IncomingLandObjectFromStorage(data[i]); | ||
1565 | } | ||
1555 | } | 1566 | } |
1556 | 1567 | ||
1557 | public void IncomingLandObjectFromStorage(LandData data) | 1568 | private void IncomingLandObjectFromStorage(LandData data) |
1558 | { | 1569 | { |
1559 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); | 1570 | ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); |
1560 | new_land.LandData = data.Copy(); | 1571 | new_land.LandData = data.Copy(); |