fix problem persisting when only one face had a media texture

prebuild-update
Justin Clark-Casey (justincc) 2010-07-12 21:33:27 +01:00
parent 7691a638e3
commit d4684da8bd
2 changed files with 15 additions and 2 deletions

View File

@ -1867,7 +1867,10 @@ namespace OpenSim.Data.SQLite
List<MediaEntry> mediaEntries = new List<MediaEntry>(); List<MediaEntry> mediaEntries = new List<MediaEntry>();
foreach (OSD osdMe in osdMeArray) foreach (OSD osdMe in osdMeArray)
mediaEntries.Add(MediaEntry.FromOSD(osdMe)); {
MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry());
mediaEntries.Add(me);
}
s.Media = mediaEntries; s.Media = mediaEntries;
} }
@ -1918,7 +1921,10 @@ namespace OpenSim.Data.SQLite
OSDArray meArray = new OSDArray(); OSDArray meArray = new OSDArray();
foreach (MediaEntry me in s.Media) foreach (MediaEntry me in s.Media)
meArray.Add(me.GetOSD()); {
OSD osd = (null == me ? new OSD() : me.GetOSD());
meArray.Add(osd);
}
row["Media"] = OSDParser.SerializeLLSDXmlString(meArray); row["Media"] = OSDParser.SerializeLLSDXmlString(meArray);
} }

View File

@ -213,6 +213,13 @@ namespace OpenSim.Region.CoreModules.Media.Moap
m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId);
// for (int i = 0; i < omu.FaceMedia.Length; i++)
// {
// MediaEntry me = omu.FaceMedia[i];
// string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD()));
// m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v);
// }
part.Shape.Media = new List<MediaEntry>(omu.FaceMedia); part.Shape.Media = new List<MediaEntry>(omu.FaceMedia);
UpdateMediaUrl(part); UpdateMediaUrl(part);