diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 189 |
1 files changed, 96 insertions, 93 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 0689177..4c6e1c8 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -26,14 +26,12 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using Axiom.Math; | 29 | using System.Collections.Generic; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using libsecondlife.Packets; | 31 | using libsecondlife.Packets; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Framework.Communications.Cache; | 33 | using OpenSim.Framework.Communications.Cache; |
34 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
35 | using OpenSim.Region.Physics.Manager; | ||
36 | using System.Collections.Generic; | ||
37 | 35 | ||
38 | namespace OpenSim.Region.Environment.Scenes | 36 | namespace OpenSim.Region.Environment.Scenes |
39 | { | 37 | { |
@@ -41,7 +39,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
41 | { | 39 | { |
42 | //split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete | 40 | //split these method into this partial as a lot of these (hopefully) are only temporary and won't be needed once Caps is more complete |
43 | // or at least some of they can be moved somewhere else | 41 | // or at least some of they can be moved somewhere else |
44 | 42 | ||
45 | /// <summary> | 43 | /// <summary> |
46 | /// Add an inventory item to an avatar's inventory. | 44 | /// Add an inventory item to an avatar's inventory. |
47 | /// </summary> | 45 | /// </summary> |
@@ -57,7 +55,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
57 | remoteClient.SendInventoryItemCreateUpdate(item); | 55 | remoteClient.SendInventoryItemCreateUpdate(item); |
58 | } | 56 | } |
59 | } | 57 | } |
60 | 58 | ||
61 | /// <summary> | 59 | /// <summary> |
62 | /// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see> | 60 | /// <see>AddInventoryItem(LLUUID, InventoryItemBase)</see> |
63 | /// </summary> | 61 | /// </summary> |
@@ -71,10 +69,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
71 | if (!TryGetAvatar(avatarId, out avatar)) | 69 | if (!TryGetAvatar(avatarId, out avatar)) |
72 | { | 70 | { |
73 | MainLog.Instance.Error( | 71 | MainLog.Instance.Error( |
74 | "AGENTINVENTORY", "Could not find avatar {0} to add inventory item", avatarId); | 72 | "AGENTINVENTORY", "Could not find avatar {0} to add inventory item", avatarId); |
75 | return; | 73 | return; |
76 | } | 74 | } |
77 | 75 | ||
78 | AddInventoryItem(avatar.ControllingClient, item); | 76 | AddInventoryItem(avatar.ControllingClient, item); |
79 | } | 77 | } |
80 | 78 | ||
@@ -95,7 +93,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
95 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | 93 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); |
96 | if (item != null) | 94 | if (item != null) |
97 | { | 95 | { |
98 | AssetBase asset = CreateAsset(item.inventoryName, item.inventoryDescription, (sbyte) item.invType, (sbyte) item.assetType, data); | 96 | AssetBase asset = |
97 | CreateAsset(item.inventoryName, item.inventoryDescription, (sbyte) item.invType, | ||
98 | (sbyte) item.assetType, data); | ||
99 | AssetCache.AddAsset(asset); | 99 | AssetCache.AddAsset(asset); |
100 | 100 | ||
101 | item.assetID = asset.FullID; | 101 | item.assetID = asset.FullID; |
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
117 | } | 117 | } |
118 | return LLUUID.Zero; | 118 | return LLUUID.Zero; |
119 | } | 119 | } |
120 | 120 | ||
121 | /// <summary> | 121 | /// <summary> |
122 | /// <see>CapsUpdatedInventoryItemAsset(IClientAPI, LLUUID, byte[])</see> | 122 | /// <see>CapsUpdatedInventoryItemAsset(IClientAPI, LLUUID, byte[])</see> |
123 | /// </summary> | 123 | /// </summary> |
@@ -132,14 +132,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
132 | else | 132 | else |
133 | { | 133 | { |
134 | MainLog.Instance.Error( | 134 | MainLog.Instance.Error( |
135 | "AGENTINVENTORY", | 135 | "AGENTINVENTORY", |
136 | "Avatar {0} cannot be found to update its inventory item asset", | 136 | "Avatar {0} cannot be found to update its inventory item asset", |
137 | avatarId); | 137 | avatarId); |
138 | } | 138 | } |
139 | 139 | ||
140 | return LLUUID.Zero; | 140 | return LLUUID.Zero; |
141 | } | 141 | } |
142 | 142 | ||
143 | /// <summary> | 143 | /// <summary> |
144 | /// Capability originating call to update the asset of a script in a prim's (task's) inventory | 144 | /// Capability originating call to update the asset of a script in a prim's (task's) inventory |
145 | /// </summary> | 145 | /// </summary> |
@@ -149,17 +149,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
149 | /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> | 149 | /// <param name="isScriptRunning">Indicates whether the script to update is currently running</param> |
150 | /// <param name="data"></param> | 150 | /// <param name="data"></param> |
151 | /// <returns>Asset LLUID created</returns> | 151 | /// <returns>Asset LLUID created</returns> |
152 | public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId, | 152 | public void CapsUpdateTaskInventoryScriptAsset(IClientAPI remoteClient, LLUUID itemId, |
153 | LLUUID primId, bool isScriptRunning, byte[] data) | 153 | LLUUID primId, bool isScriptRunning, byte[] data) |
154 | { | 154 | { |
155 | // TODO Not currently doing anything with the isScriptRunning bool | 155 | // TODO Not currently doing anything with the isScriptRunning bool |
156 | 156 | ||
157 | MainLog.Instance.Verbose( | 157 | MainLog.Instance.Verbose( |
158 | "PRIMINVENTORY", | 158 | "PRIMINVENTORY", |
159 | "Prim inventory script save functionality not yet implemented." | 159 | "Prim inventory script save functionality not yet implemented." |
160 | + " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}", | 160 | + " remoteClient: {0}, itemID: {1}, primID: {2}, isScriptRunning: {3}", |
161 | remoteClient, itemId, primId, isScriptRunning); | 161 | remoteClient, itemId, primId, isScriptRunning); |
162 | 162 | ||
163 | // TODO | 163 | // TODO |
164 | // Retrieve client LLUID | 164 | // Retrieve client LLUID |
165 | // Retrieve sog containing primID | 165 | // Retrieve sog containing primID |
@@ -170,13 +170,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
170 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) | 170 | // Trigger rerunning of script (use TriggerRezScript event, see RezScript) |
171 | // return new asset id | 171 | // return new asset id |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see> | 175 | /// <see>CapsUpdateTaskInventoryScriptAsset(IClientAPI, LLUUID, LLUUID, bool, byte[])</see> |
176 | /// </summary> | 176 | /// </summary> |
177 | private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId, | 177 | private void CapsUpdateTaskInventoryScriptAsset(LLUUID avatarId, LLUUID itemId, |
178 | LLUUID primId, bool isScriptRunning, byte[] data) | 178 | LLUUID primId, bool isScriptRunning, byte[] data) |
179 | { | 179 | { |
180 | ScenePresence avatar; | 180 | ScenePresence avatar; |
181 | 181 | ||
182 | if (TryGetAvatar(avatarId, out avatar)) | 182 | if (TryGetAvatar(avatarId, out avatar)) |
@@ -187,10 +187,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
187 | else | 187 | else |
188 | { | 188 | { |
189 | MainLog.Instance.Error( | 189 | MainLog.Instance.Error( |
190 | "PRIMINVENTORY", | 190 | "PRIMINVENTORY", |
191 | "Avatar {0} cannot be found to update its prim item asset", | 191 | "Avatar {0} cannot be found to update its prim item asset", |
192 | avatarId); | 192 | avatarId); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | 195 | ||
196 | /// <summary> | 196 | /// <summary> |
@@ -204,74 +204,75 @@ namespace OpenSim.Region.Environment.Scenes | |||
204 | /// <param name="name">The name of the updated item</param> | 204 | /// <param name="name">The name of the updated item</param> |
205 | /// <param name="description">The description of the updated item</param> | 205 | /// <param name="description">The description of the updated item</param> |
206 | /// <param name="nextOwnerMask">The permissions of the updated item</param> | 206 | /// <param name="nextOwnerMask">The permissions of the updated item</param> |
207 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, | 207 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, |
208 | LLUUID itemID, string name, string description, | 208 | LLUUID itemID, string name, string description, |
209 | uint nextOwnerMask) | 209 | uint nextOwnerMask) |
210 | { | 210 | { |
211 | CachedUserInfo userInfo | 211 | CachedUserInfo userInfo |
212 | = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | 212 | = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); |
213 | 213 | ||
214 | if (userInfo != null && userInfo.RootFolder != null) | 214 | if (userInfo != null && userInfo.RootFolder != null) |
215 | { | 215 | { |
216 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); | 216 | InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); |
217 | if (item != null) | 217 | if (item != null) |
218 | { | 218 | { |
219 | if (LLUUID.Zero == transactionID) | 219 | if (LLUUID.Zero == transactionID) |
220 | { | 220 | { |
221 | item.inventoryName = name; | 221 | item.inventoryName = name; |
222 | item.inventoryDescription = description; | 222 | item.inventoryDescription = description; |
223 | item.inventoryNextPermissions = nextOwnerMask; | 223 | item.inventoryNextPermissions = nextOwnerMask; |
224 | 224 | ||
225 | userInfo.UpdateItem(remoteClient.AgentId, item); | 225 | userInfo.UpdateItem(remoteClient.AgentId, item); |
226 | } | 226 | } |
227 | else | 227 | else |
228 | { | 228 | { |
229 | AgentAssetTransactions transactions | 229 | AgentAssetTransactions transactions |
230 | = CommsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId); | 230 | = CommsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId); |
231 | 231 | ||
232 | if (transactions != null) | 232 | if (transactions != null) |
233 | { | 233 | { |
234 | LLUUID assetID = libsecondlife.LLUUID.Combine(transactionID, remoteClient.SecureSessionId); | 234 | LLUUID assetID = LLUUID.Combine(transactionID, remoteClient.SecureSessionId); |
235 | AssetBase asset | 235 | AssetBase asset |
236 | = AssetCache.GetAsset( | 236 | = AssetCache.GetAsset( |
237 | assetID, (item.assetType == (int)AssetType.Texture ? true : false)); | 237 | assetID, (item.assetType == (int) AssetType.Texture ? true : false)); |
238 | 238 | ||
239 | if (asset == null) | 239 | if (asset == null) |
240 | { | 240 | { |
241 | asset = transactions.GetTransactionAsset(transactionID); | 241 | asset = transactions.GetTransactionAsset(transactionID); |
242 | } | 242 | } |
243 | 243 | ||
244 | if (asset != null && asset.FullID == assetID) | 244 | if (asset != null && asset.FullID == assetID) |
245 | { | 245 | { |
246 | asset.Name = item.inventoryName; | 246 | asset.Name = item.inventoryName; |
247 | asset.Description = item.inventoryDescription; | 247 | asset.Description = item.inventoryDescription; |
248 | asset.InvType = (sbyte) item.invType; | 248 | asset.InvType = (sbyte) item.invType; |
249 | asset.Type = (sbyte) item.assetType; | 249 | asset.Type = (sbyte) item.assetType; |
250 | item.assetID = asset.FullID; | 250 | item.assetID = asset.FullID; |
251 | 251 | ||
252 | AssetCache.AddAsset(asset); | 252 | AssetCache.AddAsset(asset); |
253 | } | 253 | } |
254 | 254 | ||
255 | userInfo.UpdateItem(remoteClient.AgentId, item); | 255 | userInfo.UpdateItem(remoteClient.AgentId, item); |
256 | } | 256 | } |
257 | } | 257 | } |
258 | } | 258 | } |
259 | else | 259 | else |
260 | { | 260 | { |
261 | MainLog.Instance.Warn( | 261 | MainLog.Instance.Warn( |
262 | "AGENTINVENTORY", | 262 | "AGENTINVENTORY", |
263 | "Item ID " + itemID + " not found for an inventory item update."); | 263 | "Item ID " + itemID + " not found for an inventory item update."); |
264 | } | 264 | } |
265 | } | 265 | } |
266 | else | 266 | else |
267 | { | 267 | { |
268 | MainLog.Instance.Warn( | 268 | MainLog.Instance.Warn( |
269 | "AGENTINVENTORY", | 269 | "AGENTINVENTORY", |
270 | "Agent ID " + remoteClient.AgentId + " not found for an inventory item update."); | 270 | "Agent ID " + remoteClient.AgentId + " not found for an inventory item update."); |
271 | } | 271 | } |
272 | } | 272 | } |
273 | 273 | ||
274 | public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, LLUUID newFolderID, string newName) | 274 | public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, |
275 | LLUUID newFolderID, string newName) | ||
275 | { | 276 | { |
276 | InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(oldItemID); | 277 | InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(oldItemID); |
277 | if (item == null) | 278 | if (item == null) |
@@ -308,7 +309,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
308 | } | 309 | } |
309 | 310 | ||
310 | asset.Name = (newName.Length == 0) ? item.inventoryName : newName; | 311 | asset.Name = (newName.Length == 0) ? item.inventoryName : newName; |
311 | 312 | ||
312 | // TODO: preserve current permissions? | 313 | // TODO: preserve current permissions? |
313 | CreateNewInventoryItem(remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions); | 314 | CreateNewInventoryItem(remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions); |
314 | } | 315 | } |
@@ -325,12 +326,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
325 | return asset; | 326 | return asset; |
326 | } | 327 | } |
327 | 328 | ||
328 | public void MoveInventoryItem(IClientAPI remoteClient,LLUUID folderID, LLUUID itemID, int length, string newName) | 329 | public void MoveInventoryItem(IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length, |
330 | string newName) | ||
329 | { | 331 | { |
330 | MainLog.Instance.Verbose( | 332 | MainLog.Instance.Verbose( |
331 | "AGENTINVENTORY", | 333 | "AGENTINVENTORY", |
332 | "Moving item for " + remoteClient.AgentId.ToString()); | 334 | "Moving item for " + remoteClient.AgentId.ToString()); |
333 | 335 | ||
334 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | 336 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); |
335 | if (userInfo == null) | 337 | if (userInfo == null) |
336 | { | 338 | { |
@@ -364,8 +366,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
364 | MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder"); | 366 | MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder"); |
365 | return; | 367 | return; |
366 | } | 368 | } |
367 | |||
368 | |||
369 | } | 369 | } |
370 | 370 | ||
371 | private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, | 371 | private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, |
@@ -406,7 +406,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
406 | /// <param name="wearableType"></param> | 406 | /// <param name="wearableType"></param> |
407 | /// <param name="nextOwnerMask"></param> | 407 | /// <param name="nextOwnerMask"></param> |
408 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, | 408 | public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, |
409 | uint callbackID, string description, string name, sbyte invType, sbyte assetType, | 409 | uint callbackID, string description, string name, sbyte invType, |
410 | sbyte assetType, | ||
410 | byte wearableType, uint nextOwnerMask) | 411 | byte wearableType, uint nextOwnerMask) |
411 | { | 412 | { |
412 | if (transActionID == LLUUID.Zero) | 413 | if (transActionID == LLUUID.Zero) |
@@ -437,8 +438,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
437 | { | 438 | { |
438 | if (ent is SceneObjectGroup) | 439 | if (ent is SceneObjectGroup) |
439 | { | 440 | { |
440 | if (((SceneObjectGroup)ent).HasChildPrim(localID)) | 441 | if (((SceneObjectGroup) ent).HasChildPrim(localID)) |
441 | return (SceneObjectGroup)ent; | 442 | return (SceneObjectGroup) ent; |
442 | } | 443 | } |
443 | } | 444 | } |
444 | return null; | 445 | return null; |
@@ -491,13 +492,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
491 | else | 492 | else |
492 | { | 493 | { |
493 | MainLog.Instance.Warn( | 494 | MainLog.Instance.Warn( |
494 | "PRIMINVENTORY", | 495 | "PRIMINVENTORY", |
495 | "Removal of item {0} requested of prim {1} but this prim does not exist", | 496 | "Removal of item {0} requested of prim {1} but this prim does not exist", |
496 | itemID, | 497 | itemID, |
497 | localID); | 498 | localID); |
498 | } | 499 | } |
499 | } | 500 | } |
500 | 501 | ||
501 | /// <summary> | 502 | /// <summary> |
502 | /// Update an item in a prim (task) inventory. | 503 | /// Update an item in a prim (task) inventory. |
503 | /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> | 504 | /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> |
@@ -506,7 +507,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
506 | /// <param name="itemID"></param> | 507 | /// <param name="itemID"></param> |
507 | /// <param name="folderID"></param> | 508 | /// <param name="folderID"></param> |
508 | /// <param name="primLocalID"></param> | 509 | /// <param name="primLocalID"></param> |
509 | public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, | 510 | public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID, |
510 | uint primLocalID) | 511 | uint primLocalID) |
511 | { | 512 | { |
512 | SceneObjectGroup group = GetGroupByPrim(primLocalID); | 513 | SceneObjectGroup group = GetGroupByPrim(primLocalID); |
@@ -515,17 +516,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
515 | // TODO Retrieve itemID from client's inventory to pass on | 516 | // TODO Retrieve itemID from client's inventory to pass on |
516 | //group.AddInventoryItem(rmoteClient, primLocalID, null); | 517 | //group.AddInventoryItem(rmoteClient, primLocalID, null); |
517 | MainLog.Instance.Verbose( | 518 | MainLog.Instance.Verbose( |
518 | "PRIMINVENTORY", | 519 | "PRIMINVENTORY", |
519 | "UpdateTaskInventory called with script {0}, folder {1}, primLocalID {2}, user {3}", | 520 | "UpdateTaskInventory called with script {0}, folder {1}, primLocalID {2}, user {3}", |
520 | itemID, folderID, primLocalID, remoteClient.Name); | 521 | itemID, folderID, primLocalID, remoteClient.Name); |
521 | } | 522 | } |
522 | else | 523 | else |
523 | { | 524 | { |
524 | MainLog.Instance.Warn( | 525 | MainLog.Instance.Warn( |
525 | "PRIMINVENTORY", | 526 | "PRIMINVENTORY", |
526 | "Update with script {0} requested of prim {1} for {2} but this prim does not exist", | 527 | "Update with script {0} requested of prim {1} for {2} but this prim does not exist", |
527 | itemID, primLocalID, remoteClient.Name); | 528 | itemID, primLocalID, remoteClient.Name); |
528 | } | 529 | } |
529 | } | 530 | } |
530 | 531 | ||
531 | /// <summary> | 532 | /// <summary> |
@@ -551,7 +552,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
551 | { | 552 | { |
552 | isTexture = true; | 553 | isTexture = true; |
553 | } | 554 | } |
554 | 555 | ||
555 | AssetBase rezAsset = AssetCache.GetAsset(item.assetID, isTexture); | 556 | AssetBase rezAsset = AssetCache.GetAsset(item.assetID, isTexture); |
556 | 557 | ||
557 | if (rezAsset != null) | 558 | if (rezAsset != null) |
@@ -569,18 +570,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
569 | // TODO: do we care about the value of this bool? | 570 | // TODO: do we care about the value of this bool? |
570 | group.AddInventoryItem(remoteClient, localID, item, copyID); | 571 | group.AddInventoryItem(remoteClient, localID, item, copyID); |
571 | group.GetProperites(remoteClient); | 572 | group.GetProperites(remoteClient); |
572 | 573 | ||
573 | MainLog.Instance.Verbose( | 574 | MainLog.Instance.Verbose( |
574 | "PRIMINVENTORY", | 575 | "PRIMINVENTORY", |
575 | "Rezzed script {0} (asset {1}) into prim {2} for user {3}", | 576 | "Rezzed script {0} (asset {1}) into prim {2} for user {3}", |
576 | item.inventoryName, rezAsset.FullID, localID, remoteClient.Name); | 577 | item.inventoryName, rezAsset.FullID, localID, remoteClient.Name); |
577 | } | 578 | } |
578 | else | 579 | else |
579 | { | 580 | { |
580 | MainLog.Instance.Warn( | 581 | MainLog.Instance.Warn( |
581 | "PRIMINVENTORY", | 582 | "PRIMINVENTORY", |
582 | "Could not rez script {0} into prim {1} for user {2}" | 583 | "Could not rez script {0} into prim {1} for user {2}" |
583 | + " because the prim could not be found in the region!", | 584 | + " because the prim could not be found in the region!", |
584 | item.inventoryName, localID, remoteClient.Name); | 585 | item.inventoryName, localID, remoteClient.Name); |
585 | } | 586 | } |
586 | } | 587 | } |
@@ -589,7 +590,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
589 | MainLog.Instance.Warn( | 590 | MainLog.Instance.Warn( |
590 | "PRIMINVENTORY", | 591 | "PRIMINVENTORY", |
591 | "Could not rez script {0} into prim {1} for user {2}" | 592 | "Could not rez script {0} into prim {1} for user {2}" |
592 | + " because the item asset {3} could not be found!", | 593 | + " because the item asset {3} could not be found!", |
593 | item.inventoryName, localID, item.assetID, remoteClient.Name); | 594 | item.inventoryName, localID, item.assetID, remoteClient.Name); |
594 | } | 595 | } |
595 | } | 596 | } |
@@ -638,7 +639,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
638 | if (PermissionsMngr.CanDeRezObject(remoteClient.AgentId, ((SceneObjectGroup) selectedEnt).UUID)) | 639 | if (PermissionsMngr.CanDeRezObject(remoteClient.AgentId, ((SceneObjectGroup) selectedEnt).UUID)) |
639 | { | 640 | { |
640 | string sceneObjectXml = ((SceneObjectGroup) selectedEnt).ToXmlString(); | 641 | string sceneObjectXml = ((SceneObjectGroup) selectedEnt).ToXmlString(); |
641 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | 642 | CachedUserInfo userInfo = |
643 | CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | ||
642 | if (userInfo != null) | 644 | if (userInfo != null) |
643 | { | 645 | { |
644 | AssetBase asset = CreateAsset( | 646 | AssetBase asset = CreateAsset( |
@@ -661,9 +663,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
661 | item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; | 663 | item.parentFolderID = DeRezPacket.AgentBlock.DestinationID; |
662 | item.inventoryCurrentPermissions = 2147483647; | 664 | item.inventoryCurrentPermissions = 2147483647; |
663 | item.inventoryNextPermissions = 2147483647; | 665 | item.inventoryNextPermissions = 2147483647; |
664 | item.inventoryEveryOnePermissions = ((SceneObjectGroup)selectedEnt).RootPart.EveryoneMask; | 666 | item.inventoryEveryOnePermissions = |
665 | item.inventoryBasePermissions = ((SceneObjectGroup)selectedEnt).RootPart.BaseMask; | 667 | ((SceneObjectGroup) selectedEnt).RootPart.EveryoneMask; |
666 | item.inventoryCurrentPermissions = ((SceneObjectGroup)selectedEnt).RootPart.OwnerMask; | 668 | item.inventoryBasePermissions = ((SceneObjectGroup) selectedEnt).RootPart.BaseMask; |
669 | item.inventoryCurrentPermissions = ((SceneObjectGroup) selectedEnt).RootPart.OwnerMask; | ||
667 | 670 | ||
668 | userInfo.AddItem(remoteClient.AgentId, item); | 671 | userInfo.AddItem(remoteClient.AgentId, item); |
669 | remoteClient.SendInventoryItemCreateUpdate(item); | 672 | remoteClient.SendInventoryItemCreateUpdate(item); |
@@ -730,20 +733,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
730 | //bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0)&& m_physicalPrim); | 733 | //bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0)&& m_physicalPrim); |
731 | //if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) | 734 | //if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) |
732 | //{ | 735 | //{ |
733 | //PrimitiveBaseShape pbs = rootPart.Shape; | 736 | //PrimitiveBaseShape pbs = rootPart.Shape; |
734 | //rootPart.PhysActor = PhysicsScene.AddPrimShape( | 737 | //rootPart.PhysActor = PhysicsScene.AddPrimShape( |
735 | //rootPart.Name, | 738 | //rootPart.Name, |
736 | //pbs, | 739 | //pbs, |
737 | //new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, | 740 | //new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, |
738 | // rootPart.AbsolutePosition.Z), | 741 | // rootPart.AbsolutePosition.Z), |
739 | //new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), | 742 | //new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), |
740 | //new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, | 743 | //new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, |
741 | // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); | 744 | // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); |
742 | 745 | ||
743 | // rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); | 746 | // rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); |
744 | 747 | ||
745 | // } | 748 | // } |
746 | rootPart.ScheduleFullUpdate(); | 749 | rootPart.ScheduleFullUpdate(); |
747 | } | 750 | } |
748 | } | 751 | } |
749 | } | 752 | } \ No newline at end of file |