add a bit more persistence (still mysql only)

0.9.1.0-post-fixes
UbitUmarov 2018-12-31 09:54:54 +00:00
parent d8ade44fe9
commit d841c593b9
2 changed files with 30 additions and 2 deletions

View File

@ -5750,7 +5750,6 @@ namespace OpenSim.Region.Framework.Scenes
if (AnimationsNames == null) if (AnimationsNames == null)
return null; return null;
lock (animsLock) lock (animsLock)
{ {
if (AnimationsNames.Count == 0) if (AnimationsNames.Count == 0)

View File

@ -235,7 +235,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
if (doScriptStates) if (doScriptStates)
sceneObject.SaveScriptedState(writer); sceneObject.SaveScriptedState(writer);
if (!noRootElement) if (!noRootElement)
writer.WriteEndElement(); // SceneObjectGroup writer.WriteEndElement(); // SceneObjectGroup
@ -499,6 +498,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("SoundRadius", ProcessSoundRadius); m_SOPXmlProcessors.Add("SoundRadius", ProcessSoundRadius);
m_SOPXmlProcessors.Add("SoundQueueing", ProcessSoundQueueing); m_SOPXmlProcessors.Add("SoundQueueing", ProcessSoundQueueing);
m_SOPXmlProcessors.Add("SOPAnims", ProcessSOPAnims);
#endregion #endregion
#region TaskInventoryXmlProcessors initialization #region TaskInventoryXmlProcessors initialization
@ -826,6 +827,27 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
} }
} }
private static void ProcessSOPAnims(SceneObjectPart obj, XmlReader reader)
{
obj.Animations = null;
try
{
string datastr;
datastr = reader.ReadElementContentAsString();
if(string.IsNullOrEmpty(datastr))
return;
byte[] pdata = Convert.FromBase64String(datastr);
obj.DeSerializeAnimations(pdata);
return;
}
catch {}
m_log.DebugFormat(
"[SceneObjectSerializer]: Parsing ProcessSOPAnims for object part {0} {1} encountered errors",
obj.Name, obj.UUID);
}
private static void ProcessShape(SceneObjectPart obj, XmlReader reader) private static void ProcessShape(SceneObjectPart obj, XmlReader reader)
{ {
List<string> errorNodeNames; List<string> errorNodeNames;
@ -1588,6 +1610,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
} }
writer.WriteElementString("SoundQueueing", sop.SoundQueueing.ToString().ToLower()); writer.WriteElementString("SoundQueueing", sop.SoundQueueing.ToString().ToLower());
if (sop.Animations != null)
{
Byte[] data = sop.SerializeAnimations();
if(data != null && data.Length > 0)
writer.WriteElementString("SOPAnims", Convert.ToBase64String(data));
}
writer.WriteEndElement(); writer.WriteEndElement();
} }