diff options
author | Diva Canto | 2010-11-21 13:16:52 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-21 13:16:52 -0800 |
commit | 6a9ae9e7cb71d79e9ec06cf25009e8bf45850dd1 (patch) | |
tree | 6668ec7fc7816fb0fbe3793ac0967504d2f8c5ce /OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |
parent | Fix global region coordinates that are delivered by llRequestSimulatorData. (diff) | |
download | opensim-SC_OLD-6a9ae9e7cb71d79e9ec06cf25009e8bf45850dd1.zip opensim-SC_OLD-6a9ae9e7cb71d79e9ec06cf25009e8bf45850dd1.tar.gz opensim-SC_OLD-6a9ae9e7cb71d79e9ec06cf25009e8bf45850dd1.tar.bz2 opensim-SC_OLD-6a9ae9e7cb71d79e9ec06cf25009e8bf45850dd1.tar.xz |
Global creator information working on MySQL DB and on load/save OARs. Creator name properly shown on the viewer as first.last @authority.
New option added to save oar -profile=url. Migration on RegionStore making CreatorID be 255 chars.
Moved Handling of user UUID -> name requests to a new module UserManagement/UserManagementModule.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index fb4ef28..fceeafa 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -34,6 +34,7 @@ using System.Xml; | |||
34 | using log4net; | 34 | using log4net; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
38 | 39 | ||
39 | namespace OpenSim.Region.Framework.Scenes.Serialization | 40 | namespace OpenSim.Region.Framework.Scenes.Serialization |
@@ -46,6 +47,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
46 | public class SceneObjectSerializer | 47 | public class SceneObjectSerializer |
47 | { | 48 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | |||
51 | private static IUserManagement m_UserManagement; | ||
49 | 52 | ||
50 | /// <summary> | 53 | /// <summary> |
51 | /// Deserialize a scene object from the original xml format | 54 | /// Deserialize a scene object from the original xml format |
@@ -270,6 +273,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
270 | #region SOPXmlProcessors initialization | 273 | #region SOPXmlProcessors initialization |
271 | m_SOPXmlProcessors.Add("AllowedDrop", ProcessAllowedDrop); | 274 | m_SOPXmlProcessors.Add("AllowedDrop", ProcessAllowedDrop); |
272 | m_SOPXmlProcessors.Add("CreatorID", ProcessCreatorID); | 275 | m_SOPXmlProcessors.Add("CreatorID", ProcessCreatorID); |
276 | m_SOPXmlProcessors.Add("CreatorData", ProcessCreatorData); | ||
273 | m_SOPXmlProcessors.Add("FolderID", ProcessFolderID); | 277 | m_SOPXmlProcessors.Add("FolderID", ProcessFolderID); |
274 | m_SOPXmlProcessors.Add("InventorySerial", ProcessInventorySerial); | 278 | m_SOPXmlProcessors.Add("InventorySerial", ProcessInventorySerial); |
275 | m_SOPXmlProcessors.Add("TaskInventory", ProcessTaskInventory); | 279 | m_SOPXmlProcessors.Add("TaskInventory", ProcessTaskInventory); |
@@ -412,6 +416,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
412 | obj.CreatorID = ReadUUID(reader, "CreatorID"); | 416 | obj.CreatorID = ReadUUID(reader, "CreatorID"); |
413 | } | 417 | } |
414 | 418 | ||
419 | private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader) | ||
420 | { | ||
421 | obj.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty); | ||
422 | } | ||
423 | |||
415 | private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader) | 424 | private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader) |
416 | { | 425 | { |
417 | obj.FolderID = ReadUUID(reader, "FolderID"); | 426 | obj.FolderID = ReadUUID(reader, "FolderID"); |
@@ -1077,7 +1086,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1077 | writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); | 1086 | writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); |
1078 | 1087 | ||
1079 | writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower()); | 1088 | writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower()); |
1089 | |||
1080 | WriteUUID(writer, "CreatorID", sop.CreatorID, options); | 1090 | WriteUUID(writer, "CreatorID", sop.CreatorID, options); |
1091 | |||
1092 | if (sop.CreatorData != null && sop.CreatorData != string.Empty) | ||
1093 | writer.WriteElementString("CreatorData", sop.CreatorData); | ||
1094 | else if (options.ContainsKey("profile")) | ||
1095 | { | ||
1096 | if (m_UserManagement == null) | ||
1097 | m_UserManagement = sop.ParentGroup.Scene.RequestModuleInterface<IUserManagement>(); | ||
1098 | string name = m_UserManagement.GetUserName(sop.CreatorID); | ||
1099 | writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + sop.CreatorID + ";" + name); | ||
1100 | } | ||
1101 | |||
1081 | WriteUUID(writer, "FolderID", sop.FolderID, options); | 1102 | WriteUUID(writer, "FolderID", sop.FolderID, options); |
1082 | writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); | 1103 | writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); |
1083 | 1104 | ||