public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data, Vector2 parcelOffset)
        {
            bool result = true;
            foreach (LandData t in data.Where(t => !PreprocessIncomingLandObjectFromStorage(t, parcelOffset)))
                result = false;

            if (!result || data.Count == 0) //Force a new base first, then force a merge later
                ResetSimLandObjects();

            foreach (LandData t in data)
            {
                ILandObject new_land = new LandObject(t.OwnerID, t.IsGroupOwned, m_scene);
                new_land.LandData = t;
                if (SetLandBitmapFromByteArray(new_land, !result, parcelOffset))
                    //Merge it into the large parcel if possible
                {
                    new_land.ForceUpdateLandInfo();
                    new_land.SetInfoID();
                    AddLandObject(new_land, true);
                }
            }
            if (AllParcels().Count == 0) //Serious fallback
                ResetSimLandObjects();
        }
 public void IncomingLandDataFromOAR(List<LandData> data, bool merge, Vector2 parcelOffset)
 {
     if (!merge || data.Count == 0) //Serious fallback
         ResetSimLandObjects();
     foreach (LandData t in data)
     {
         int oldRegionSize = (int)Math.Sqrt(t.Bitmap.Length * 8);
         int offset_x = (int)(parcelOffset.X > 0 ? (parcelOffset.X / 4f) : 0),
             offset_y = (int)(parcelOffset.Y > 0 ? (parcelOffset.Y / 4f) : 0),
             i = 0, bitNum = 0;
         byte tempByte;
         lock (m_landListLock)
         {
             //Update the localID
             t.LocalID = ++m_lastLandLocalID;
         }
         int x = 0, y = 0;
         for (i = 0; i < t.Bitmap.Length; i++)
         {
             tempByte = t.Bitmap[i];
             for (bitNum = 0; bitNum < 8; bitNum++)
             {
                 bool bit = Convert.ToBoolean(Convert.ToByte(tempByte >> bitNum) & (byte)1);
                 if (bit)
                     m_landIDList[offset_x + x, offset_y + y] = t.LocalID;
                 x++;
                 if (x > oldRegionSize - 1)
                 {
                     x = 0;
                     y++;
                 }
             }
         }
         ILandObject new_land = new LandObject(t.OwnerID, t.IsGroupOwned, m_scene);
         new_land.LandData = t;
         new_land.ForceUpdateLandInfo();
         lock (m_landListLock)
         {
             m_lastLandLocalID -= 1;
         }
         AddLandObject(new_land);
     }
     UpdateAllParcelBitmaps();
 }