mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
save/load environments to/from oars
This commit is contained in:
@@ -28,12 +28,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Framework.Serialization.External
|
||||
{
|
||||
@@ -99,6 +97,9 @@ namespace OpenSim.Framework.Serialization.External
|
||||
m_ldProcessors.Add(
|
||||
"ParcelAccessList", ProcessParcelAccessList);
|
||||
|
||||
m_ldProcessors.Add(
|
||||
"Environment", ProcessParcelEnvironment);
|
||||
|
||||
m_ldProcessors.Add(
|
||||
"PassHours", (ld, xtr) => ld.PassHours = Convert.ToSingle(xtr.ReadElementString("PassHours")));
|
||||
m_ldProcessors.Add(
|
||||
@@ -132,6 +133,13 @@ namespace OpenSim.Framework.Serialization.External
|
||||
);
|
||||
m_laeProcessors.Add(
|
||||
"AccessList", (lae, xtr) => lae.Flags = (AccessList)Convert.ToUInt32(xtr.ReadElementString("AccessList")));
|
||||
|
||||
}
|
||||
|
||||
public static void ProcessParcelEnvironment(LandData ld, XmlReader xtr)
|
||||
{
|
||||
string senv = xtr.ReadElementString("Environment");
|
||||
ld.Environment = ViewerEnvironment.FromOSDString(senv);
|
||||
}
|
||||
|
||||
public static void ProcessParcelAccessList(LandData ld, XmlReader xtr)
|
||||
@@ -255,6 +263,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtw.WriteElementString("Dwell", "0");
|
||||
xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime));
|
||||
|
||||
if(landData.Environment != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
string senv = ViewerEnvironment.ToOSDString(landData.Environment);
|
||||
xtw.WriteElementString("Environment", senv);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
xtw.WriteEndElement();
|
||||
|
||||
xtw.Close();
|
||||
|
||||
Reference in New Issue
Block a user