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 | |
parent | Updated SQLiteLegacy/SQLiteSimulationData with the same. Is this crap still u... (diff) | |
download | opensim-SC-c617d658dda92ad97de678d477a98c3df0659303.zip opensim-SC-c617d658dda92ad97de678d477a98c3df0659303.tar.gz opensim-SC-c617d658dda92ad97de678d477a98c3df0659303.tar.bz2 opensim-SC-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 '')
9 files changed, 132 insertions, 40 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index ef21834..67732ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -370,6 +370,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
370 | 370 | ||
371 | item = new InventoryItemBase(); | 371 | item = new InventoryItemBase(); |
372 | item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); | 372 | item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); |
373 | item.CreatorData = objectGroup.RootPart.CreatorData; | ||
373 | item.ID = UUID.Random(); | 374 | item.ID = UUID.Random(); |
374 | item.InvType = (int)InventoryType.Object; | 375 | item.InvType = (int)InventoryType.Object; |
375 | item.Folder = folder.ID; | 376 | item.Folder = folder.ID; |
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 88ed763..0d94baa 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -164,7 +164,11 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); | 164 | AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); |
165 | 165 | ||
166 | foreach (SceneObjectPart sop in sog.Parts) | 166 | foreach (SceneObjectPart sop in sog.Parts) |
167 | { | ||
167 | AddUser(sop.CreatorID, sop.CreatorData); | 168 | AddUser(sop.CreatorID, sop.CreatorData); |
169 | foreach (TaskInventoryItem item in sop.TaskInventory.Values) | ||
170 | AddUser(item.CreatorID, item.CreatorData); | ||
171 | } | ||
168 | } | 172 | } |
169 | 173 | ||
170 | 174 | ||
@@ -226,40 +230,49 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
226 | UserData user = new UserData(); | 230 | UserData user = new UserData(); |
227 | user.Id = id; | 231 | user.Id = id; |
228 | 232 | ||
229 | if (creatorData != null && creatorData != string.Empty) | 233 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); |
230 | { | ||
231 | //creatorData = <endpoint>;<name> | ||
232 | 234 | ||
233 | string[] parts = creatorData.Split(';'); | 235 | if (account != null) |
234 | if (parts.Length >= 1) | ||
235 | { | ||
236 | user.ProfileURL = parts[0]; | ||
237 | try | ||
238 | { | ||
239 | Uri uri = new Uri(parts[0]); | ||
240 | user.LastName = "@" + uri.Authority; | ||
241 | } | ||
242 | catch | ||
243 | { | ||
244 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
245 | user.LastName = "@unknown"; | ||
246 | } | ||
247 | } | ||
248 | if (parts.Length >= 2) | ||
249 | user.FirstName = parts[1].Replace(' ', '.'); | ||
250 | } | ||
251 | else | ||
252 | { | 236 | { |
253 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); | ||
254 | user.FirstName = account.FirstName; | 237 | user.FirstName = account.FirstName; |
255 | user.LastName = account.LastName; | 238 | user.LastName = account.LastName; |
256 | // user.ProfileURL = we should initialize this to the default | 239 | // user.ProfileURL = we should initialize this to the default |
257 | } | 240 | } |
241 | else | ||
242 | { | ||
243 | if (creatorData != null && creatorData != string.Empty) | ||
244 | { | ||
245 | //creatorData = <endpoint>;<name> | ||
246 | |||
247 | string[] parts = creatorData.Split(';'); | ||
248 | if (parts.Length >= 1) | ||
249 | { | ||
250 | user.ProfileURL = parts[0]; | ||
251 | try | ||
252 | { | ||
253 | Uri uri = new Uri(parts[0]); | ||
254 | user.LastName = "@" + uri.Authority; | ||
255 | } | ||
256 | catch | ||
257 | { | ||
258 | m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); | ||
259 | user.LastName = "@unknown"; | ||
260 | } | ||
261 | } | ||
262 | if (parts.Length >= 2) | ||
263 | user.FirstName = parts[1].Replace(' ', '.'); | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | user.FirstName = "Unknown"; | ||
268 | user.LastName = "User"; | ||
269 | } | ||
270 | } | ||
258 | 271 | ||
259 | lock (m_UserCache) | 272 | lock (m_UserCache) |
260 | m_UserCache[id] = user; | 273 | m_UserCache[id] = user; |
261 | 274 | ||
262 | //m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); | 275 | m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); |
263 | } | 276 | } |
264 | 277 | ||
265 | //public void AddUser(UUID uuid, string userData) | 278 | //public void AddUser(UUID uuid, string userData) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ab6be50..c7244c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -49,6 +49,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
49 | 49 | ||
50 | private IInventoryService m_InventoryService; | 50 | private IInventoryService m_InventoryService; |
51 | 51 | ||
52 | private Scene m_Scene; | ||
53 | |||
54 | private IUserManagement m_UserManager; | ||
55 | private IUserManagement UserManager | ||
56 | { | ||
57 | get | ||
58 | { | ||
59 | if (m_UserManager == null) | ||
60 | { | ||
61 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | ||
62 | } | ||
63 | return m_UserManager; | ||
64 | } | ||
65 | } | ||
66 | |||
52 | private bool m_Enabled = false; | 67 | private bool m_Enabled = false; |
53 | 68 | ||
54 | public Type ReplaceableInterface | 69 | public Type ReplaceableInterface |
@@ -115,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
115 | return; | 130 | return; |
116 | 131 | ||
117 | scene.RegisterModuleInterface<IInventoryService>(this); | 132 | scene.RegisterModuleInterface<IInventoryService>(this); |
133 | |||
134 | if (m_Scene == null) | ||
135 | m_Scene = scene; | ||
118 | } | 136 | } |
119 | 137 | ||
120 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |
@@ -163,7 +181,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
163 | 181 | ||
164 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | 182 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) |
165 | { | 183 | { |
166 | return m_InventoryService.GetFolderContent(userID, folderID); | 184 | InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); |
185 | if (UserManager != null) | ||
186 | foreach (InventoryItemBase item in invCol.Items) | ||
187 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
188 | |||
189 | return invCol; | ||
167 | } | 190 | } |
168 | 191 | ||
169 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 192 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index 17d80c7..9213132 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -47,9 +47,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
47 | 47 | ||
48 | private bool m_Enabled = false; | 48 | private bool m_Enabled = false; |
49 | private bool m_Initialized = false; | 49 | private bool m_Initialized = false; |
50 | // private Scene m_Scene; | 50 | private Scene m_Scene; |
51 | private InventoryServicesConnector m_RemoteConnector; | 51 | private InventoryServicesConnector m_RemoteConnector; |
52 | 52 | ||
53 | private IUserManagement m_UserManager; | ||
54 | private IUserManagement UserManager | ||
55 | { | ||
56 | get | ||
57 | { | ||
58 | if (m_UserManager == null) | ||
59 | { | ||
60 | m_UserManager = m_Scene.RequestModuleInterface<IUserManagement>(); | ||
61 | } | ||
62 | return m_UserManager; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | |||
53 | public Type ReplaceableInterface | 67 | public Type ReplaceableInterface |
54 | { | 68 | { |
55 | get { return null; } | 69 | get { return null; } |
@@ -116,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
116 | 130 | ||
117 | scene.RegisterModuleInterface<IInventoryService>(this); | 131 | scene.RegisterModuleInterface<IInventoryService>(this); |
118 | m_cache.AddRegion(scene); | 132 | m_cache.AddRegion(scene); |
133 | |||
134 | if (m_Scene == null) | ||
135 | m_Scene = scene; | ||
119 | } | 136 | } |
120 | 137 | ||
121 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |
@@ -186,7 +203,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
186 | UUID sessionID = GetSessionID(userID); | 203 | UUID sessionID = GetSessionID(userID); |
187 | try | 204 | try |
188 | { | 205 | { |
189 | return m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); | 206 | InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); |
207 | foreach (InventoryItemBase item in invCol.Items) | ||
208 | UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); | ||
209 | return invCol; | ||
190 | } | 210 | } |
191 | catch (Exception e) | 211 | catch (Exception e) |
192 | { | 212 | { |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index b7fa799..3238a81 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -269,7 +269,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
269 | if (!ResolveUserUuid(part.CreatorID)) | 269 | if (!ResolveUserUuid(part.CreatorID)) |
270 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 270 | part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
271 | } | 271 | } |
272 | UserManager.AddUser(part.CreatorID, part.CreatorData); | 272 | if (UserManager != null) |
273 | UserManager.AddUser(part.CreatorID, part.CreatorData); | ||
273 | 274 | ||
274 | if (!ResolveUserUuid(part.OwnerID)) | 275 | if (!ResolveUserUuid(part.OwnerID)) |
275 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 276 | part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
@@ -293,10 +294,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
293 | { | 294 | { |
294 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 295 | kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
295 | } | 296 | } |
296 | if (!ResolveUserUuid(kvp.Value.CreatorID)) | 297 | if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) |
297 | { | 298 | { |
298 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 299 | if (!ResolveUserUuid(kvp.Value.CreatorID)) |
300 | kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
299 | } | 301 | } |
302 | if (UserManager != null) | ||
303 | UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); | ||
300 | } | 304 | } |
301 | } | 305 | } |
302 | } | 306 | } |
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index c06ccb2..568ba19 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -189,6 +189,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
189 | 189 | ||
190 | InventoryItemBase item = new InventoryItemBase(); | 190 | InventoryItemBase item = new InventoryItemBase(); |
191 | item.CreatorId = part.CreatorID.ToString(); | 191 | item.CreatorId = part.CreatorID.ToString(); |
192 | item.CreatorData = part.CreatorData; | ||
192 | 193 | ||
193 | item.ID = UUID.Random(); | 194 | item.ID = UUID.Random(); |
194 | item.Owner = remoteClient.AgentId; | 195 | item.Owner = remoteClient.AgentId; |
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()); |