diff options
author | Diva Canto | 2010-11-21 17:19:24 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-21 17:19:24 -0800 |
commit | c617d658dda92ad97de678d477a98c3df0659303 (patch) | |
tree | 9a86356af2fcf4ae4eab18b53dc7330bf3e26a86 /OpenSim/Region/Framework/Scenes | |
parent | Updated SQLiteLegacy/SQLiteSimulationData with the same. Is this crap still u... (diff) | |
download | opensim-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')
3 files changed, 40 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 4cc797b..a29b7f1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -426,6 +426,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
426 | InventoryItemBase itemCopy = new InventoryItemBase(); | 426 | InventoryItemBase itemCopy = new InventoryItemBase(); |
427 | itemCopy.Owner = recipient; | 427 | itemCopy.Owner = recipient; |
428 | itemCopy.CreatorId = item.CreatorId; | 428 | itemCopy.CreatorId = item.CreatorId; |
429 | itemCopy.CreatorData = item.CreatorData; | ||
429 | itemCopy.ID = UUID.Random(); | 430 | itemCopy.ID = UUID.Random(); |
430 | itemCopy.AssetID = item.AssetID; | 431 | itemCopy.AssetID = item.AssetID; |
431 | itemCopy.Description = item.Description; | 432 | itemCopy.Description = item.Description; |
@@ -699,13 +700,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
699 | if (remoteClient.AgentId == oldAgentID) | 700 | if (remoteClient.AgentId == oldAgentID) |
700 | { | 701 | { |
701 | CreateNewInventoryItem( | 702 | CreateNewInventoryItem( |
702 | remoteClient, item.CreatorId, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, | 703 | remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, |
703 | item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); | 704 | item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); |
704 | } | 705 | } |
705 | else | 706 | else |
706 | { | 707 | { |
707 | CreateNewInventoryItem( | 708 | CreateNewInventoryItem( |
708 | remoteClient, item.CreatorId, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, | 709 | remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, |
709 | item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); | 710 | item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); |
710 | } | 711 | } |
711 | } | 712 | } |
@@ -755,11 +756,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
755 | /// <param name="asset"></param> | 756 | /// <param name="asset"></param> |
756 | /// <param name="invType"></param> | 757 | /// <param name="invType"></param> |
757 | /// <param name="nextOwnerMask"></param> | 758 | /// <param name="nextOwnerMask"></param> |
758 | private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, UUID folderID, string name, uint flags, uint callbackID, | 759 | private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID, |
759 | AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) | 760 | AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) |
760 | { | 761 | { |
761 | CreateNewInventoryItem( | 762 | CreateNewInventoryItem( |
762 | remoteClient, creatorID, folderID, name, flags, callbackID, asset, invType, | 763 | remoteClient, creatorID, creatorData, folderID, name, flags, callbackID, asset, invType, |
763 | (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate); | 764 | (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate); |
764 | } | 765 | } |
765 | 766 | ||
@@ -774,12 +775,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
774 | /// <param name="nextOwnerMask"></param> | 775 | /// <param name="nextOwnerMask"></param> |
775 | /// <param name="creationDate"></param> | 776 | /// <param name="creationDate"></param> |
776 | private void CreateNewInventoryItem( | 777 | private void CreateNewInventoryItem( |
777 | IClientAPI remoteClient, string creatorID, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, | 778 | IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, |
778 | uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate) | 779 | uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate) |
779 | { | 780 | { |
780 | InventoryItemBase item = new InventoryItemBase(); | 781 | InventoryItemBase item = new InventoryItemBase(); |
781 | item.Owner = remoteClient.AgentId; | 782 | item.Owner = remoteClient.AgentId; |
782 | item.CreatorId = creatorID; | 783 | item.CreatorId = creatorID; |
784 | item.CreatorData = creatorData; | ||
783 | item.ID = UUID.Random(); | 785 | item.ID = UUID.Random(); |
784 | item.AssetID = asset.FullID; | 786 | item.AssetID = asset.FullID; |
785 | item.Description = asset.Description; | 787 | item.Description = asset.Description; |
@@ -859,7 +861,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
859 | AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId); | 861 | AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId); |
860 | AssetService.Store(asset); | 862 | AssetService.Store(asset); |
861 | 863 | ||
862 | CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); | 864 | CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); |
863 | } | 865 | } |
864 | else | 866 | else |
865 | { | 867 | { |
@@ -901,7 +903,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
901 | asset.Description = description; | 903 | asset.Description = description; |
902 | 904 | ||
903 | CreateNewInventoryItem( | 905 | CreateNewInventoryItem( |
904 | remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, | 906 | remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, name, 0, callbackID, asset, invType, |
905 | (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, | 907 | (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, |
906 | (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); | 908 | (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); |
907 | } | 909 | } |
@@ -1025,6 +1027,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1025 | 1027 | ||
1026 | agentItem.ID = UUID.Random(); | 1028 | agentItem.ID = UUID.Random(); |
1027 | agentItem.CreatorId = taskItem.CreatorID.ToString(); | 1029 | agentItem.CreatorId = taskItem.CreatorID.ToString(); |
1030 | agentItem.CreatorData = taskItem.CreatorData; | ||
1028 | agentItem.Owner = destAgent; | 1031 | agentItem.Owner = destAgent; |
1029 | agentItem.AssetID = taskItem.AssetID; | 1032 | agentItem.AssetID = taskItem.AssetID; |
1030 | agentItem.Description = taskItem.Description; | 1033 | agentItem.Description = taskItem.Description; |
@@ -1226,6 +1229,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1226 | 1229 | ||
1227 | destTaskItem.ItemID = UUID.Random(); | 1230 | destTaskItem.ItemID = UUID.Random(); |
1228 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1231 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1232 | destTaskItem.CreatorData = srcTaskItem.CreatorData; | ||
1229 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1233 | destTaskItem.AssetID = srcTaskItem.AssetID; |
1230 | destTaskItem.GroupID = destPart.GroupID; | 1234 | destTaskItem.GroupID = destPart.GroupID; |
1231 | destTaskItem.OwnerID = destPart.OwnerID; | 1235 | destTaskItem.OwnerID = destPart.OwnerID; |
@@ -1638,6 +1642,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1638 | 1642 | ||
1639 | destTaskItem.ItemID = UUID.Random(); | 1643 | destTaskItem.ItemID = UUID.Random(); |
1640 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1644 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1645 | destTaskItem.CreatorData = srcTaskItem.CreatorData; | ||
1641 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1646 | destTaskItem.AssetID = srcTaskItem.AssetID; |
1642 | destTaskItem.GroupID = destPart.GroupID; | 1647 | destTaskItem.GroupID = destPart.GroupID; |
1643 | destTaskItem.OwnerID = destPart.OwnerID; | 1648 | destTaskItem.OwnerID = destPart.OwnerID; |
@@ -1844,6 +1849,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1844 | 1849 | ||
1845 | InventoryItemBase item = new InventoryItemBase(); | 1850 | InventoryItemBase item = new InventoryItemBase(); |
1846 | item.CreatorId = grp.RootPart.CreatorID.ToString(); | 1851 | item.CreatorId = grp.RootPart.CreatorID.ToString(); |
1852 | item.CreatorData = grp.RootPart.CreatorData; | ||
1847 | item.Owner = remoteClient.AgentId; | 1853 | item.Owner = remoteClient.AgentId; |
1848 | item.ID = UUID.Random(); | 1854 | item.ID = UUID.Random(); |
1849 | item.AssetID = asset.FullID; | 1855 | item.AssetID = asset.FullID; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6d5a53a..2155e26 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -449,12 +449,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
449 | } | 449 | } |
450 | } | 450 | } |
451 | 451 | ||
452 | public string CreatorData | 452 | public string CreatorData // = <profile url>;<name> |
453 | { | 453 | { |
454 | get { return m_creatorData; } | 454 | get { return m_creatorData; } |
455 | set { m_creatorData = value; } | 455 | set { m_creatorData = value; } |
456 | } | 456 | } |
457 | 457 | ||
458 | /// <summary> | ||
459 | /// Used by the DB layer to retrieve / store the entire user identification. | ||
460 | /// The identification can either be a simple UUID or a string of the form | ||
461 | /// uuid[;profile_url[;name]] | ||
462 | /// </summary> | ||
458 | public string CreatorIdentification | 463 | public string CreatorIdentification |
459 | { | 464 | { |
460 | get | 465 | get |
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()); |