diff options
author | Melanie | 2012-02-04 11:48:20 +0000 |
---|---|---|
committer | Melanie | 2012-02-04 11:48:20 +0000 |
commit | ce5e900721cb0447f76bcb198faf5f7c31eeaf6e (patch) | |
tree | c906a2b8858f9c590e39e2a26f47017fd7b6b9c6 /OpenSim/Framework/Serialization/External | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Add default value to TelehubObject (diff) | |
download | opensim-SC-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.zip opensim-SC-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.tar.gz opensim-SC-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.tar.bz2 opensim-SC-ce5e900721cb0447f76bcb198faf5f7c31eeaf6e.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Data/MySQL/Resources/RegionStore.migrations
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
Diffstat (limited to '')
4 files changed, 199 insertions, 97 deletions
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs index 7447ac2..a392af6 100644 --- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs +++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs | |||
@@ -24,11 +24,13 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
27 | using System; | 28 | using System; |
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | ||
30 | using System.Xml; | 32 | using System.Xml; |
31 | 33 | using log4net; | |
32 | using OpenMetaverse; | 34 | using OpenMetaverse; |
33 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
34 | 36 | ||
@@ -39,6 +41,74 @@ namespace OpenSim.Framework.Serialization.External | |||
39 | /// </summary> | 41 | /// </summary> |
40 | public class ExternalRepresentationUtils | 42 | public class ExternalRepresentationUtils |
41 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | /// <summary> | ||
47 | /// Populate a node with data read from xml using a dictinoary of processors | ||
48 | /// </summary> | ||
49 | /// <param name="nodeToFill"></param> | ||
50 | /// <param name="processors">/param> | ||
51 | /// <param name="xtr"></param> | ||
52 | public static void ExecuteReadProcessors<NodeType>( | ||
53 | NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) | ||
54 | { | ||
55 | ExecuteReadProcessors( | ||
56 | nodeToFill, | ||
57 | processors, | ||
58 | xtr, | ||
59 | (o, name, e) | ||
60 | => m_log.ErrorFormat( | ||
61 | "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", | ||
62 | name, e.Message, e.StackTrace)); | ||
63 | } | ||
64 | |||
65 | /// <summary> | ||
66 | /// Populate a node with data read from xml using a dictinoary of processors | ||
67 | /// </summary> | ||
68 | /// <param name="nodeToFill"></param> | ||
69 | /// <param name="processors"></param> | ||
70 | /// <param name="xtr"></param> | ||
71 | /// <param name="parseExceptionAction"> | ||
72 | /// Action to take if there is a parsing problem. This will usually just be to log the exception | ||
73 | /// </param> | ||
74 | public static void ExecuteReadProcessors<NodeType>( | ||
75 | NodeType nodeToFill, | ||
76 | Dictionary<string, Action<NodeType, XmlTextReader>> processors, | ||
77 | XmlTextReader xtr, | ||
78 | Action<NodeType, string, Exception> parseExceptionAction) | ||
79 | { | ||
80 | string nodeName = string.Empty; | ||
81 | while (xtr.NodeType != XmlNodeType.EndElement) | ||
82 | { | ||
83 | nodeName = xtr.Name; | ||
84 | |||
85 | // m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName); | ||
86 | |||
87 | Action<NodeType, XmlTextReader> p = null; | ||
88 | if (processors.TryGetValue(xtr.Name, out p)) | ||
89 | { | ||
90 | // m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName); | ||
91 | |||
92 | try | ||
93 | { | ||
94 | p(nodeToFill, xtr); | ||
95 | } | ||
96 | catch (Exception e) | ||
97 | { | ||
98 | parseExceptionAction(nodeToFill, nodeName, e); | ||
99 | |||
100 | if (xtr.NodeType == XmlNodeType.EndElement) | ||
101 | xtr.Read(); | ||
102 | } | ||
103 | } | ||
104 | else | ||
105 | { | ||
106 | // m_log.DebugFormat("[LandDataSerializer]: caught unknown element {0}", nodeName); | ||
107 | xtr.ReadOuterXml(); // ignore | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
42 | /// <summary> | 112 | /// <summary> |
43 | /// Takes a XML representation of a SceneObjectPart and returns another XML representation | 113 | /// Takes a XML representation of a SceneObjectPart and returns another XML representation |
44 | /// with creator data added to it. | 114 | /// with creator data added to it. |
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index 3ae9a8e..a12877a 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |||
@@ -28,8 +28,10 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | ||
31 | using System.Text; | 32 | using System.Text; |
32 | using System.Xml; | 33 | using System.Xml; |
34 | using log4net; | ||
33 | using OpenMetaverse; | 35 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
35 | 37 | ||
@@ -40,8 +42,119 @@ namespace OpenSim.Framework.Serialization.External | |||
40 | /// </summary> | 42 | /// </summary> |
41 | public class LandDataSerializer | 43 | public class LandDataSerializer |
42 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
43 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); | 47 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); |
44 | 48 | ||
49 | private static Dictionary<string, Action<LandData, XmlTextReader>> m_ldProcessors | ||
50 | = new Dictionary<string, Action<LandData, XmlTextReader>>(); | ||
51 | |||
52 | private static Dictionary<string, Action<LandAccessEntry, XmlTextReader>> m_laeProcessors | ||
53 | = new Dictionary<string, Action<LandAccessEntry, XmlTextReader>>(); | ||
54 | |||
55 | static LandDataSerializer() | ||
56 | { | ||
57 | // LandData processors | ||
58 | m_ldProcessors.Add( | ||
59 | "Area", (ld, xtr) => ld.Area = Convert.ToInt32(xtr.ReadElementString("Area"))); | ||
60 | m_ldProcessors.Add( | ||
61 | "AuctionID", (ld, xtr) => ld.AuctionID = Convert.ToUInt32(xtr.ReadElementString("AuctionID"))); | ||
62 | m_ldProcessors.Add( | ||
63 | "AuthBuyerID", (ld, xtr) => ld.AuthBuyerID = UUID.Parse(xtr.ReadElementString("AuthBuyerID"))); | ||
64 | m_ldProcessors.Add( | ||
65 | "Category", (ld, xtr) => ld.Category = (ParcelCategory)Convert.ToSByte(xtr.ReadElementString("Category"))); | ||
66 | m_ldProcessors.Add( | ||
67 | "ClaimDate", (ld, xtr) => ld.ClaimDate = Convert.ToInt32(xtr.ReadElementString("ClaimDate"))); | ||
68 | m_ldProcessors.Add( | ||
69 | "ClaimPrice", (ld, xtr) => ld.ClaimPrice = Convert.ToInt32(xtr.ReadElementString("ClaimPrice"))); | ||
70 | m_ldProcessors.Add( | ||
71 | "GlobalID", (ld, xtr) => ld.GlobalID = UUID.Parse(xtr.ReadElementString("GlobalID"))); | ||
72 | m_ldProcessors.Add( | ||
73 | "GroupID", (ld, xtr) => ld.GroupID = UUID.Parse(xtr.ReadElementString("GroupID"))); | ||
74 | m_ldProcessors.Add( | ||
75 | "IsGroupOwned", (ld, xtr) => ld.IsGroupOwned = Convert.ToBoolean(xtr.ReadElementString("IsGroupOwned"))); | ||
76 | m_ldProcessors.Add( | ||
77 | "Bitmap", (ld, xtr) => ld.Bitmap = Convert.FromBase64String(xtr.ReadElementString("Bitmap"))); | ||
78 | m_ldProcessors.Add( | ||
79 | "Description", (ld, xtr) => ld.Description = xtr.ReadElementString("Description")); | ||
80 | m_ldProcessors.Add( | ||
81 | "Flags", (ld, xtr) => ld.Flags = Convert.ToUInt32(xtr.ReadElementString("Flags"))); | ||
82 | m_ldProcessors.Add( | ||
83 | "LandingType", (ld, xtr) => ld.LandingType = Convert.ToByte(xtr.ReadElementString("LandingType"))); | ||
84 | m_ldProcessors.Add( | ||
85 | "Name", (ld, xtr) => ld.Name = xtr.ReadElementString("Name")); | ||
86 | m_ldProcessors.Add( | ||
87 | "Status", (ld, xtr) => ld.Status = (ParcelStatus)Convert.ToSByte(xtr.ReadElementString("Status"))); | ||
88 | m_ldProcessors.Add( | ||
89 | "LocalID", (ld, xtr) => ld.LocalID = Convert.ToInt32(xtr.ReadElementString("LocalID"))); | ||
90 | m_ldProcessors.Add( | ||
91 | "MediaAutoScale", (ld, xtr) => ld.MediaAutoScale = Convert.ToByte(xtr.ReadElementString("MediaAutoScale"))); | ||
92 | m_ldProcessors.Add( | ||
93 | "MediaID", (ld, xtr) => ld.MediaID = UUID.Parse(xtr.ReadElementString("MediaID"))); | ||
94 | m_ldProcessors.Add( | ||
95 | "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); | ||
96 | m_ldProcessors.Add( | ||
97 | "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); | ||
98 | |||
99 | m_ldProcessors.Add( | ||
100 | "ParcelAccessList", ProcessParcelAccessList); | ||
101 | |||
102 | m_ldProcessors.Add( | ||
103 | "PassHours", (ld, xtr) => ld.PassHours = Convert.ToSingle(xtr.ReadElementString("PassHours"))); | ||
104 | m_ldProcessors.Add( | ||
105 | "PassPrice", (ld, xtr) => ld.PassPrice = Convert.ToInt32(xtr.ReadElementString("PassPrice"))); | ||
106 | m_ldProcessors.Add( | ||
107 | "SalePrice", (ld, xtr) => ld.SalePrice = Convert.ToInt32(xtr.ReadElementString("SalePrice"))); | ||
108 | m_ldProcessors.Add( | ||
109 | "SnapshotID", (ld, xtr) => ld.SnapshotID = UUID.Parse(xtr.ReadElementString("SnapshotID"))); | ||
110 | m_ldProcessors.Add( | ||
111 | "UserLocation", (ld, xtr) => ld.UserLocation = Vector3.Parse(xtr.ReadElementString("UserLocation"))); | ||
112 | m_ldProcessors.Add( | ||
113 | "UserLookAt", (ld, xtr) => ld.UserLookAt = Vector3.Parse(xtr.ReadElementString("UserLookAt"))); | ||
114 | |||
115 | // No longer used here // | ||
116 | // m_ldProcessors.Add("Dwell", (landData, xtr) => return); | ||
117 | |||
118 | m_ldProcessors.Add( | ||
119 | "OtherCleanTime", (ld, xtr) => ld.OtherCleanTime = Convert.ToInt32(xtr.ReadElementString("OtherCleanTime"))); | ||
120 | |||
121 | // LandAccessEntryProcessors | ||
122 | m_laeProcessors.Add( | ||
123 | "AgentID", (lae, xtr) => lae.AgentID = UUID.Parse(xtr.ReadElementString("AgentID"))); | ||
124 | m_laeProcessors.Add( | ||
125 | "Time", (lae, xtr) => | ||
126 | { | ||
127 | // We really don't care about temp vs perm here and this | ||
128 | // would break on old oars. Assume all bans are perm | ||
129 | xtr.ReadElementString("Time"); | ||
130 | lae.Expires = 0; // Convert.ToUint( xtr.ReadElementString("Time")); | ||
131 | } | ||
132 | ); | ||
133 | m_laeProcessors.Add( | ||
134 | "AccessList", (lae, xtr) => lae.Flags = (AccessList)Convert.ToUInt32(xtr.ReadElementString("AccessList"))); | ||
135 | } | ||
136 | |||
137 | public static void ProcessParcelAccessList(LandData ld, XmlTextReader xtr) | ||
138 | { | ||
139 | if (!xtr.IsEmptyElement) | ||
140 | { | ||
141 | while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) | ||
142 | { | ||
143 | LandAccessEntry lae = new LandAccessEntry(); | ||
144 | |||
145 | xtr.ReadStartElement("ParcelAccessEntry"); | ||
146 | |||
147 | ExternalRepresentationUtils.ExecuteReadProcessors<LandAccessEntry>(lae, m_laeProcessors, xtr); | ||
148 | |||
149 | xtr.ReadEndElement(); | ||
150 | |||
151 | ld.ParcelAccessList.Add(lae); | ||
152 | } | ||
153 | } | ||
154 | |||
155 | xtr.Read(); | ||
156 | } | ||
157 | |||
45 | /// <summary> | 158 | /// <summary> |
46 | /// Reify/deserialize landData | 159 | /// Reify/deserialize landData |
47 | /// </summary> | 160 | /// </summary> |
@@ -63,72 +176,14 @@ namespace OpenSim.Framework.Serialization.External | |||
63 | { | 176 | { |
64 | LandData landData = new LandData(); | 177 | LandData landData = new LandData(); |
65 | 178 | ||
66 | StringReader sr = new StringReader(serializedLandData); | 179 | using (XmlTextReader reader = new XmlTextReader(new StringReader(serializedLandData))) |
67 | XmlTextReader xtr = new XmlTextReader(sr); | ||
68 | |||
69 | xtr.ReadStartElement("LandData"); | ||
70 | |||
71 | landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); | ||
72 | landData.AuctionID = Convert.ToUInt32( xtr.ReadElementString("AuctionID")); | ||
73 | landData.AuthBuyerID = UUID.Parse( xtr.ReadElementString("AuthBuyerID")); | ||
74 | landData.Category = (ParcelCategory)Convert.ToSByte( xtr.ReadElementString("Category")); | ||
75 | landData.ClaimDate = Convert.ToInt32( xtr.ReadElementString("ClaimDate")); | ||
76 | landData.ClaimPrice = Convert.ToInt32( xtr.ReadElementString("ClaimPrice")); | ||
77 | landData.GlobalID = UUID.Parse( xtr.ReadElementString("GlobalID")); | ||
78 | landData.GroupID = UUID.Parse( xtr.ReadElementString("GroupID")); | ||
79 | landData.IsGroupOwned = Convert.ToBoolean( xtr.ReadElementString("IsGroupOwned")); | ||
80 | landData.Bitmap = Convert.FromBase64String( xtr.ReadElementString("Bitmap")); | ||
81 | landData.Description = xtr.ReadElementString("Description"); | ||
82 | landData.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags")); | ||
83 | landData.LandingType = Convert.ToByte( xtr.ReadElementString("LandingType")); | ||
84 | landData.Name = xtr.ReadElementString("Name"); | ||
85 | landData.Status = (ParcelStatus)Convert.ToSByte( xtr.ReadElementString("Status")); | ||
86 | landData.LocalID = Convert.ToInt32( xtr.ReadElementString("LocalID")); | ||
87 | landData.MediaAutoScale = Convert.ToByte( xtr.ReadElementString("MediaAutoScale")); | ||
88 | landData.MediaID = UUID.Parse( xtr.ReadElementString("MediaID")); | ||
89 | landData.MediaURL = xtr.ReadElementString("MediaURL"); | ||
90 | landData.MusicURL = xtr.ReadElementString("MusicURL"); | ||
91 | landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID")); | ||
92 | |||
93 | landData.ParcelAccessList = new List<LandAccessEntry>(); | ||
94 | xtr.Read(); | ||
95 | if (xtr.Name != "ParcelAccessList") | ||
96 | throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name)); | ||
97 | |||
98 | if (!xtr.IsEmptyElement) | ||
99 | { | 180 | { |
100 | while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) | 181 | reader.ReadStartElement("LandData"); |
101 | { | ||
102 | LandAccessEntry pae = new LandAccessEntry(); | ||
103 | 182 | ||
104 | xtr.ReadStartElement("ParcelAccessEntry"); | 183 | ExternalRepresentationUtils.ExecuteReadProcessors<LandData>(landData, m_ldProcessors, reader); |
105 | pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); | ||
106 | // We really don't care about temp vs perm here and this | ||
107 | // would break on old oars. Assume all bans are perm | ||
108 | xtr.ReadElementString("Time"); | ||
109 | pae.Expires = 0; // Convert.ToUint( xtr.ReadElementString("Time")); | ||
110 | pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); | ||
111 | xtr.ReadEndElement(); | ||
112 | 184 | ||
113 | landData.ParcelAccessList.Add(pae); | 185 | reader.ReadEndElement(); |
114 | } | ||
115 | } | 186 | } |
116 | xtr.Read(); | ||
117 | |||
118 | landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours")); | ||
119 | landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice")); | ||
120 | landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice")); | ||
121 | landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); | ||
122 | landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); | ||
123 | landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); | ||
124 | // No longer used here | ||
125 | xtr.ReadElementString("Dwell"); | ||
126 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); | ||
127 | |||
128 | xtr.ReadEndElement(); | ||
129 | |||
130 | xtr.Close(); | ||
131 | sr.Close(); | ||
132 | 187 | ||
133 | return landData; | 188 | return landData; |
134 | } | 189 | } |
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index f138437..57da7ca 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | |||
@@ -41,14 +41,13 @@ namespace OpenSim.Framework.Serialization.External | |||
41 | { | 41 | { |
42 | /// <summary> | 42 | /// <summary> |
43 | /// Serialize and deserialize user inventory items as an external format. | 43 | /// Serialize and deserialize user inventory items as an external format. |
44 | /// </summary> | 44 | /// </summary> |
45 | /// XXX: Please do not use yet. | ||
46 | public class UserInventoryItemSerializer | 45 | public class UserInventoryItemSerializer |
47 | { | 46 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 48 | ||
50 | private delegate void InventoryItemXmlProcessor(InventoryItemBase item, XmlTextReader reader); | 49 | private static Dictionary<string, Action<InventoryItemBase, XmlTextReader>> m_InventoryItemXmlProcessors |
51 | private static Dictionary<string, InventoryItemXmlProcessor> m_InventoryItemXmlProcessors = new Dictionary<string, InventoryItemXmlProcessor>(); | 50 | = new Dictionary<string, Action<InventoryItemBase, XmlTextReader>>(); |
52 | 51 | ||
53 | #region InventoryItemBase Processor initialization | 52 | #region InventoryItemBase Processor initialization |
54 | static UserInventoryItemSerializer() | 53 | static UserInventoryItemSerializer() |
@@ -205,39 +204,14 @@ namespace OpenSim.Framework.Serialization.External | |||
205 | { | 204 | { |
206 | reader.ReadStartElement("InventoryItem"); | 205 | reader.ReadStartElement("InventoryItem"); |
207 | 206 | ||
208 | string nodeName = string.Empty; | 207 | ExternalRepresentationUtils.ExecuteReadProcessors<InventoryItemBase>( |
209 | while (reader.NodeType != XmlNodeType.EndElement) | 208 | item, m_InventoryItemXmlProcessors, reader); |
210 | { | ||
211 | nodeName = reader.Name; | ||
212 | InventoryItemXmlProcessor p = null; | ||
213 | if (m_InventoryItemXmlProcessors.TryGetValue(reader.Name, out p)) | ||
214 | { | ||
215 | //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); | ||
216 | try | ||
217 | { | ||
218 | p(item, reader); | ||
219 | } | ||
220 | catch (Exception e) | ||
221 | { | ||
222 | m_log.DebugFormat("[InventoryItemSerializer]: exception while parsing {0}: {1}", nodeName, e); | ||
223 | if (reader.NodeType == XmlNodeType.EndElement) | ||
224 | reader.Read(); | ||
225 | } | ||
226 | } | ||
227 | else | ||
228 | { | ||
229 | // m_log.DebugFormat("[InventoryItemSerializer]: caught unknown element {0}", nodeName); | ||
230 | reader.ReadOuterXml(); // ignore | ||
231 | } | ||
232 | |||
233 | } | ||
234 | 209 | ||
235 | reader.ReadEndElement(); // InventoryItem | 210 | reader.ReadEndElement(); // InventoryItem |
236 | } | 211 | } |
237 | 212 | ||
238 | //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); | 213 | //m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID); |
239 | return item; | 214 | return item; |
240 | |||
241 | } | 215 | } |
242 | 216 | ||
243 | public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService) | 217 | public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService) |
@@ -305,14 +279,14 @@ namespace OpenSim.Framework.Serialization.External | |||
305 | writer.WriteEndElement(); | 279 | writer.WriteEndElement(); |
306 | if (options.ContainsKey("creators") && inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty) | 280 | if (options.ContainsKey("creators") && inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty) |
307 | writer.WriteElementString("CreatorData", inventoryItem.CreatorData); | 281 | writer.WriteElementString("CreatorData", inventoryItem.CreatorData); |
308 | else if (options.ContainsKey("profile")) | 282 | else if (options.ContainsKey("home")) |
309 | { | 283 | { |
310 | if (userAccountService != null) | 284 | if (userAccountService != null) |
311 | { | 285 | { |
312 | UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid); | 286 | UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid); |
313 | if (account != null) | 287 | if (account != null) |
314 | { | 288 | { |
315 | writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName); | 289 | writer.WriteElementString("CreatorData", (string)options["home"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName); |
316 | } | 290 | } |
317 | writer.WriteElementString("CreatorID", inventoryItem.CreatorId); | 291 | writer.WriteElementString("CreatorID", inventoryItem.CreatorId); |
318 | } | 292 | } |
diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index f50b49a..c685a15 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs | |||
@@ -33,8 +33,11 @@ using OpenSim.Framework; | |||
33 | namespace OpenSim.Framework.Serialization.External | 33 | namespace OpenSim.Framework.Serialization.External |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// Serialize and deserialize region settings as an external format. | 36 | /// Serialize and deserialize user profiles as an external format. |
37 | /// </summary> | 37 | /// </summary> |
38 | /// <remarks> | ||
39 | /// Currently UNUSED. | ||
40 | /// </remarks> | ||
38 | public class UserProfileSerializer | 41 | public class UserProfileSerializer |
39 | { | 42 | { |
40 | public const int MAJOR_VERSION = 0; | 43 | public const int MAJOR_VERSION = 0; |