* Fixing [LIBOMV-504] reported by Eves Sinister, OSDParser.Deserialize() now handles LLSDXML that starts with <?xml

* Cleaned up the Cable Beach inventory API and added LLIDL for prim serialization. This is still a proposal and no serialization/deserialization exists yet
* Updated content types and file extensions used by Cable Beach to match the table at https://wiki.secondlife.com/wiki/Asset_System

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2674 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-04-29 17:21:46 +00:00
parent 7ff9fb14de
commit 95a4f7fd7e
4 changed files with 384 additions and 469 deletions

View File

@@ -1114,8 +1114,9 @@ namespace OpenMetaverse.StructuredData
public partial class OSDParser
{
const string LLSD_BINARY_HEADER = "<?LLSD/Binary?>";
const string LLSD_XML_HEADER = "<?LLSD/XML?>";
const string LLSD_XML_ALT_HEADER = "<llsd>";
const string LLSD_XML_HEADER = "<llsd>";
const string LLSD_XML_ALT_HEADER = "<?xml";
const string LLSD_XML_ALT2_HEADER = "<?LLSD/XML?>";
public static OSD Deserialize(byte[] data)
{
@@ -1123,9 +1124,7 @@ namespace OpenMetaverse.StructuredData
if (header.StartsWith(LLSD_BINARY_HEADER))
return DeserializeLLSDBinary(data);
else if (header.StartsWith(LLSD_XML_HEADER))
return DeserializeLLSDXml(data);
else if (header.StartsWith(LLSD_XML_ALT_HEADER))
else if (header.StartsWith(LLSD_XML_HEADER) || header.StartsWith(LLSD_XML_ALT_HEADER) || header.StartsWith(LLSD_XML_ALT2_HEADER))
return DeserializeLLSDXml(data);
else
return DeserializeJson(Encoding.UTF8.GetString(data));
@@ -1142,9 +1141,7 @@ namespace OpenMetaverse.StructuredData
if (header.StartsWith(LLSD_BINARY_HEADER))
return DeserializeLLSDBinary(stream);
else if (header.StartsWith(LLSD_XML_HEADER))
return DeserializeLLSDXml(stream);
else if (header.StartsWith(LLSD_XML_ALT_HEADER))
else if (header.StartsWith(LLSD_XML_HEADER) || header.StartsWith(LLSD_XML_ALT_HEADER) || header.StartsWith(LLSD_XML_ALT2_HEADER))
return DeserializeLLSDXml(stream);
else
return DeserializeJson(stream);