Revert "git merge"

This reverts commit 80e1c3742a3ba7eb9aa1686a242b36f64331095a.
0.6.0-stable
Sean Dague 2008-07-17 18:59:10 +00:00
parent dd144e12ba
commit 6084a7ea3e
4 changed files with 69 additions and 5 deletions

View File

@ -26,6 +26,7 @@
*/ */
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
@ -112,6 +113,33 @@ namespace OpenSim.Data.NHibernate
{ {
return null; 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);
}
}
/// <summary> /// <summary>
/// Adds an object into region storage /// Adds an object into region storage
@ -125,7 +153,7 @@ namespace OpenSim.Data.NHibernate
foreach (SceneObjectPart part in obj.Children.Values) foreach (SceneObjectPart part in obj.Children.Values)
{ {
m_log.InfoFormat("Storing part {0}", part.UUID); m_log.InfoFormat("Storing part {0}", part.UUID);
session.SaveOrUpdate(part); SaveOrUpdate(part);
} }
session.Flush(); session.Flush();
} }

View File

@ -82,7 +82,26 @@
<column name="ScaleY" /> <column name="ScaleY" />
<column name="ScaleZ" /> <column name="ScaleZ" />
</property> </property>
<property name="PCode" type="System.Byte" />
<property name="PathBegin" type="System.UInt16" />
<property name="PathEnd" type="System.UInt16" />
<property name="PathScaleX" type="System.Byte" />
<property name="PathScaleY" type="System.Byte" />
<property name="PathShearX" type="System.Byte" />
<property name="PathShearY" type="System.Byte" />
<property name="PathSkew" type="System.SByte" />
<property name="PathCurve" type="System.Byte" />
<property name="PathRadiusOffset" type="System.SByte" />
<property name="PathRevolutions" type="System.Byte" />
<property name="PathTaperX" type="System.SByte" />
<property name="PathTwist" type="System.SByte" />
<property name="ProfileBegin" type="System.UInt16" />
<property name="ProfileEnd" type="System.UInt16" />
<property name="ProfileCurve" type="System.Byte" />
<property name="ProfileHollow" type="System.UInt16" />
<property name="TextureEntry" column="Texture" type="System.Byte[]" />
<property name="ExtraParams" type="System.Byte[]" />
<property name="State" type="System.Byte" />
</component> </component>
</class> </class>

View File

@ -49,8 +49,16 @@ namespace OpenSim.Data.NHibernate
public object DeepCopy(object texture) public object DeepCopy(object texture)
{ {
byte[] bytes = ((LLObject.TextureEntry)texture).ToBytes(); if (texture == null)
return new LLObject.TextureEntry(bytes, 0, bytes.Length); {
// 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);
}
} }
public object Disassemble(object texture) public object Disassemble(object texture)

View File

@ -197,7 +197,13 @@ namespace OpenSim.Framework
{ {
get { return m_textureEntry; } get { return m_textureEntry; }
set { m_textureEntry = value; } set
{
if (value == null)
m_textureEntry = new byte[1];
else
m_textureEntry = value;
}
} }
@ -838,6 +844,9 @@ namespace OpenSim.Framework
public void ReadInExtraParamsBytes(byte[] data) public void ReadInExtraParamsBytes(byte[] data)
{ {
if (data == null)
return;
const ushort FlexiEP = 0x10; const ushort FlexiEP = 0x10;
const ushort LightEP = 0x20; const ushort LightEP = 0x20;
const ushort SculptEP = 0x30; const ushort SculptEP = 0x30;