/// <summary> /// Store a terrain revision in region storage /// </summary> /// <param name="ter">terrain heightfield</param> /// <param name="regionID">region UUID</param> public void StoreTerrain(double[,] ter, UUID regionID) { lock (this) { Terrain t = new Terrain(regionID, ter); SaveOrUpdate(t); } }
private void SaveOrUpdate(Terrain t) { try { Terrain old = (Terrain)manager.Get(typeof(Terrain), t.RegionID); if (old != null) { m_log.InfoFormat("[NHIBERNATE] updating terrain {0}", t.RegionID); manager.Update(t); } else { m_log.InfoFormat("[NHIBERNATE] saving terrain {0}", t.RegionID); manager.Insert(t); } } catch (Exception e) { m_log.Error("[NHIBERNATE] issue saving terrain", e); } }