aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Capabilities/LLSDAssetUploadComplete.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs47
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs34
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs4
6 files changed, 74 insertions, 23 deletions
diff --git a/OpenSim/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Capabilities/LLSDAssetUploadComplete.cs
index ae8eb09..476cf6e 100644
--- a/OpenSim/Capabilities/LLSDAssetUploadComplete.cs
+++ b/OpenSim/Capabilities/LLSDAssetUploadComplete.cs
@@ -40,6 +40,10 @@ namespace OpenSim.Framework.Capabilities
40 public string state = String.Empty; 40 public string state = String.Empty;
41 public LLSDAssetUploadError error = null; 41 public LLSDAssetUploadError error = null;
42 //public bool success = false; 42 //public bool success = false;
43 public int new_next_owner_mask = 0;
44 public int new_group_mask = 0;
45 public int new_everyone_mask = 0;
46 public int inventory_item_flags = 0;
43 47
44 public LLSDAssetUploadComplete() 48 public LLSDAssetUploadComplete()
45 { 49 {
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 66b9f06..39ba708 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack.Linden
58 string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, 58 string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder,
59 byte[] data, string inventoryType, string assetType, 59 byte[] data, string inventoryType, string assetType,
60 int cost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, 60 int cost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances,
61 bool IsAtestUpload, ref string error); 61 bool IsAtestUpload, ref string error, ref int nextOwnerMask, ref int groupMask, ref int everyoneMask);
62 62
63 public delegate UUID UpdateItem(UUID itemID, byte[] data); 63 public delegate UUID UpdateItem(UUID itemID, byte[] data);
64 64
@@ -666,7 +666,8 @@ namespace OpenSim.Region.ClientStack.Linden
666 AssetUploader uploader = 666 AssetUploader uploader =
667 new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, 667 new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
668 llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost, 668 llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile, cost,
669 texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload); 669 texturesFolder, nreqtextures, nreqmeshs, nreqinstances, IsAtestUpload,
670 llsdRequest.next_owner_mask, llsdRequest.group_mask, llsdRequest.everyone_mask);
670 671
671 m_HostCapsObj.HttpListener.AddStreamHandler( 672 m_HostCapsObj.HttpListener.AddStreamHandler(
672 new BinaryStreamHandler( 673 new BinaryStreamHandler(
@@ -713,9 +714,9 @@ namespace OpenSim.Region.ClientStack.Linden
713 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, 714 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType,
714 string assetType, int cost, 715 string assetType, int cost,
715 UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, 716 UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances,
716 bool IsAtestUpload, ref string error) 717 bool IsAtestUpload, ref string error,
718 ref int nextOwnerMask, ref int groupMask, ref int everyoneMask)
717 { 719 {
718
719 lock (m_ModelCost) 720 lock (m_ModelCost)
720 m_FileAgentInventoryState = FileAgentInventoryState.processUpload; 721 m_FileAgentInventoryState = FileAgentInventoryState.processUpload;
721 722
@@ -1081,7 +1082,13 @@ namespace OpenSim.Region.ClientStack.Linden
1081 { 1082 {
1082 prim.BaseMask = (uint)PermissionMask.All | (uint)PermissionMask.Export; 1083 prim.BaseMask = (uint)PermissionMask.All | (uint)PermissionMask.Export;
1083 prim.OwnerMask = (uint)PermissionMask.All | (uint)PermissionMask.Export; 1084 prim.OwnerMask = (uint)PermissionMask.All | (uint)PermissionMask.Export;
1084 prim.NextOwnerMask = (uint)PermissionMask.Transfer; 1085 prim.GroupMask = prim.BaseMask & (uint)groupMask;
1086 prim.EveryoneMask = prim.BaseMask & (uint)everyoneMask;
1087 prim.NextOwnerMask = prim.BaseMask & (uint)nextOwnerMask;
1088 // If the viewer gives us bogus permissions, revert to the SL
1089 // default of transfer only.
1090 if ((prim.NextOwnerMask & (uint)PermissionMask.All) == 0)
1091 prim.NextOwnerMask = (uint)PermissionMask.Transfer;
1085 } 1092 }
1086 1093
1087 if(istest) 1094 if(istest)
@@ -1191,6 +1198,7 @@ namespace OpenSim.Region.ClientStack.Linden
1191 { 1198 {
1192 item.BasePermissions = (uint)(PermissionMask.Move | PermissionMask.Modify); 1199 item.BasePermissions = (uint)(PermissionMask.Move | PermissionMask.Modify);
1193 item.CurrentPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify); 1200 item.CurrentPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify);
1201 item.GroupPermissions = 0;
1194 item.EveryOnePermissions = 0; 1202 item.EveryOnePermissions = 0;
1195 item.NextPermissions = 0; 1203 item.NextPermissions = 0;
1196 } 1204 }
@@ -1198,12 +1206,19 @@ namespace OpenSim.Region.ClientStack.Linden
1198 { 1206 {
1199 item.BasePermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export; 1207 item.BasePermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export;
1200 item.CurrentPermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export; 1208 item.CurrentPermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export;
1201 item.EveryOnePermissions = 0; 1209 item.GroupPermissions = item.BasePermissions & (uint)groupMask;
1202 item.NextPermissions = (uint)PermissionMask.Transfer; 1210 item.EveryOnePermissions = item.BasePermissions & (uint)everyoneMask;
1211 item.NextPermissions = item.BasePermissions & (uint)nextOwnerMask;
1212 if ((item.NextPermissions & (uint)PermissionMask.All) == 0)
1213 item.NextPermissions = (uint)PermissionMask.Transfer;
1203 } 1214 }
1204 1215
1205 item.CreationDate = Util.UnixTimeSinceEpoch(); 1216 item.CreationDate = Util.UnixTimeSinceEpoch();
1206 1217
1218 everyoneMask = (int)item.EveryOnePermissions;
1219 groupMask = (int)item.GroupPermissions;
1220 nextOwnerMask = (int)item.NextPermissions;
1221
1207 m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); 1222 m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client);
1208 1223
1209 if (AddNewInventoryItem != null) 1224 if (AddNewInventoryItem != null)
@@ -1592,12 +1607,17 @@ namespace OpenSim.Region.ClientStack.Linden
1592 private int m_nreqmeshs; 1607 private int m_nreqmeshs;
1593 private int m_nreqinstances; 1608 private int m_nreqinstances;
1594 private bool m_IsAtestUpload; 1609 private bool m_IsAtestUpload;
1610
1611 private int m_nextOwnerMask;
1612 private int m_groupMask;
1613 private int m_everyoneMask;
1614
1595 1615
1596 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, 1616 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem,
1597 UUID parentFolderID, string invType, string assetType, string path, 1617 UUID parentFolderID, string invType, string assetType, string path,
1598 IHttpServer httpServer, bool dumpAssetsToFile, 1618 IHttpServer httpServer, bool dumpAssetsToFile,
1599 int totalCost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances, 1619 int totalCost, UUID texturesFolder, int nreqtextures, int nreqmeshs, int nreqinstances,
1600 bool IsAtestUpload) 1620 bool IsAtestUpload, int nextOwnerMask, int groupMask, int everyoneMask)
1601 { 1621 {
1602 m_assetName = assetName; 1622 m_assetName = assetName;
1603 m_assetDes = description; 1623 m_assetDes = description;
@@ -1621,6 +1641,10 @@ namespace OpenSim.Region.ClientStack.Linden
1621 m_timeoutTimer.Interval = 120000; 1641 m_timeoutTimer.Interval = 120000;
1622 m_timeoutTimer.AutoReset = false; 1642 m_timeoutTimer.AutoReset = false;
1623 m_timeoutTimer.Start(); 1643 m_timeoutTimer.Start();
1644
1645 m_nextOwnerMask = nextOwnerMask;
1646 m_groupMask = groupMask;
1647 m_everyoneMask = everyoneMask;
1624 } 1648 }
1625 1649
1626 /// <summary> 1650 /// <summary>
@@ -1661,8 +1685,13 @@ namespace OpenSim.Region.ClientStack.Linden
1661 { 1685 {
1662 handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType, 1686 handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType,
1663 m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload, 1687 m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload,
1664 ref m_error); 1688 ref m_error, ref m_nextOwnerMask, ref m_groupMask, ref m_everyoneMask);
1665 } 1689 }
1690
1691 uploadComplete.new_next_owner_mask = m_nextOwnerMask;
1692 uploadComplete.new_group_mask = m_groupMask;
1693 uploadComplete.new_everyone_mask = m_everyoneMask;
1694
1666 if (m_IsAtestUpload) 1695 if (m_IsAtestUpload)
1667 { 1696 {
1668 LLSDAssetUploadError resperror = new LLSDAssetUploadError(); 1697 LLSDAssetUploadError resperror = new LLSDAssetUploadError();
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index 64bcfa2..60a254e 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -429,7 +429,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
429 429
430 m_transactions.RemoveXferUploader(m_transactionID); 430 m_transactions.RemoveXferUploader(m_transactionID);
431 431
432 m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(ourClient.AgentId, (AssetType)type, m_asset.FullID, m_asset.Name, 0); 432 m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(item, 0);
433 } 433 }
434 434
435 /// <summary> 435 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 582b267..6b78fe8 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -209,15 +209,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
209 } 209 }
210 } 210 }
211 211
212 public void PostInventoryAsset(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel) 212 public void PostInventoryAsset(InventoryItemBase item, int userlevel)
213 { 213 {
214 if (type == AssetType.Link) 214 if (item.AssetType == (int)AssetType.Link)
215 return; 215 return;
216 216
217 string userAssetServer = string.Empty; 217 string userAssetServer = string.Empty;
218 if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission) 218 if (IsForeignUser(item.Owner, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
219 { 219 {
220 m_assMapper.Post(assetID, avatarID, userAssetServer); 220 m_assMapper.Post(item.AssetID, item.Owner, userAssetServer);
221 } 221 }
222 } 222 }
223 223
@@ -248,7 +248,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
248 { 248 {
249 UUID newAssetID = base.CapsUpdateInventoryItemAsset(remoteClient, itemID, data); 249 UUID newAssetID = base.CapsUpdateInventoryItemAsset(remoteClient, itemID, data);
250 250
251 PostInventoryAsset(remoteClient.AgentId, AssetType.Unknown, newAssetID, "", 0); 251 // We need to construct this here to satisfy the calling convention.
252 // Better this in two places than five formal params in all others.
253 InventoryItemBase item = new InventoryItemBase();
254 item.Owner = remoteClient.AgentId;
255 item.AssetType = (int)AssetType.Unknown;
256 item.AssetID = newAssetID;
257 item.Name = String.Empty;
258
259 PostInventoryAsset(item, 0);
252 260
253 return newAssetID; 261 return newAssetID;
254 } 262 }
@@ -260,7 +268,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
260 { 268 {
261 if (base.UpdateInventoryItemAsset(ownerID, item, asset)) 269 if (base.UpdateInventoryItemAsset(ownerID, item, asset))
262 { 270 {
263 PostInventoryAsset(ownerID, (AssetType)asset.Type, asset.FullID, asset.Name, 0); 271 PostInventoryAsset(item, 0);
264 return true; 272 return true;
265 } 273 }
266 274
@@ -273,9 +281,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
273 protected override void ExportAsset(UUID agentID, UUID assetID) 281 protected override void ExportAsset(UUID agentID, UUID assetID)
274 { 282 {
275 if (!assetID.Equals(UUID.Zero)) 283 if (!assetID.Equals(UUID.Zero))
276 PostInventoryAsset(agentID, AssetType.Unknown, assetID, "", 0); 284 {
285 InventoryItemBase item = new InventoryItemBase();
286 item.Owner = agentID;
287 item.AssetType = (int)AssetType.Unknown;
288 item.AssetID = assetID;
289 item.Name = String.Empty;
290
291 PostInventoryAsset(item, 0);
292 }
277 else 293 else
294 {
278 m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); 295 m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
296 }
279 } 297 }
280 298
281 /// 299 ///
@@ -535,4 +553,4 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
535 553
536 #endregion 554 #endregion
537 } 555 }
538} \ No newline at end of file 556}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 0a6bca4..8683599 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -748,7 +748,7 @@ namespace OpenSim.Region.Framework.Scenes
748 public event OnIncomingSceneObjectDelegate OnIncomingSceneObject; 748 public event OnIncomingSceneObjectDelegate OnIncomingSceneObject;
749 public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so); 749 public delegate void OnIncomingSceneObjectDelegate(SceneObjectGroup so);
750 750
751 public delegate void NewInventoryItemUploadComplete(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel); 751 public delegate void NewInventoryItemUploadComplete(InventoryItemBase item, int userlevel);
752 752
753 public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete; 753 public event NewInventoryItemUploadComplete OnNewInventoryItemUploadComplete;
754 754
@@ -2262,7 +2262,7 @@ namespace OpenSim.Region.Framework.Scenes
2262 } 2262 }
2263 } 2263 }
2264 2264
2265 public void TriggerOnNewInventoryItemUploadComplete(UUID agentID, AssetType type, UUID AssetID, String AssetName, int userlevel) 2265 public void TriggerOnNewInventoryItemUploadComplete(InventoryItemBase item, int userlevel)
2266 { 2266 {
2267 NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete; 2267 NewInventoryItemUploadComplete handlerNewInventoryItemUpdateComplete = OnNewInventoryItemUploadComplete;
2268 if (handlerNewInventoryItemUpdateComplete != null) 2268 if (handlerNewInventoryItemUpdateComplete != null)
@@ -2271,7 +2271,7 @@ namespace OpenSim.Region.Framework.Scenes
2271 { 2271 {
2272 try 2272 try
2273 { 2273 {
2274 d(agentID, type, AssetID, AssetName, userlevel); 2274 d(item, userlevel);
2275 } 2275 }
2276 catch (Exception e) 2276 catch (Exception e)
2277 { 2277 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 1910a78..a28737e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -149,7 +149,7 @@ namespace OpenSim.Region.Framework.Scenes
149 userlevel = 1; 149 userlevel = 1;
150 } 150 }
151 if (trigger) 151 if (trigger)
152 EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); 152 EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel);
153 153
154 return true; 154 return true;
155 } 155 }
@@ -191,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes
191 userlevel = 1; 191 userlevel = 1;
192 } 192 }
193 if (trigger) 193 if (trigger)
194 EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, (AssetType)item.AssetType, item.AssetID, item.Name, userlevel); 194 EventManager.TriggerOnNewInventoryItemUploadComplete(item, userlevel);
195 195
196 if (originalFolder != UUID.Zero) 196 if (originalFolder != UUID.Zero)
197 { 197 {