diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
3 files changed, 49 insertions, 61 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 8d586c4..c9ee54f 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | |||
@@ -192,40 +192,29 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
192 | { | 192 | { |
193 | if (XferUploaders.ContainsKey(transactionID)) | 193 | if (XferUploaders.ContainsKey(transactionID)) |
194 | { | 194 | { |
195 | CachedUserInfo userInfo = Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails( | 195 | UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId); |
196 | remoteClient.AgentId); | ||
197 | 196 | ||
198 | if (userInfo != null) | 197 | AssetBase asset = Manager.MyScene.AssetService.Get(assetID.ToString()); |
199 | { | ||
200 | UUID assetID = UUID.Combine(transactionID, remoteClient.SecureSessionId); | ||
201 | |||
202 | AssetBase asset = Manager.MyScene.AssetService.Get(assetID.ToString()); | ||
203 | |||
204 | if (asset == null) | ||
205 | { | ||
206 | asset = GetTransactionAsset(transactionID); | ||
207 | } | ||
208 | |||
209 | if (asset != null && asset.FullID == assetID) | ||
210 | { | ||
211 | // Assets never get updated, new ones get created | ||
212 | asset.FullID = UUID.Random(); | ||
213 | asset.Name = item.Name; | ||
214 | asset.Description = item.Description; | ||
215 | asset.Type = (sbyte)item.AssetType; | ||
216 | item.AssetID = asset.FullID; | ||
217 | |||
218 | Manager.MyScene.AssetService.Store(asset); | ||
219 | } | ||
220 | 198 | ||
221 | userInfo.UpdateItem(item); | 199 | if (asset == null) |
200 | { | ||
201 | asset = GetTransactionAsset(transactionID); | ||
222 | } | 202 | } |
223 | else | 203 | |
204 | if (asset != null && asset.FullID == assetID) | ||
224 | { | 205 | { |
225 | m_log.ErrorFormat( | 206 | // Assets never get updated, new ones get created |
226 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item update", | 207 | asset.FullID = UUID.Random(); |
227 | remoteClient.AgentId); | 208 | asset.Name = item.Name; |
209 | asset.Description = item.Description; | ||
210 | asset.Type = (sbyte)item.AssetType; | ||
211 | item.AssetID = asset.FullID; | ||
212 | |||
213 | Manager.MyScene.AssetService.Store(asset); | ||
228 | } | 214 | } |
215 | |||
216 | IInventoryService invService = Manager.MyScene.InventoryService; | ||
217 | invService.UpdateItem(item); | ||
229 | } | 218 | } |
230 | } | 219 | } |
231 | } | 220 | } |
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index afd9f5a..e192b81 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -32,6 +32,7 @@ using log4net; | |||
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Communications.Cache; | 34 | using OpenSim.Framework.Communications.Cache; |
35 | using OpenSim.Services.Interfaces; | ||
35 | 36 | ||
36 | namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | 37 | namespace OpenSim.Region.CoreModules.Agent.AssetTransaction |
37 | { | 38 | { |
@@ -214,39 +215,31 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
214 | private void DoCreateItem(uint callbackID) | 215 | private void DoCreateItem(uint callbackID) |
215 | { | 216 | { |
216 | m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); | 217 | m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); |
217 | CachedUserInfo userInfo = | ||
218 | m_userTransactions.Manager.MyScene.CommsManager.UserProfileCacheService.GetUserDetails( | ||
219 | ourClient.AgentId); | ||
220 | 218 | ||
221 | if (userInfo != null) | 219 | IInventoryService invService = m_userTransactions.Manager.MyScene.InventoryService; |
222 | { | 220 | |
223 | InventoryItemBase item = new InventoryItemBase(); | 221 | InventoryItemBase item = new InventoryItemBase(); |
224 | item.Owner = ourClient.AgentId; | 222 | item.Owner = ourClient.AgentId; |
225 | item.CreatorId = ourClient.AgentId.ToString(); | 223 | item.CreatorId = ourClient.AgentId.ToString(); |
226 | item.ID = UUID.Random(); | 224 | item.ID = UUID.Random(); |
227 | item.AssetID = m_asset.FullID; | 225 | item.AssetID = m_asset.FullID; |
228 | item.Description = m_description; | 226 | item.Description = m_description; |
229 | item.Name = m_name; | 227 | item.Name = m_name; |
230 | item.AssetType = type; | 228 | item.AssetType = type; |
231 | item.InvType = invType; | 229 | item.InvType = invType; |
232 | item.Folder = InventFolder; | 230 | item.Folder = InventFolder; |
233 | item.BasePermissions = 0x7fffffff; | 231 | item.BasePermissions = 0x7fffffff; |
234 | item.CurrentPermissions = 0x7fffffff; | 232 | item.CurrentPermissions = 0x7fffffff; |
235 | item.GroupPermissions=0; | 233 | item.GroupPermissions=0; |
236 | item.EveryOnePermissions=0; | 234 | item.EveryOnePermissions=0; |
237 | item.NextPermissions = nextPerm; | 235 | item.NextPermissions = nextPerm; |
238 | item.Flags = (uint) wearableType; | 236 | item.Flags = (uint) wearableType; |
239 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 237 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
240 | 238 | ||
241 | userInfo.AddItem(item); | 239 | if (invService.AddItem(item)) |
242 | ourClient.SendInventoryItemCreateUpdate(item, callbackID); | 240 | ourClient.SendInventoryItemCreateUpdate(item, callbackID); |
243 | } | ||
244 | else | 241 | else |
245 | { | 242 | ourClient.SendAlertMessage("Unable to create inventory item"); |
246 | m_log.ErrorFormat( | ||
247 | "[ASSET TRANSACTIONS]: Could not find user {0} for inventory item creation", | ||
248 | ourClient.AgentId); | ||
249 | } | ||
250 | } | 243 | } |
251 | 244 | ||
252 | /// <summary> | 245 | /// <summary> |
diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index fa5369f..71ff28c 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Framework.Communications.Cache; | |||
37 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
39 | using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Framework.Interfaces.ITextureSender>; | 39 | using BlockingQueue = OpenSim.Framework.BlockingQueue<OpenSim.Region.Framework.Interfaces.ITextureSender>; |
40 | using OpenSim.Services.Interfaces; | ||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.Agent.TextureDownload | 42 | namespace OpenSim.Region.CoreModules.Agent.TextureDownload |
42 | { | 43 | { |
@@ -217,11 +218,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload | |||
217 | if (profile == null) // Deny unknown user | 218 | if (profile == null) // Deny unknown user |
218 | return; | 219 | return; |
219 | 220 | ||
220 | if (profile.RootFolder == null) // Deny no inventory | 221 | IInventoryService invService = scene.InventoryService; |
222 | if (invService.GetRootFolder(client.AgentId) == null) // Deny no inventory | ||
221 | return; | 223 | return; |
222 | 224 | ||
223 | if (profile.UserProfile.GodLevel < 200 && profile.RootFolder.FindAsset(e.RequestedAssetID) == null) // Deny if not owned | 225 | // Diva 2009-08-13: this test doesn't make any sense to many devs |
224 | return; | 226 | //if (profile.UserProfile.GodLevel < 200 && profile.RootFolder.FindAsset(e.RequestedAssetID) == null) // Deny if not owned |
227 | //{ | ||
228 | // m_log.WarnFormat("[TEXTURE]: user {0} doesn't have permissions to texture {1}"); | ||
229 | // return; | ||
230 | //} | ||
225 | 231 | ||
226 | m_log.Debug("Texture preview"); | 232 | m_log.Debug("Texture preview"); |
227 | } | 233 | } |