diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
13 files changed, 203 insertions, 264 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 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 33dc7a5..582beee 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -34,6 +34,7 @@ using OpenSim.Framework; | |||
34 | using OpenSim.Framework.Communications.Cache; | 34 | using OpenSim.Framework.Communications.Cache; |
35 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | using OpenSim.Services.Interfaces; | ||
37 | 38 | ||
38 | namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | 39 | namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory |
39 | { | 40 | { |
@@ -115,9 +116,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
115 | } | 116 | } |
116 | 117 | ||
117 | 118 | ||
118 | public void SetAppearanceAssets(CachedUserInfo profile, ref AvatarAppearance appearance) | 119 | public void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) |
119 | { | 120 | { |
120 | if (profile.RootFolder != null) | 121 | IInventoryService invService = m_scene.InventoryService; |
122 | |||
123 | if (invService.GetRootFolder(userID) != null) | ||
121 | { | 124 | { |
122 | for (int i = 0; i < 13; i++) | 125 | for (int i = 0; i < 13; i++) |
123 | { | 126 | { |
@@ -127,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
127 | } | 130 | } |
128 | else | 131 | else |
129 | { | 132 | { |
130 | InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID); | 133 | InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID)); |
131 | 134 | ||
132 | if (baseItem != null) | 135 | if (baseItem != null) |
133 | { | 136 | { |
@@ -143,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
143 | } | 146 | } |
144 | else | 147 | else |
145 | { | 148 | { |
146 | m_log.Error("[APPEARANCE]: you have no inventory, appearance stuff isn't going to work"); | 149 | m_log.WarnFormat("[APPEARANCE]: user {0} has no inventory, appearance isn't going to work", userID); |
147 | } | 150 | } |
148 | } | 151 | } |
149 | 152 | ||
@@ -163,8 +166,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
163 | return; | 166 | return; |
164 | } | 167 | } |
165 | 168 | ||
166 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); | ||
167 | |||
168 | AvatarAppearance avatAppearance = null; | 169 | AvatarAppearance avatAppearance = null; |
169 | if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) | 170 | if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) |
170 | { | 171 | { |
@@ -174,34 +175,18 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
174 | 175 | ||
175 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); | 176 | //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); |
176 | 177 | ||
177 | if (profile != null) | 178 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) |
178 | { | 179 | { |
179 | if (profile.RootFolder != null) | 180 | if (wear.Type < 13) |
180 | { | 181 | { |
181 | foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) | 182 | avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; |
182 | { | ||
183 | if (wear.Type < 13) | ||
184 | { | ||
185 | avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; | ||
186 | } | ||
187 | } | ||
188 | |||
189 | SetAppearanceAssets(profile, ref avatAppearance); | ||
190 | |||
191 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); | ||
192 | avatar.Appearance = avatAppearance; | ||
193 | } | ||
194 | else | ||
195 | { | ||
196 | m_log.WarnFormat( | ||
197 | "[APPEARANCE]: Inventory has not yet been received for {0}, cannot set wearables", | ||
198 | clientView.Name); | ||
199 | } | 183 | } |
200 | } | 184 | } |
201 | else | 185 | |
202 | { | 186 | SetAppearanceAssets(avatar.UUID, ref avatAppearance); |
203 | m_log.WarnFormat("[APPEARANCE]: Cannot set wearables for {0}, no user profile found", clientView.Name); | 187 | |
204 | } | 188 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); |
189 | avatar.Appearance = avatAppearance; | ||
205 | } | 190 | } |
206 | 191 | ||
207 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) | 192 | public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index b6250a2..49b2b5c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -39,6 +39,7 @@ using OpenSim.Framework.Communications; | |||
39 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
40 | using OpenSim.Region.Framework.Interfaces; | 40 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes; | 41 | using OpenSim.Region.Framework.Scenes; |
42 | using OpenSim.Services.Interfaces; | ||
42 | 43 | ||
43 | namespace OpenSim.Region.CoreModules.Avatar.Friends | 44 | namespace OpenSim.Region.CoreModules.Avatar.Friends |
44 | { | 45 | { |
@@ -654,8 +655,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
654 | initiator.ControllingClient.SendAgentOnline(new UUID[] { fromAgentID }); | 655 | initiator.ControllingClient.SendAgentOnline(new UUID[] { fromAgentID }); |
655 | 656 | ||
656 | // find the folder for the friend... | 657 | // find the folder for the friend... |
657 | InventoryFolderImpl folder = | 658 | //InventoryFolderImpl folder = |
658 | initiator.Scene.CommsManager.UserProfileCacheService.GetUserDetails(toAgentID).FindFolderForType((int)InventoryType.CallingCard); | 659 | // initiator.Scene.CommsManager.UserProfileCacheService.GetUserDetails(toAgentID).FindFolderForType((int)InventoryType.CallingCard); |
660 | IInventoryService invService = initiator.Scene.InventoryService; | ||
661 | InventoryFolderBase folder = invService.GetFolderForType(toAgentID, AssetType.CallingCard); | ||
659 | if (folder != null) | 662 | if (folder != null) |
660 | { | 663 | { |
661 | // ... and add the calling card | 664 | // ... and add the calling card |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index 102feaf..a68db1b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -33,6 +33,7 @@ using OpenSim.Framework; | |||
33 | using OpenSim.Framework.Communications.Cache; | 33 | using OpenSim.Framework.Communications.Cache; |
34 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
35 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
36 | using OpenSim.Services.Interfaces; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.CoreModules.Avatar.Gestures | 38 | namespace OpenSim.Region.CoreModules.Avatar.Gestures |
38 | { | 39 | { |
@@ -62,42 +63,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
62 | 63 | ||
63 | public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) | 64 | public virtual void ActivateGesture(IClientAPI client, UUID assetId, UUID gestureId) |
64 | { | 65 | { |
65 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); | 66 | IInventoryService invService = m_scene.InventoryService; |
66 | 67 | ||
67 | if (userInfo != null) | 68 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); |
69 | if (item != null) | ||
68 | { | 70 | { |
69 | InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId); | 71 | item.Flags = 1; |
70 | if (item != null) | 72 | invService.UpdateItem(item); |
71 | { | ||
72 | item.Flags = 1; | ||
73 | userInfo.UpdateItem(item); | ||
74 | } | ||
75 | else | ||
76 | m_log.ErrorFormat( | ||
77 | "[GESTURES]: Unable to find gesture to activate {0} for {1}", gestureId, client.Name); | ||
78 | } | 73 | } |
79 | else | 74 | else |
80 | m_log.ErrorFormat("[GESTURES]: Unable to find user {0}", client.Name); | 75 | m_log.WarnFormat( |
76 | "[GESTURES]: Unable to find gesture {0} to activate for {1}", gestureId, client.Name); | ||
81 | } | 77 | } |
82 | 78 | ||
83 | public virtual void DeactivateGesture(IClientAPI client, UUID gestureId) | 79 | public virtual void DeactivateGesture(IClientAPI client, UUID gestureId) |
84 | { | 80 | { |
85 | CachedUserInfo userInfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(client.AgentId); | 81 | IInventoryService invService = m_scene.InventoryService; |
86 | 82 | ||
87 | if (userInfo != null) | 83 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); |
84 | if (item != null) | ||
88 | { | 85 | { |
89 | InventoryItemBase item = userInfo.RootFolder.FindItem(gestureId); | 86 | item.Flags = 0; |
90 | if (item != null) | 87 | invService.UpdateItem(item); |
91 | { | ||
92 | item.Flags = 0; | ||
93 | userInfo.UpdateItem(item); | ||
94 | } | ||
95 | else | ||
96 | m_log.ErrorFormat( | ||
97 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); | ||
98 | } | 88 | } |
99 | else | 89 | else |
100 | m_log.ErrorFormat("[GESTURES]: Unable to find user {0}", client.Name); | 90 | m_log.ErrorFormat( |
91 | "[GESTURES]: Unable to find gesture to deactivate {0} for {1}", gestureId, client.Name); | ||
101 | } | 92 | } |
102 | } | 93 | } |
103 | } \ No newline at end of file | 94 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 811d4cc..5315c11 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -35,6 +35,7 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Framework.Communications.Cache; | 35 | using OpenSim.Framework.Communications.Cache; |
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Services.Interfaces; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | 40 | namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer |
40 | { | 41 | { |
@@ -154,7 +155,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
154 | "into agent {1}'s inventory", | 155 | "into agent {1}'s inventory", |
155 | folderID, new UUID(im.toAgentID)); | 156 | folderID, new UUID(im.toAgentID)); |
156 | 157 | ||
157 | InventoryFolderImpl folderCopy | 158 | InventoryFolderBase folderCopy |
158 | = scene.GiveInventoryFolder(new UUID(im.toAgentID), client.AgentId, folderID, UUID.Zero); | 159 | = scene.GiveInventoryFolder(new UUID(im.toAgentID), client.AgentId, folderID, UUID.Zero); |
159 | 160 | ||
160 | if (folderCopy == null) | 161 | if (folderCopy == null) |
@@ -247,52 +248,51 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
247 | // It will have been pushed to the client, too | 248 | // It will have been pushed to the client, too |
248 | // | 249 | // |
249 | 250 | ||
250 | CachedUserInfo userInfo = | 251 | //CachedUserInfo userInfo = |
251 | scene.CommsManager.UserProfileCacheService. | 252 | // scene.CommsManager.UserProfileCacheService. |
252 | GetUserDetails(client.AgentId); | 253 | // GetUserDetails(client.AgentId); |
254 | IInventoryService invService = scene.InventoryService; | ||
253 | 255 | ||
254 | if (userInfo != null) | 256 | InventoryFolderBase trashFolder = |
255 | { | 257 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); |
256 | InventoryFolderImpl trashFolder = | 258 | |
257 | userInfo.FindFolderForType((int)AssetType.TrashFolder); | 259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
258 | |||
259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | ||
260 | |||
261 | InventoryItemBase item = userInfo.RootFolder.FindItem(inventoryEntityID); | ||
262 | InventoryFolderBase folder = null; | ||
263 | 260 | ||
264 | if (item != null && trashFolder != null) | 261 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID)); |
265 | { | 262 | InventoryFolderBase folder = null; |
266 | item.Folder = trashFolder.ID; | 263 | |
267 | 264 | if (item != null && trashFolder != null) | |
268 | userInfo.DeleteItem(inventoryEntityID); | 265 | { |
266 | item.Folder = trashFolder.ID; | ||
269 | 267 | ||
270 | scene.AddInventoryItem(client, item); | 268 | // Diva comment: can't we just update this item??? |
271 | } | 269 | invService.DeleteItem(item); |
272 | else | 270 | scene.AddInventoryItem(client, item); |
271 | } | ||
272 | else | ||
273 | { | ||
274 | folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID)); | ||
275 | |||
276 | if (folder != null & trashFolder != null) | ||
273 | { | 277 | { |
274 | folder = userInfo.RootFolder.FindFolder(inventoryEntityID); | 278 | folder.ParentID = trashFolder.ID; |
275 | 279 | invService.MoveFolder(folder); | |
276 | if (folder != null & trashFolder != null) | ||
277 | { | ||
278 | userInfo.MoveFolder(inventoryEntityID, trashFolder.ID); | ||
279 | } | ||
280 | } | 280 | } |
281 | } | ||
282 | |||
283 | if ((null == item && null == folder) | null == trashFolder) | ||
284 | { | ||
285 | string reason = String.Empty; | ||
281 | 286 | ||
282 | if ((null == item && null == folder) | null == trashFolder) | 287 | if (trashFolder == null) |
283 | { | 288 | reason += " Trash folder not found."; |
284 | string reason = String.Empty; | 289 | if (item == null) |
285 | 290 | reason += " Item not found."; | |
286 | if (trashFolder == null) | 291 | if (folder == null) |
287 | reason += " Trash folder not found."; | 292 | reason += " Folder not found."; |
288 | if (item == null) | 293 | |
289 | reason += " Item not found."; | 294 | client.SendAgentAlertMessage("Unable to delete "+ |
290 | if (folder == null) | 295 | "received inventory" + reason, false); |
291 | reason += " Folder not found."; | ||
292 | |||
293 | client.SendAgentAlertMessage("Unable to delete "+ | ||
294 | "received inventory" + reason, false); | ||
295 | } | ||
296 | } | 296 | } |
297 | 297 | ||
298 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); | 298 | ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); |
@@ -405,17 +405,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
405 | return; | 405 | return; |
406 | } | 406 | } |
407 | 407 | ||
408 | CachedUserInfo userInfo = | 408 | //CachedUserInfo userInfo = |
409 | scene.CommsManager.UserProfileCacheService. | 409 | // scene.CommsManager.UserProfileCacheService. |
410 | GetUserDetails(user.ControllingClient.AgentId); | 410 | // GetUserDetails(user.ControllingClient.AgentId); |
411 | 411 | ||
412 | if (userInfo == null) | 412 | //if (userInfo == null) |
413 | { | 413 | //{ |
414 | m_log.Debug("[INVENTORY TRANSFER] Can't find user info of recipient"); | 414 | // m_log.Debug("[INVENTORY TRANSFER] Can't find user info of recipient"); |
415 | return; | 415 | // return; |
416 | } | 416 | //} |
417 | 417 | ||
418 | AssetType assetType = (AssetType)msg.binaryBucket[0]; | 418 | AssetType assetType = (AssetType)msg.binaryBucket[0]; |
419 | IInventoryService invService = scene.InventoryService; | ||
419 | 420 | ||
420 | if (AssetType.Folder == assetType) | 421 | if (AssetType.Folder == assetType) |
421 | { | 422 | { |
@@ -425,31 +426,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
425 | folder.ID = folderID; | 426 | folder.ID = folderID; |
426 | folder.Owner = user.ControllingClient.AgentId; | 427 | folder.Owner = user.ControllingClient.AgentId; |
427 | 428 | ||
428 | // Fetch from database | 429 | // Fetch from service |
429 | // | 430 | // |
430 | if (!userInfo.QueryFolder(folder)) | 431 | folder = invService.GetFolder(folder); |
432 | if (folder == null) | ||
431 | { | 433 | { |
432 | m_log.Debug("[INVENTORY TRANSFER] Can't find folder to give"); | 434 | m_log.Debug("[INVENTORY TRANSFER] Can't find folder to give"); |
433 | return; | 435 | return; |
434 | } | 436 | } |
435 | 437 | ||
436 | // Get folder info | 438 | user.ControllingClient.SendBulkUpdateInventory(folder); |
437 | // | ||
438 | InventoryFolderImpl folderInfo = userInfo.RootFolder.FindFolder(folder.ID); | ||
439 | if (folderInfo == null) | ||
440 | { | ||
441 | m_log.Debug("[INVENTORY TRANSFER] Can't retrieve folder to give"); | ||
442 | return; | ||
443 | } | ||
444 | |||
445 | user.ControllingClient.SendBulkUpdateInventory(folderInfo); | ||
446 | 439 | ||
447 | // This unelegant, slow kludge is to reload the folders and | 440 | //// This unelegant, slow kludge is to reload the folders and |
448 | // items. Since a folder give can transfer subfolders and | 441 | //// items. Since a folder give can transfer subfolders and |
449 | // items, this is the easiest way to pull that stuff in | 442 | //// items, this is the easiest way to pull that stuff in |
450 | // | 443 | //// |
451 | userInfo.DropInventory(); | 444 | //userInfo.DropInventory(); |
452 | userInfo.FetchInventory(); | 445 | //userInfo.FetchInventory(); |
453 | 446 | ||
454 | // Deliver message | 447 | // Deliver message |
455 | // | 448 | // |
@@ -463,20 +456,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
463 | item.ID = itemID; | 456 | item.ID = itemID; |
464 | item.Owner = user.ControllingClient.AgentId; | 457 | item.Owner = user.ControllingClient.AgentId; |
465 | 458 | ||
466 | // Fetch from database | 459 | // Fetch from service |
467 | // | ||
468 | if (!userInfo.QueryItem(item)) | ||
469 | { | ||
470 | m_log.Debug("[INVENTORY TRANSFER] Can't find item to give"); | ||
471 | return; | ||
472 | } | ||
473 | |||
474 | // Get item info | ||
475 | // | 460 | // |
476 | item = userInfo.RootFolder.FindItem(item.ID); | 461 | item = invService.GetItem(item); |
477 | if (item == null) | 462 | if (item == null) |
478 | { | 463 | { |
479 | m_log.Debug("[INVENTORY TRANSFER] Can't retrieve item to give"); | 464 | m_log.Debug("[INVENTORY TRANSFER] Can't find item to give"); |
480 | return; | 465 | return; |
481 | } | 466 | } |
482 | 467 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index 375faf5..ef5ffe1 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -82,7 +82,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
82 | /// </summary> | 82 | /// </summary> |
83 | /// <param name="userID"></param> | 83 | /// <param name="userID"></param> |
84 | /// <returns>null if no root folder was found</returns> | 84 | /// <returns>null if no root folder was found</returns> |
85 | public abstract InventoryFolderBase GetRootFolder(UUID userID); | 85 | public InventoryFolderBase GetRootFolder(UUID userID) |
86 | { | ||
87 | // Root folder is here as system type Folder. | ||
88 | return m_cache.GetFolderForType(userID, AssetType.Folder); | ||
89 | } | ||
86 | 90 | ||
87 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); | 91 | public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID); |
88 | 92 | ||
@@ -184,9 +188,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
184 | /// <returns>true if the item was successfully deleted</returns> | 188 | /// <returns>true if the item was successfully deleted</returns> |
185 | public abstract bool DeleteItem(InventoryItemBase item); | 189 | public abstract bool DeleteItem(InventoryItemBase item); |
186 | 190 | ||
187 | public abstract InventoryItemBase QueryItem(InventoryItemBase item); | 191 | public abstract InventoryItemBase GetItem(InventoryItemBase item); |
188 | 192 | ||
189 | public abstract InventoryFolderBase QueryFolder(InventoryFolderBase folder); | 193 | public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder); |
190 | 194 | ||
191 | /// <summary> | 195 | /// <summary> |
192 | /// Does the given user have an inventory structure? | 196 | /// Does the given user have an inventory structure? |
@@ -202,5 +206,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
202 | /// <returns></returns> | 206 | /// <returns></returns> |
203 | public abstract List<InventoryItemBase> GetActiveGestures(UUID userId); | 207 | public abstract List<InventoryItemBase> GetActiveGestures(UUID userId); |
204 | 208 | ||
209 | public abstract int GetAssetPermissions(UUID userID, UUID assetID); | ||
205 | } | 210 | } |
206 | } | 211 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 62b9bed..fd12a57 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -263,6 +263,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
263 | folders[(AssetType)folder.Type] = folder; | 263 | folders[(AssetType)folder.Type] = folder; |
264 | } | 264 | } |
265 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: System folders count for {0}: {1}", userID, folders.Count); | 265 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: System folders count for {0}: {1}", userID, folders.Count); |
266 | // Put the root folder there, as type Folder | ||
267 | folders[AssetType.Folder] = root; | ||
266 | return folders; | 268 | return folders; |
267 | } | 269 | } |
268 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder content not found for {0}", userID); | 270 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Root folder content not found for {0}", userID); |
@@ -387,13 +389,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
387 | } | 389 | } |
388 | } | 390 | } |
389 | 391 | ||
390 | public override InventoryItemBase QueryItem(InventoryItemBase item) | 392 | public override InventoryItemBase GetItem(InventoryItemBase item) |
391 | { | 393 | { |
392 | if (item == null) | 394 | if (item == null) |
393 | return null; | 395 | return null; |
394 | 396 | ||
395 | if (IsLocalGridUser(item.Owner)) | 397 | if (IsLocalGridUser(item.Owner)) |
396 | return m_GridService.QueryItem(item); | 398 | return m_GridService.GetItem(item); |
397 | else | 399 | else |
398 | { | 400 | { |
399 | UUID sessionID = GetSessionID(item.Owner); | 401 | UUID sessionID = GetSessionID(item.Owner); |
@@ -402,13 +404,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
402 | } | 404 | } |
403 | } | 405 | } |
404 | 406 | ||
405 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 407 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) |
406 | { | 408 | { |
407 | if (folder == null) | 409 | if (folder == null) |
408 | return null; | 410 | return null; |
409 | 411 | ||
410 | if (IsLocalGridUser(folder.Owner)) | 412 | if (IsLocalGridUser(folder.Owner)) |
411 | return m_GridService.QueryFolder(folder); | 413 | return m_GridService.GetFolder(folder); |
412 | else | 414 | else |
413 | { | 415 | { |
414 | UUID sessionID = GetSessionID(folder.Owner); | 416 | UUID sessionID = GetSessionID(folder.Owner); |
@@ -422,14 +424,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
422 | return false; | 424 | return false; |
423 | } | 425 | } |
424 | 426 | ||
425 | public override InventoryFolderBase GetRootFolder(UUID userID) | 427 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
426 | { | 428 | { |
427 | return null; | 429 | return new List<InventoryItemBase>(); |
428 | } | 430 | } |
429 | 431 | ||
430 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 432 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
431 | { | 433 | { |
432 | return new List<InventoryItemBase>(); | 434 | if (IsLocalGridUser(userID)) |
435 | return m_GridService.GetAssetPermissions(userID, assetID); | ||
436 | else | ||
437 | { | ||
438 | UUID sessionID = GetSessionID(userID); | ||
439 | string uri = GetUserInventoryURI(userID) + "/" + userID.ToString(); | ||
440 | return m_HGService.GetAssetPermissions(uri, assetID, sessionID); | ||
441 | } | ||
433 | } | 442 | } |
434 | 443 | ||
435 | #endregion | 444 | #endregion |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index c16e92e..c8f04a5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs | |||
@@ -91,6 +91,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
91 | Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID); | 91 | Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID); |
92 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}", | 92 | m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}", |
93 | presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count); | 93 | presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count); |
94 | |||
94 | if (folders.Count > 0) | 95 | if (folders.Count > 0) |
95 | lock (m_InventoryCache) | 96 | lock (m_InventoryCache) |
96 | m_InventoryCache.Add(presence.UUID, folders); | 97 | m_InventoryCache.Add(presence.UUID, folders); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 6efe903..2fbc5fe 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -201,8 +201,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
201 | foreach (InventoryFolderBase folder in content.Folders) | 201 | foreach (InventoryFolderBase folder in content.Folders) |
202 | { | 202 | { |
203 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | 203 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) |
204 | { | ||
205 | m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); | ||
204 | folders[(AssetType)folder.Type] = folder; | 206 | folders[(AssetType)folder.Type] = folder; |
207 | } | ||
205 | } | 208 | } |
209 | // Put the root folder there, as type Folder | ||
210 | folders[AssetType.Folder] = root; | ||
211 | m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); | ||
212 | |||
206 | return folders; | 213 | return folders; |
207 | } | 214 | } |
208 | } | 215 | } |
@@ -292,14 +299,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
292 | return m_InventoryService.DeleteItem(item); | 299 | return m_InventoryService.DeleteItem(item); |
293 | } | 300 | } |
294 | 301 | ||
295 | public override InventoryItemBase QueryItem(InventoryItemBase item) | 302 | public override InventoryItemBase GetItem(InventoryItemBase item) |
296 | { | 303 | { |
297 | return m_InventoryService.QueryItem(item); | 304 | return m_InventoryService.GetItem(item); |
298 | } | 305 | } |
299 | 306 | ||
300 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 307 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) |
301 | { | 308 | { |
302 | return m_InventoryService.QueryFolder(folder); | 309 | return m_InventoryService.GetFolder(folder); |
303 | } | 310 | } |
304 | 311 | ||
305 | /// <summary> | 312 | /// <summary> |
@@ -312,19 +319,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
312 | return m_InventoryService.HasInventoryForUser(userID); | 319 | return m_InventoryService.HasInventoryForUser(userID); |
313 | } | 320 | } |
314 | 321 | ||
315 | /// <summary> | 322 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
316 | /// Retrieve the root inventory folder for the given user. | ||
317 | /// </summary> | ||
318 | /// <param name="userID"></param> | ||
319 | /// <returns>null if no root folder was found</returns> | ||
320 | public override InventoryFolderBase GetRootFolder(UUID userID) | ||
321 | { | 323 | { |
322 | return m_InventoryService.GetRootFolder(userID); | 324 | return m_InventoryService.GetActiveGestures(userId); |
323 | } | 325 | } |
324 | 326 | ||
325 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 327 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
326 | { | 328 | { |
327 | return m_InventoryService.GetActiveGestures(userId); | 329 | return m_InventoryService.GetAssetPermissions(userID, assetID); |
328 | } | 330 | } |
329 | #endregion IInventoryService | 331 | #endregion IInventoryService |
330 | } | 332 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index f87aab9..e4bb865 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
273 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); | 273 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); |
274 | } | 274 | } |
275 | 275 | ||
276 | public override InventoryItemBase QueryItem(InventoryItemBase item) | 276 | public override InventoryItemBase GetItem(InventoryItemBase item) |
277 | { | 277 | { |
278 | if (item == null) | 278 | if (item == null) |
279 | return null; | 279 | return null; |
@@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
282 | return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); | 282 | return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); |
283 | } | 283 | } |
284 | 284 | ||
285 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 285 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) |
286 | { | 286 | { |
287 | if (folder == null) | 287 | if (folder == null) |
288 | return null; | 288 | return null; |
@@ -296,16 +296,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
296 | return false; | 296 | return false; |
297 | } | 297 | } |
298 | 298 | ||
299 | public override InventoryFolderBase GetRootFolder(UUID userID) | 299 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
300 | { | 300 | { |
301 | return null; | 301 | return new List<InventoryItemBase>(); |
302 | } | 302 | } |
303 | 303 | ||
304 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 304 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
305 | { | 305 | { |
306 | return new List<InventoryItemBase>(); | 306 | UUID sessionID = GetSessionID(userID); |
307 | return m_RemoteConnector.GetAssetPermissions(userID.ToString(), assetID, sessionID); | ||
307 | } | 308 | } |
308 | 309 | ||
310 | |||
309 | #endregion | 311 | #endregion |
310 | 312 | ||
311 | private UUID GetSessionID(UUID userID) | 313 | private UUID GetSessionID(UUID userID) |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 6db9cbf..9c71b41 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -35,6 +35,7 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Framework.Communications.Cache; | 35 | using OpenSim.Framework.Communications.Cache; |
36 | using OpenSim.Region.Framework.Interfaces; | 36 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 37 | using OpenSim.Region.Framework.Scenes; |
38 | using OpenSim.Services.Interfaces; | ||
38 | 39 | ||
39 | // Temporary fix of wrong GroupPowers constants in OpenMetaverse library | 40 | // Temporary fix of wrong GroupPowers constants in OpenMetaverse library |
40 | enum GroupPowers : long | 41 | enum GroupPowers : long |
@@ -964,19 +965,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
964 | 965 | ||
965 | if (objectID == UUID.Zero) // User inventory | 966 | if (objectID == UUID.Zero) // User inventory |
966 | { | 967 | { |
967 | CachedUserInfo userInfo = | 968 | IInventoryService invService = m_scene.InventoryService; |
968 | scene.CommsManager.UserProfileCacheService.GetUserDetails(user); | 969 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); |
969 | |||
970 | if (userInfo == null) | ||
971 | { | ||
972 | m_log.ErrorFormat("[PERMISSIONS]: Could not find user {0} for edit notecard check", user); | ||
973 | return false; | ||
974 | } | ||
975 | |||
976 | if (userInfo.RootFolder == null) | ||
977 | return false; | ||
978 | |||
979 | InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(notecard); | ||
980 | if (assetRequestItem == null) // Library item | 970 | if (assetRequestItem == null) // Library item |
981 | { | 971 | { |
982 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 972 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |
@@ -1394,19 +1384,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1394 | 1384 | ||
1395 | if (objectID == UUID.Zero) // User inventory | 1385 | if (objectID == UUID.Zero) // User inventory |
1396 | { | 1386 | { |
1397 | CachedUserInfo userInfo = | 1387 | IInventoryService invService = m_scene.InventoryService; |
1398 | scene.CommsManager.UserProfileCacheService.GetUserDetails(user); | 1388 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script)); |
1399 | |||
1400 | if (userInfo == null) | ||
1401 | { | ||
1402 | m_log.ErrorFormat("[PERMISSIONS]: Could not find user {0} for administrator check", user); | ||
1403 | return false; | ||
1404 | } | ||
1405 | |||
1406 | if (userInfo.RootFolder == null) | ||
1407 | return false; | ||
1408 | |||
1409 | InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(script); | ||
1410 | if (assetRequestItem == null) // Library item | 1389 | if (assetRequestItem == null) // Library item |
1411 | { | 1390 | { |
1412 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); | 1391 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); |
@@ -1499,19 +1478,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1499 | 1478 | ||
1500 | if (objectID == UUID.Zero) // User inventory | 1479 | if (objectID == UUID.Zero) // User inventory |
1501 | { | 1480 | { |
1502 | CachedUserInfo userInfo = | 1481 | IInventoryService invService = m_scene.InventoryService; |
1503 | scene.CommsManager.UserProfileCacheService.GetUserDetails(user); | 1482 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); |
1504 | |||
1505 | if (userInfo == null) | ||
1506 | { | ||
1507 | m_log.ErrorFormat("[PERMISSIONS]: Could not find user {0} for view notecard check", user); | ||
1508 | return false; | ||
1509 | } | ||
1510 | |||
1511 | if (userInfo.RootFolder == null) | ||
1512 | return false; | ||
1513 | |||
1514 | InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(notecard); | ||
1515 | if (assetRequestItem == null) // Library item | 1483 | if (assetRequestItem == null) // Library item |
1516 | { | 1484 | { |
1517 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 1485 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |