aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Serialization
diff options
context:
space:
mode:
authorDiva Canto2010-11-21 17:19:24 -0800
committerDiva Canto2010-11-21 17:19:24 -0800
commitc617d658dda92ad97de678d477a98c3df0659303 (patch)
tree9a86356af2fcf4ae4eab18b53dc7330bf3e26a86 /OpenSim/Region/Framework/Scenes/Serialization
parentUpdated SQLiteLegacy/SQLiteSimulationData with the same. Is this crap still u... (diff)
downloadopensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.zip
opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.gz
opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.bz2
opensim-SC_OLD-c617d658dda92ad97de678d477a98c3df0659303.tar.xz
Added creator info across the board -- TaskInventoryItems and InventoryItems themselves. Tested. Seems to be working, main tests pass. Nothing done for IARs or HG transfers yet -- this only works for OARs for the time being.
New migration in inventory table in order to make CreatorID varchar(255).
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs23
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index fceeafa..9cf5a39 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -331,6 +331,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
331 m_TaskInventoryXmlProcessors.Add("BasePermissions", ProcessTIBasePermissions); 331 m_TaskInventoryXmlProcessors.Add("BasePermissions", ProcessTIBasePermissions);
332 m_TaskInventoryXmlProcessors.Add("CreationDate", ProcessTICreationDate); 332 m_TaskInventoryXmlProcessors.Add("CreationDate", ProcessTICreationDate);
333 m_TaskInventoryXmlProcessors.Add("CreatorID", ProcessTICreatorID); 333 m_TaskInventoryXmlProcessors.Add("CreatorID", ProcessTICreatorID);
334 m_TaskInventoryXmlProcessors.Add("CreatorData", ProcessTICreatorData);
334 m_TaskInventoryXmlProcessors.Add("Description", ProcessTIDescription); 335 m_TaskInventoryXmlProcessors.Add("Description", ProcessTIDescription);
335 m_TaskInventoryXmlProcessors.Add("EveryonePermissions", ProcessTIEveryonePermissions); 336 m_TaskInventoryXmlProcessors.Add("EveryonePermissions", ProcessTIEveryonePermissions);
336 m_TaskInventoryXmlProcessors.Add("Flags", ProcessTIFlags); 337 m_TaskInventoryXmlProcessors.Add("Flags", ProcessTIFlags);
@@ -707,6 +708,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
707 item.CreatorID = ReadUUID(reader, "CreatorID"); 708 item.CreatorID = ReadUUID(reader, "CreatorID");
708 } 709 }
709 710
711 private static void ProcessTICreatorData(TaskInventoryItem item, XmlTextReader reader)
712 {
713 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
714 }
715
710 private static void ProcessTIDescription(TaskInventoryItem item, XmlTextReader reader) 716 private static void ProcessTIDescription(TaskInventoryItem item, XmlTextReader reader)
711 { 717 {
712 item.Description = reader.ReadElementContentAsString("Description", String.Empty); 718 item.Description = reader.ReadElementContentAsString("Description", String.Empty);
@@ -1102,7 +1108,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1102 WriteUUID(writer, "FolderID", sop.FolderID, options); 1108 WriteUUID(writer, "FolderID", sop.FolderID, options);
1103 writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); 1109 writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString());
1104 1110
1105 WriteTaskInventory(writer, sop.TaskInventory, options); 1111 WriteTaskInventory(writer, sop.TaskInventory, options, sop.ParentGroup.Scene);
1106 1112
1107 WriteUUID(writer, "UUID", sop.UUID, options); 1113 WriteUUID(writer, "UUID", sop.UUID, options);
1108 writer.WriteElementString("LocalId", sop.LocalId.ToString()); 1114 writer.WriteElementString("LocalId", sop.LocalId.ToString());
@@ -1226,7 +1232,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1226 writer.WriteElementString(name, flagsStr); 1232 writer.WriteElementString(name, flagsStr);
1227 } 1233 }
1228 1234
1229 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options) 1235 static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary<string, object> options, Scene scene)
1230 { 1236 {
1231 if (tinv.Count > 0) // otherwise skip this 1237 if (tinv.Count > 0) // otherwise skip this
1232 { 1238 {
@@ -1239,7 +1245,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1239 WriteUUID(writer, "AssetID", item.AssetID, options); 1245 WriteUUID(writer, "AssetID", item.AssetID, options);
1240 writer.WriteElementString("BasePermissions", item.BasePermissions.ToString()); 1246 writer.WriteElementString("BasePermissions", item.BasePermissions.ToString());
1241 writer.WriteElementString("CreationDate", item.CreationDate.ToString()); 1247 writer.WriteElementString("CreationDate", item.CreationDate.ToString());
1248
1249
1242 WriteUUID(writer, "CreatorID", item.CreatorID, options); 1250 WriteUUID(writer, "CreatorID", item.CreatorID, options);
1251
1252 if (item.CreatorData != null && item.CreatorData != string.Empty)
1253 writer.WriteElementString("CreatorData", item.CreatorData);
1254 else if (options.ContainsKey("profile"))
1255 {
1256 if (m_UserManagement == null)
1257 m_UserManagement = scene.RequestModuleInterface<IUserManagement>();
1258 string name = m_UserManagement.GetUserName(item.CreatorID);
1259 writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + item.CreatorID + ";" + name);
1260 }
1261
1243 writer.WriteElementString("Description", item.Description); 1262 writer.WriteElementString("Description", item.Description);
1244 writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString()); 1263 writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString());
1245 writer.WriteElementString("Flags", item.Flags.ToString()); 1264 writer.WriteElementString("Flags", item.Flags.ToString());