get rid of PrimitiveBaseShape.MediaRaw staging post

using an OSD serialization rather than auto forces serialization code to be placed in OpenSim.Framework
this makes the media texture raw data staging post in PrimitiveBaseShape redundant, now we just directly call the code in PrimitiveBaseShape.MediaList itself
prebuild-update
Justin Clark-Casey (justincc) 2010-08-03 16:26:27 +01:00
parent ac07d853b8
commit 9d8a67fe13
5 changed files with 15 additions and 49 deletions

View File

@ -1180,8 +1180,8 @@ VALUES
{
}
if (!(shapeRow["Media"] is System.DBNull))
baseShape.MediaRaw = (string)shapeRow["Media"];
if (!(shapeRow["Media"] is System.DBNull))
baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]);
return baseShape;
}
@ -1560,7 +1560,9 @@ VALUES
parameters.Add(_Database.CreateParameter("Texture", s.TextureEntry));
parameters.Add(_Database.CreateParameter("ExtraParams", s.ExtraParams));
parameters.Add(_Database.CreateParameter("State", s.State));
parameters.Add(_Database.CreateParameter("Media", s.MediaRaw));
if (s.Media != null)
parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml()));
return parameters.ToArray();
}

View File

@ -1701,8 +1701,8 @@ namespace OpenSim.Data.MySQL
s.State = (byte)(int)row["State"];
if (!(row["Media"] is System.DBNull))
s.MediaRaw = (string)row["Media"];
if (!(row["Media"] is System.DBNull))
s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
return s;
}
@ -1746,7 +1746,9 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("Texture", s.TextureEntry);
cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams);
cmd.Parameters.AddWithValue("State", s.State);
cmd.Parameters.AddWithValue("Media", s.MediaRaw);
if (s.Media != null)
cmd.Parameters.AddWithValue("Media", s.Media.ToXml());
}
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)

View File

@ -1346,7 +1346,7 @@ namespace OpenSim.Data.SQLite
if (!(row["MediaURL"] is System.DBNull))
{
m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
//m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
prim.MediaUrl = (string)row["MediaURL"];
}
@ -1861,7 +1861,7 @@ namespace OpenSim.Data.SQLite
s.ExtraParams = (byte[]) row["ExtraParams"];
if (!(row["Media"] is System.DBNull))
s.MediaRaw = (string)row["Media"];
s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
return s;
}
@ -1906,7 +1906,9 @@ namespace OpenSim.Data.SQLite
row["Texture"] = s.TextureEntry;
row["ExtraParams"] = s.ExtraParams;
row["Media"] = s.MediaRaw;
if (s.Media != null)
row["Media"] = s.Media.ToXml();
}
/// <summary>

View File

@ -175,12 +175,6 @@ namespace OpenSim.Framework
}
}
}
/// <summary>
/// Raw media data suitable for serialization operations. This should only ever be used by an IMoapModule.
/// </summary>
[XmlIgnore]
public string MediaRaw { get; set; }
/// <summary>
/// Entries to store media textures on each face

View File

@ -120,8 +120,6 @@ namespace OpenSim.Region.CoreModules.Media.Moap
m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps;
m_scene.EventManager.OnSceneObjectLoaded += OnSceneObjectLoaded;
m_scene.EventManager.OnSceneObjectPreSave += OnSceneObjectPreSave;
m_scene.EventManager.OnSceneObjectPartCopy += OnSceneObjectPartCopy;
}
@ -132,8 +130,6 @@ namespace OpenSim.Region.CoreModules.Media.Moap
m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps;
m_scene.EventManager.OnSceneObjectLoaded -= OnSceneObjectLoaded;
m_scene.EventManager.OnSceneObjectPreSave -= OnSceneObjectPreSave;
m_scene.EventManager.OnSceneObjectPartCopy -= OnSceneObjectPartCopy;
}
@ -184,36 +180,6 @@ namespace OpenSim.Region.CoreModules.Media.Moap
}
}
public void OnSceneObjectLoaded(SceneObjectGroup so)
{
// m_log.DebugFormat("[MOAP]: OnSceneObjectLoaded fired for {0} {1}", so.Name, so.UUID);
so.ForEachPart(OnSceneObjectPartLoaded);
}
public void OnSceneObjectPreSave(SceneObjectGroup persistingSo, SceneObjectGroup originalSo)
{
// m_log.DebugFormat("[MOAP]: OnSceneObjectPreSave fired for {0} {1}", persistingSo.Name, persistingSo.UUID);
persistingSo.ForEachPart(OnSceneObjectPartPreSave);
}
protected void OnSceneObjectPartLoaded(SceneObjectPart part)
{
if (null == part.Shape.MediaRaw)
return;
part.Shape.Media = PrimitiveBaseShape.MediaList.FromXml(part.Shape.MediaRaw);
}
protected void OnSceneObjectPartPreSave(SceneObjectPart part)
{
if (null == part.Shape.Media)
return;
part.Shape.MediaRaw = part.Shape.Media.ToXml();
}
protected void OnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed)
{
if (original.Shape.Media != null)