mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
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.
This commit is contained in:
@@ -34,6 +34,7 @@ using System.Xml;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
@@ -46,6 +47,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
public class SceneObjectSerializer
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static IUserManagement m_UserManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize a scene object from the original xml format
|
||||
@@ -270,6 +273,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
#region SOPXmlProcessors initialization
|
||||
m_SOPXmlProcessors.Add("AllowedDrop", ProcessAllowedDrop);
|
||||
m_SOPXmlProcessors.Add("CreatorID", ProcessCreatorID);
|
||||
m_SOPXmlProcessors.Add("CreatorData", ProcessCreatorData);
|
||||
m_SOPXmlProcessors.Add("FolderID", ProcessFolderID);
|
||||
m_SOPXmlProcessors.Add("InventorySerial", ProcessInventorySerial);
|
||||
m_SOPXmlProcessors.Add("TaskInventory", ProcessTaskInventory);
|
||||
@@ -412,6 +416,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
obj.CreatorID = ReadUUID(reader, "CreatorID");
|
||||
}
|
||||
|
||||
private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader)
|
||||
{
|
||||
obj.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
|
||||
}
|
||||
|
||||
private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader)
|
||||
{
|
||||
obj.FolderID = ReadUUID(reader, "FolderID");
|
||||
@@ -1077,7 +1086,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
|
||||
|
||||
writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower());
|
||||
|
||||
WriteUUID(writer, "CreatorID", sop.CreatorID, options);
|
||||
|
||||
if (sop.CreatorData != null && sop.CreatorData != string.Empty)
|
||||
writer.WriteElementString("CreatorData", sop.CreatorData);
|
||||
else if (options.ContainsKey("profile"))
|
||||
{
|
||||
if (m_UserManagement == null)
|
||||
m_UserManagement = sop.ParentGroup.Scene.RequestModuleInterface<IUserManagement>();
|
||||
string name = m_UserManagement.GetUserName(sop.CreatorID);
|
||||
writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + sop.CreatorID + ";" + name);
|
||||
}
|
||||
|
||||
WriteUUID(writer, "FolderID", sop.FolderID, options);
|
||||
writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user