aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2010-11-22 01:09:26 +0000
committerMelanie2010-11-22 01:09:26 +0000
commit22ff06ba170e3906c80c8ccdb238cff3480301df (patch)
tree1d2a671385ed394d4479773e7e0d415dea72ab37 /OpenSim/Region/Framework/Scenes
parentFox the buglets in Freeswitch. Grid mode works now and there is no reason why... (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-22ff06ba170e3906c80c8ccdb238cff3480301df.zip
opensim-SC_OLD-22ff06ba170e3906c80c8ccdb238cff3480301df.tar.gz
opensim-SC_OLD-22ff06ba170e3906c80c8ccdb238cff3480301df.tar.bz2
opensim-SC_OLD-22ff06ba170e3906c80c8ccdb238cff3480301df.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs36
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs56
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs44
5 files changed, 115 insertions, 57 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1d8b988..36ce245 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -408,6 +408,7 @@ namespace OpenSim.Region.Framework.Scenes
408 InventoryItemBase itemCopy = new InventoryItemBase(); 408 InventoryItemBase itemCopy = new InventoryItemBase();
409 itemCopy.Owner = recipient; 409 itemCopy.Owner = recipient;
410 itemCopy.CreatorId = item.CreatorId; 410 itemCopy.CreatorId = item.CreatorId;
411 itemCopy.CreatorData = item.CreatorData;
411 itemCopy.ID = UUID.Random(); 412 itemCopy.ID = UUID.Random();
412 itemCopy.AssetID = item.AssetID; 413 itemCopy.AssetID = item.AssetID;
413 itemCopy.Description = item.Description; 414 itemCopy.Description = item.Description;
@@ -683,13 +684,13 @@ namespace OpenSim.Region.Framework.Scenes
683 if (remoteClient.AgentId == oldAgentID) 684 if (remoteClient.AgentId == oldAgentID)
684 { 685 {
685 CreateNewInventoryItem( 686 CreateNewInventoryItem(
686 remoteClient, item.CreatorId, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, 687 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType,
687 item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); 688 item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
688 } 689 }
689 else 690 else
690 { 691 {
691 CreateNewInventoryItem( 692 CreateNewInventoryItem(
692 remoteClient, item.CreatorId, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, 693 remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType,
693 item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); 694 item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch());
694 } 695 }
695 } 696 }
@@ -757,11 +758,11 @@ namespace OpenSim.Region.Framework.Scenes
757 /// <param name="asset"></param> 758 /// <param name="asset"></param>
758 /// <param name="invType"></param> 759 /// <param name="invType"></param>
759 /// <param name="nextOwnerMask"></param> 760 /// <param name="nextOwnerMask"></param>
760 private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, UUID folderID, string name, uint flags, uint callbackID, 761 private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID,
761 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) 762 AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate)
762 { 763 {
763 CreateNewInventoryItem( 764 CreateNewInventoryItem(
764 remoteClient, creatorID, folderID, name, flags, callbackID, asset, invType, 765 remoteClient, creatorID, creatorData, folderID, name, flags, callbackID, asset, invType,
765 (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate); 766 (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate);
766 } 767 }
767 768
@@ -776,12 +777,13 @@ namespace OpenSim.Region.Framework.Scenes
776 /// <param name="nextOwnerMask"></param> 777 /// <param name="nextOwnerMask"></param>
777 /// <param name="creationDate"></param> 778 /// <param name="creationDate"></param>
778 private void CreateNewInventoryItem( 779 private void CreateNewInventoryItem(
779 IClientAPI remoteClient, string creatorID, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, 780 IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType,
780 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate) 781 uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate)
781 { 782 {
782 InventoryItemBase item = new InventoryItemBase(); 783 InventoryItemBase item = new InventoryItemBase();
783 item.Owner = remoteClient.AgentId; 784 item.Owner = remoteClient.AgentId;
784 item.CreatorId = creatorID; 785 item.CreatorId = creatorID;
786 item.CreatorData = creatorData;
785 item.ID = UUID.Random(); 787 item.ID = UUID.Random();
786 item.AssetID = asset.FullID; 788 item.AssetID = asset.FullID;
787 item.Description = asset.Description; 789 item.Description = asset.Description;
@@ -861,7 +863,7 @@ namespace OpenSim.Region.Framework.Scenes
861 AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId); 863 AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId);
862 AssetService.Store(asset); 864 AssetService.Store(asset);
863 865
864 CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); 866 CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
865 } 867 }
866 else 868 else
867 { 869 {
@@ -903,7 +905,7 @@ namespace OpenSim.Region.Framework.Scenes
903 asset.Description = description; 905 asset.Description = description;
904 906
905 CreateNewInventoryItem( 907 CreateNewInventoryItem(
906 remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, 908 remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, name, 0, callbackID, asset, invType,
907 (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, 909 (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All,
908 (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); 910 (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch());
909 } 911 }
@@ -1031,6 +1033,7 @@ namespace OpenSim.Region.Framework.Scenes
1031 1033
1032 agentItem.ID = UUID.Random(); 1034 agentItem.ID = UUID.Random();
1033 agentItem.CreatorId = taskItem.CreatorID.ToString(); 1035 agentItem.CreatorId = taskItem.CreatorID.ToString();
1036 agentItem.CreatorData = taskItem.CreatorData;
1034 agentItem.Owner = destAgent; 1037 agentItem.Owner = destAgent;
1035 agentItem.AssetID = taskItem.AssetID; 1038 agentItem.AssetID = taskItem.AssetID;
1036 agentItem.Description = taskItem.Description; 1039 agentItem.Description = taskItem.Description;
@@ -1232,6 +1235,7 @@ namespace OpenSim.Region.Framework.Scenes
1232 1235
1233 destTaskItem.ItemID = UUID.Random(); 1236 destTaskItem.ItemID = UUID.Random();
1234 destTaskItem.CreatorID = srcTaskItem.CreatorID; 1237 destTaskItem.CreatorID = srcTaskItem.CreatorID;
1238 destTaskItem.CreatorData = srcTaskItem.CreatorData;
1235 destTaskItem.AssetID = srcTaskItem.AssetID; 1239 destTaskItem.AssetID = srcTaskItem.AssetID;
1236 destTaskItem.GroupID = destPart.GroupID; 1240 destTaskItem.GroupID = destPart.GroupID;
1237 destTaskItem.OwnerID = destPart.OwnerID; 1241 destTaskItem.OwnerID = destPart.OwnerID;
@@ -1637,6 +1641,7 @@ namespace OpenSim.Region.Framework.Scenes
1637 1641
1638 destTaskItem.ItemID = UUID.Random(); 1642 destTaskItem.ItemID = UUID.Random();
1639 destTaskItem.CreatorID = srcTaskItem.CreatorID; 1643 destTaskItem.CreatorID = srcTaskItem.CreatorID;
1644 destTaskItem.CreatorData = srcTaskItem.CreatorData;
1640 destTaskItem.AssetID = srcTaskItem.AssetID; 1645 destTaskItem.AssetID = srcTaskItem.AssetID;
1641 destTaskItem.GroupID = destPart.GroupID; 1646 destTaskItem.GroupID = destPart.GroupID;
1642 destTaskItem.OwnerID = destPart.OwnerID; 1647 destTaskItem.OwnerID = destPart.OwnerID;
@@ -1873,6 +1878,7 @@ namespace OpenSim.Region.Framework.Scenes
1873 1878
1874 InventoryItemBase item = new InventoryItemBase(); 1879 InventoryItemBase item = new InventoryItemBase();
1875 item.CreatorId = grp.RootPart.CreatorID.ToString(); 1880 item.CreatorId = grp.RootPart.CreatorID.ToString();
1881 item.CreatorData = grp.RootPart.CreatorData;
1876 item.Owner = remoteClient.AgentId; 1882 item.Owner = remoteClient.AgentId;
1877 item.ID = UUID.Random(); 1883 item.ID = UUID.Random();
1878 item.AssetID = asset.FullID; 1884 item.AssetID = asset.FullID;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 21c36d3..ab567fb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -462,22 +462,6 @@ namespace OpenSim.Region.Framework.Scenes
462 ); 462 );
463 } 463 }
464 464
465 public void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client)
466 {
467 if (LibraryService != null && (LibraryService.LibraryRootFolder.Owner == uuid))
468 {
469 remote_client.SendNameReply(uuid, "Mr", "OpenSim");
470 }
471 else
472 {
473 string[] names = GetUserNames(uuid);
474 if (names.Length == 2)
475 {
476 remote_client.SendNameReply(uuid, names[0], names[1]);
477 }
478
479 }
480 }
481 465
482 /// <summary> 466 /// <summary>
483 /// Handle a fetch inventory request from the client 467 /// Handle a fetch inventory request from the client
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a0ae82f..d3a4678 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -188,6 +188,8 @@ namespace OpenSim.Region.Framework.Scenes
188 private Timer m_mapGenerationTimer = new Timer(); 188 private Timer m_mapGenerationTimer = new Timer();
189 private bool m_generateMaptiles; 189 private bool m_generateMaptiles;
190 190
191 private Dictionary<UUID, string[]> m_UserNamesCache = new Dictionary<UUID, string[]>();
192
191 #endregion Fields 193 #endregion Fields
192 194
193 #region Properties 195 #region Properties
@@ -814,36 +816,6 @@ namespace OpenSim.Region.Framework.Scenes
814 return m_simulatorVersion; 816 return m_simulatorVersion;
815 } 817 }
816 818
817 public string[] GetUserNames(UUID uuid)
818 {
819 string[] returnstring = new string[0];
820
821 UserAccount account = UserAccountService.GetUserAccount(RegionInfo.ScopeID, uuid);
822
823 if (account != null)
824 {
825 returnstring = new string[2];
826 returnstring[0] = account.FirstName;
827 returnstring[1] = account.LastName;
828 }
829
830 return returnstring;
831 }
832
833 public string GetUserName(UUID uuid)
834 {
835 string[] names = GetUserNames(uuid);
836 if (names.Length == 2)
837 {
838 string firstname = names[0];
839 string lastname = names[1];
840
841 return firstname + " " + lastname;
842
843 }
844 return "(hippos)";
845 }
846
847 /// <summary> 819 /// <summary>
848 /// Another region is up. 820 /// Another region is up.
849 /// 821 ///
@@ -2907,7 +2879,7 @@ namespace OpenSim.Region.Framework.Scenes
2907 2879
2908 public virtual void SubscribeToClientGridEvents(IClientAPI client) 2880 public virtual void SubscribeToClientGridEvents(IClientAPI client)
2909 { 2881 {
2910 client.OnNameFromUUIDRequest += HandleUUIDNameRequest; 2882 //client.OnNameFromUUIDRequest += HandleUUIDNameRequest;
2911 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 2883 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
2912 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; 2884 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
2913 client.OnSetStartLocationRequest += SetHomeRezPoint; 2885 client.OnSetStartLocationRequest += SetHomeRezPoint;
@@ -3034,7 +3006,7 @@ namespace OpenSim.Region.Framework.Scenes
3034 3006
3035 public virtual void UnSubscribeToClientGridEvents(IClientAPI client) 3007 public virtual void UnSubscribeToClientGridEvents(IClientAPI client)
3036 { 3008 {
3037 client.OnNameFromUUIDRequest -= HandleUUIDNameRequest; 3009 //client.OnNameFromUUIDRequest -= HandleUUIDNameRequest;
3038 client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest; 3010 client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest;
3039 client.OnAvatarPickerRequest -= ProcessAvatarPickerRequest; 3011 client.OnAvatarPickerRequest -= ProcessAvatarPickerRequest;
3040 client.OnSetStartLocationRequest -= SetHomeRezPoint; 3012 client.OnSetStartLocationRequest -= SetHomeRezPoint;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b615d42..f69a30c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -445,6 +445,7 @@ namespace OpenSim.Region.Framework.Scenes
445 private DateTime m_expires; 445 private DateTime m_expires;
446 private DateTime m_rezzed; 446 private DateTime m_rezzed;
447 private bool m_createSelected = false; 447 private bool m_createSelected = false;
448 private string m_creatorData = string.Empty;
448 449
449 public UUID CreatorID 450 public UUID CreatorID
450 { 451 {
@@ -458,6 +459,61 @@ namespace OpenSim.Region.Framework.Scenes
458 } 459 }
459 } 460 }
460 461
462 public string CreatorData // = <profile url>;<name>
463 {
464 get { return m_creatorData; }
465 set { m_creatorData = value; }
466 }
467
468 /// <summary>
469 /// Used by the DB layer to retrieve / store the entire user identification.
470 /// The identification can either be a simple UUID or a string of the form
471 /// uuid[;profile_url[;name]]
472 /// </summary>
473 public string CreatorIdentification
474 {
475 get
476 {
477 if (m_creatorData != null && m_creatorData != string.Empty)
478 return _creatorID.ToString() + ';' + m_creatorData;
479 else
480 return _creatorID.ToString();
481 }
482 set
483 {
484 if ((value == null) || (value != null && value == string.Empty))
485 {
486 m_creatorData = string.Empty;
487 return;
488 }
489
490 if (!value.Contains(";")) // plain UUID
491 {
492 UUID uuid = UUID.Zero;
493 UUID.TryParse(value, out uuid);
494 _creatorID = uuid;
495 }
496 else // <uuid>[;<endpoint>[;name]]
497 {
498 string name = "Unknown User";
499 string[] parts = value.Split(';');
500 if (parts.Length >= 1)
501 {
502 UUID uuid = UUID.Zero;
503 UUID.TryParse(parts[0], out uuid);
504 _creatorID = uuid;
505 }
506 if (parts.Length >= 2)
507 m_creatorData = parts[1];
508 if (parts.Length >= 3)
509 name = parts[2];
510
511 m_creatorData += ';' + name;
512
513 }
514 }
515 }
516
461 /// <summary> 517 /// <summary>
462 /// A relic from when we we thought that prims contained folder objects. In 518 /// A relic from when we we thought that prims contained folder objects. In
463 /// reality, prim == folder 519 /// reality, prim == folder
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index dfc69d8..1fe31b0 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -34,6 +34,7 @@ using System.Xml;
34using log4net; 34using log4net;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
38 39
39namespace OpenSim.Region.Framework.Scenes.Serialization 40namespace 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);
@@ -327,6 +331,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
327 m_TaskInventoryXmlProcessors.Add("BasePermissions", ProcessTIBasePermissions); 331 m_TaskInventoryXmlProcessors.Add("BasePermissions", ProcessTIBasePermissions);
328 m_TaskInventoryXmlProcessors.Add("CreationDate", ProcessTICreationDate); 332 m_TaskInventoryXmlProcessors.Add("CreationDate", ProcessTICreationDate);
329 m_TaskInventoryXmlProcessors.Add("CreatorID", ProcessTICreatorID); 333 m_TaskInventoryXmlProcessors.Add("CreatorID", ProcessTICreatorID);
334 m_TaskInventoryXmlProcessors.Add("CreatorData", ProcessTICreatorData);
330 m_TaskInventoryXmlProcessors.Add("Description", ProcessTIDescription); 335 m_TaskInventoryXmlProcessors.Add("Description", ProcessTIDescription);
331 m_TaskInventoryXmlProcessors.Add("EveryonePermissions", ProcessTIEveryonePermissions); 336 m_TaskInventoryXmlProcessors.Add("EveryonePermissions", ProcessTIEveryonePermissions);
332 m_TaskInventoryXmlProcessors.Add("Flags", ProcessTIFlags); 337 m_TaskInventoryXmlProcessors.Add("Flags", ProcessTIFlags);
@@ -412,6 +417,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
412 obj.CreatorID = ReadUUID(reader, "CreatorID"); 417 obj.CreatorID = ReadUUID(reader, "CreatorID");
413 } 418 }
414 419
420 private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader)
421 {
422 obj.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
423 }
424
415 private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader) 425 private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader)
416 { 426 {
417 obj.FolderID = ReadUUID(reader, "FolderID"); 427 obj.FolderID = ReadUUID(reader, "FolderID");
@@ -698,6 +708,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
698 item.CreatorID = ReadUUID(reader, "CreatorID"); 708 item.CreatorID = ReadUUID(reader, "CreatorID");
699 } 709 }
700 710
711 private static void ProcessTICreatorData(TaskInventoryItem item, XmlTextReader reader)
712 {
713 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
714 }
715
701 private static void ProcessTIDescription(TaskInventoryItem item, XmlTextReader reader) 716 private static void ProcessTIDescription(TaskInventoryItem item, XmlTextReader reader)
702 { 717 {
703 item.Description = reader.ReadElementContentAsString("Description", String.Empty); 718 item.Description = reader.ReadElementContentAsString("Description", String.Empty);
@@ -1077,11 +1092,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1077 writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); 1092 writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
1078 1093
1079 writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower()); 1094 writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower());
1095
1080 WriteUUID(writer, "CreatorID", sop.CreatorID, options); 1096 WriteUUID(writer, "CreatorID", sop.CreatorID, options);
1097
1098 if (sop.CreatorData != null && sop.CreatorData != string.Empty)
1099 writer.WriteElementString("CreatorData", sop.CreatorData);
1100 else if (options.ContainsKey("profile"))
1101 {
1102 if (m_UserManagement == null)
1103 m_UserManagement = sop.ParentGroup.Scene.RequestModuleInterface<IUserManagement>();
1104 string name = m_UserManagement.GetUserName(sop.CreatorID);
1105 writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + sop.CreatorID + ";" + name);
1106 }
1107
1081 WriteUUID(writer, "FolderID", sop.FolderID, options); 1108 WriteUUID(writer, "FolderID", sop.FolderID, options);
1082 writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); 1109 writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString());
1083 1110
1084 WriteTaskInventory(writer, sop.TaskInventory, options); 1111 WriteTaskInventory(writer, sop.TaskInventory, options, sop.ParentGroup.Scene);
1085 1112
1086 WriteUUID(writer, "UUID", sop.UUID, options); 1113 WriteUUID(writer, "UUID", sop.UUID, options);
1087 writer.WriteElementString("LocalId", sop.LocalId.ToString()); 1114 writer.WriteElementString("LocalId", sop.LocalId.ToString());
@@ -1205,7 +1232,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1205 writer.WriteElementString(name, flagsStr); 1232 writer.WriteElementString(name, flagsStr);
1206 } 1233 }
1207 1234
1208 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)
1209 { 1236 {
1210 if (tinv.Count > 0) // otherwise skip this 1237 if (tinv.Count > 0) // otherwise skip this
1211 { 1238 {
@@ -1218,7 +1245,20 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1218 WriteUUID(writer, "AssetID", item.AssetID, options); 1245 WriteUUID(writer, "AssetID", item.AssetID, options);
1219 writer.WriteElementString("BasePermissions", item.BasePermissions.ToString()); 1246 writer.WriteElementString("BasePermissions", item.BasePermissions.ToString());
1220 writer.WriteElementString("CreationDate", item.CreationDate.ToString()); 1247 writer.WriteElementString("CreationDate", item.CreationDate.ToString());
1248
1249
1221 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
1222 writer.WriteElementString("Description", item.Description); 1262 writer.WriteElementString("Description", item.Description);
1223 writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString()); 1263 writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString());
1224 writer.WriteElementString("Flags", item.Flags.ToString()); 1264 writer.WriteElementString("Flags", item.Flags.ToString());