From dd144e12ba7a92d4a92986ccaa66d63d410ef028 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 17 Jul 2008 18:59:06 +0000 Subject: git merge --- OpenSim/Data/NHibernate/NHibernateRegionData.cs | 30 +--------------------- .../Data/NHibernate/Resources/RegionStore.hbm.xml | 21 +-------------- OpenSim/Data/NHibernate/TextureUserType.cs | 12 ++------- OpenSim/Framework/PrimitiveBaseShape.cs | 11 +------- 4 files changed, 5 insertions(+), 69 deletions(-) diff --git a/OpenSim/Data/NHibernate/NHibernateRegionData.cs b/OpenSim/Data/NHibernate/NHibernateRegionData.cs index 3ba3556..8ca0afe 100644 --- a/OpenSim/Data/NHibernate/NHibernateRegionData.cs +++ b/OpenSim/Data/NHibernate/NHibernateRegionData.cs @@ -26,7 +26,6 @@ */ using System; -using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; @@ -113,33 +112,6 @@ namespace OpenSim.Data.NHibernate { return null; } - - private void SaveOrUpdate(SceneObjectPart p) - { - try - { - ICriteria criteria = session.CreateCriteria(typeof(SceneObjectPart)); - criteria.Add(Expression.Eq("UUID", p.UUID)); - if (criteria.List().Count < 1) - { - session.Save(p); - } - else if (criteria.List().Count == 1) - { - SceneObjectPart old = (SceneObjectPart)criteria.List()[0]; - session.Evict(old); - session.Update(p); - } - else - { - m_log.Error("Not unique"); - } - } - catch (Exception e) - { - m_log.Error("[NHIBERNATE] issue saving asset", e); - } - } /// /// Adds an object into region storage @@ -153,7 +125,7 @@ namespace OpenSim.Data.NHibernate foreach (SceneObjectPart part in obj.Children.Values) { m_log.InfoFormat("Storing part {0}", part.UUID); - SaveOrUpdate(part); + session.SaveOrUpdate(part); } session.Flush(); } diff --git a/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml b/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml index 40d3864..5b8b7f2 100644 --- a/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml +++ b/OpenSim/Data/NHibernate/Resources/RegionStore.hbm.xml @@ -82,26 +82,7 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/OpenSim/Data/NHibernate/TextureUserType.cs b/OpenSim/Data/NHibernate/TextureUserType.cs index b688a16..dac7c75 100644 --- a/OpenSim/Data/NHibernate/TextureUserType.cs +++ b/OpenSim/Data/NHibernate/TextureUserType.cs @@ -49,16 +49,8 @@ namespace OpenSim.Data.NHibernate public object DeepCopy(object texture) { - if (texture == null) - { - // TODO: should parametrize this texture out - return new LLObject.TextureEntry(new LLUUID("89556747-24cb-43ed-920b-47caed15465f")); - } - else - { - byte[] bytes = ((LLObject.TextureEntry)texture).ToBytes(); - return new LLObject.TextureEntry(bytes, 0, bytes.Length); - } + byte[] bytes = ((LLObject.TextureEntry)texture).ToBytes(); + return new LLObject.TextureEntry(bytes, 0, bytes.Length); } public object Disassemble(object texture) diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 5657b66..bdd9858 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -197,13 +197,7 @@ namespace OpenSim.Framework { get { return m_textureEntry; } - set - { - if (value == null) - m_textureEntry = new byte[1]; - else - m_textureEntry = value; - } + set { m_textureEntry = value; } } @@ -844,9 +838,6 @@ namespace OpenSim.Framework public void ReadInExtraParamsBytes(byte[] data) { - if (data == null) - return; - const ushort FlexiEP = 0x10; const ushort LightEP = 0x20; const ushort SculptEP = 0x30; -- cgit v1.1