diff options
author | Diva Canto | 2009-08-12 20:39:48 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-12 20:39:48 -0700 |
commit | 7aa54593e0b6672979feec97b8151ed134388723 (patch) | |
tree | eaa145993ba39c61f6cbfcd202deb50fbd125fe6 /OpenSim/Region/CoreModules/Agent | |
parent | * Added two new packet handler implementations for inventory ops. This is sta... (diff) | |
download | opensim-SC-7aa54593e0b6672979feec97b8151ed134388723.zip opensim-SC-7aa54593e0b6672979feec97b8151ed134388723.tar.gz opensim-SC-7aa54593e0b6672979feec97b8151ed134388723.tar.bz2 opensim-SC-7aa54593e0b6672979feec97b8151ed134388723.tar.xz |
Redirected all calls to CachedUserProfile methods to the inventory service. Redirection of the RootFolder property is still todo. This compiles but probably inventory will be inconsistent.
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | 47 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | 51 |
2 files changed, 40 insertions, 58 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> |