diff --git a/OpenSim/Framework/LLSDxmlEncode.cs b/OpenSim/Framework/LLSDxmlEncode.cs index bd99cd628a..a7408669c4 100644 --- a/OpenSim/Framework/LLSDxmlEncode.cs +++ b/OpenSim/Framework/LLSDxmlEncode.cs @@ -128,6 +128,18 @@ namespace OpenSim.Framework } } + public static void AddElem(byte[] e, StringBuilder sb) + { + if(e == null || e.Length == 0) + sb.Append("binary />"); + else + { + sb.Append(""); // encode64 is default + sb.Append(Convert.ToBase64String(e,Base64FormattingOptions.None)); + sb.Append(""); + } + } + public static void AddElem(int e, StringBuilder sb) { if(e == 0) @@ -152,6 +164,101 @@ namespace OpenSim.Framework } } + public static void AddElem(Vector2 e, StringBuilder sb) + { + sb.Append("x"); + + if(e.X == 0) + sb.Append("y"); + else + { + sb.Append(""); + sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); + sb.Append("y"); + } + + if(e.Y == 0) + sb.Append(""); + else + { + sb.Append(""); + sb.Append(e.Y.ToString(CultureInfo.InvariantCulture)); + sb.Append(""); + } + } + + public static void AddElem(Vector3 e, StringBuilder sb) + { + sb.Append("key>x"); + + if(e.X == 0) + sb.Append("y"); + else + { + sb.Append(""); + sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); + sb.Append("y"); + } + + if(e.Y == 0) + sb.Append("z"); + else + { + sb.Append(""); + sb.Append(e.Y.ToString(CultureInfo.InvariantCulture)); + sb.Append("z"); + } + + if(e.Z == 0) + sb.Append(""); + else + { + sb.Append(""); + sb.Append(e.Z.ToString(CultureInfo.InvariantCulture)); + sb.Append(""); + } + } + + public static void AddElem(Quaternion e, StringBuilder sb) + { + sb.Append("x"); + + if(e.X == 0) + sb.Append("y"); + else + { + sb.Append(""); + sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); + sb.Append("y"); + } + + if(e.Y == 0) + sb.Append("z"); + else + { + sb.Append(""); + sb.Append(e.Y.ToString(CultureInfo.InvariantCulture)); + sb.Append("z"); + } + if(e.Z == 0) + sb.Append("w"); + else + { + sb.Append(""); + sb.Append(e.Z.ToString(CultureInfo.InvariantCulture)); + sb.Append("w"); + } + + if(e.W == 0) + sb.Append(""); + else + { + sb.Append(""); + sb.Append(e.W.ToString(CultureInfo.InvariantCulture)); + sb.Append(""); + } + } + public static void AddElem(double e, StringBuilder sb) { if(e == 0) @@ -312,6 +419,22 @@ namespace OpenSim.Framework } } + public static void AddElem(string name, byte[] e, StringBuilder sb) + { + sb.Append(""); + sb.Append(name); + sb.Append(""); + + if(e == null || e.Length == 0) + sb.Append("binary />"); + else + { + sb.Append(""); // encode64 is default + sb.Append(Convert.ToBase64String(e,Base64FormattingOptions.None)); + sb.Append(""); + } + } + public static void AddElem(string name, int e, StringBuilder sb) { sb.Append(""); @@ -344,6 +467,107 @@ namespace OpenSim.Framework } } + public static void AddElem(string name, Vector2 e, StringBuilder sb) + { + sb.Append(""); + sb.Append(name); + sb.Append("x"); + + if(e.X == 0) + sb.Append("y"); + else + { + sb.Append(""); + sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); + sb.Append("y"); + } + + if(e.Y == 0) + sb.Append(""); + else + { + sb.Append(""); + sb.Append(e.Y.ToString(CultureInfo.InvariantCulture)); + sb.Append(""); + } + } + + public static void AddElem(string name, Vector3 e, StringBuilder sb) + { + sb.Append(""); + sb.Append(name); + sb.Append("key>x"); + + if(e.X == 0) + sb.Append("y"); + else + { + sb.Append(""); + sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); + sb.Append("y"); + } + + if(e.Y == 0) + sb.Append("z"); + else + { + sb.Append(""); + sb.Append(e.Y.ToString(CultureInfo.InvariantCulture)); + sb.Append("z"); + } + + if(e.Z == 0) + sb.Append(""); + else + { + sb.Append(""); + sb.Append(e.Z.ToString(CultureInfo.InvariantCulture)); + sb.Append(""); + } + } + + public static void AddElem(string name, Quaternion e, StringBuilder sb) + { + sb.Append(""); + sb.Append(name); + sb.Append("x"); + + if(e.X == 0) + sb.Append("y"); + else + { + sb.Append(""); + sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); + sb.Append("y"); + } + + if(e.Y == 0) + sb.Append("z"); + else + { + sb.Append(""); + sb.Append(e.Y.ToString(CultureInfo.InvariantCulture)); + sb.Append("z"); + } + if(e.Z == 0) + sb.Append("w"); + else + { + sb.Append(""); + sb.Append(e.Z.ToString(CultureInfo.InvariantCulture)); + sb.Append("w"); + } + + if(e.W == 0) + sb.Append(""); + else + { + sb.Append(""); + sb.Append(e.W.ToString(CultureInfo.InvariantCulture)); + sb.Append(""); + } + } + public static void AddElem(string name, double e, StringBuilder sb) { sb.Append(""); diff --git a/OpenSim/Services/InventoryService/LibraryService.cs b/OpenSim/Services/InventoryService/LibraryService.cs index 89967a7cfd..c71295dd4f 100644 --- a/OpenSim/Services/InventoryService/LibraryService.cs +++ b/OpenSim/Services/InventoryService/LibraryService.cs @@ -304,7 +304,6 @@ namespace OpenSim.Services.InventoryService public InventoryItemBase[] GetMultipleItems(UUID[] ids) { List items = new List(); - int i = 0; foreach (UUID id in ids) { if(m_items.ContainsKey(id))