aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 16:35:00 +0000
committerAdam Frisby2008-05-01 16:35:00 +0000
commit13526097f24b7a8ad63b1d482c44b44397fa055f (patch)
tree7a82c20ed7c63e2aea5ad3863325e37f64e1cbea /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parent* Breaking all the code, breaking all the code..! (diff)
downloadopensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.zip
opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.gz
opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.bz2
opensim-SC_OLD-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.xz
* Spring cleaning on Region.Environment.
* Converted a large number of read-only fields to be actually, readonly. * Reformatted code sections. * Removed redundant code.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs316
1 files changed, 157 insertions, 159 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 6bd5d1a..1e6ebf9 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Environment.Scenes
40{ 40{
41 public partial class Scene 41 public partial class Scene
42 { 42 {
43 private static readonly ILog m_log 43 private static readonly ILog m_log
44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 45
46 /// <summary> 46 /// <summary>
@@ -49,11 +49,11 @@ namespace OpenSim.Region.Environment.Scenes
49 public void StartScripts() 49 public void StartScripts()
50 { 50 {
51 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); 51 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
52 52
53 foreach (SceneObjectGroup group in Entities.Values) 53 foreach (SceneObjectGroup group in Entities.Values)
54 { 54 {
55 group.StartScripts(); 55 group.StartScripts();
56 } 56 }
57 } 57 }
58 58
59 /// <summary> 59 /// <summary>
@@ -64,9 +64,9 @@ namespace OpenSim.Region.Environment.Scenes
64 /// in which the item is to be placed.</param> 64 /// in which the item is to be placed.</param>
65 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) 65 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
66 { 66 {
67 CachedUserInfo userInfo 67 CachedUserInfo userInfo
68 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 68 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
69 69
70 if (userInfo != null) 70 if (userInfo != null)
71 { 71 {
72 userInfo.AddItem(remoteClient.AgentId, item); 72 userInfo.AddItem(remoteClient.AgentId, item);
@@ -88,9 +88,9 @@ namespace OpenSim.Region.Environment.Scenes
88 m_log.ErrorFormat( 88 m_log.ErrorFormat(
89 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}", 89 "[AGENT INVENTORY]: Agent {0} {1} was not found for add of item {2} {3}",
90 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID); 90 remoteClient.Name, remoteClient.AgentId, item.Name, item.ID);
91 91
92 return; 92 return;
93 } 93 }
94 } 94 }
95 95
96 /// <summary> 96 /// <summary>
@@ -190,7 +190,7 @@ namespace OpenSim.Region.Environment.Scenes
190 { 190 {
191 // Retrieve group 191 // Retrieve group
192 SceneObjectPart part = GetSceneObjectPart(primId); 192 SceneObjectPart part = GetSceneObjectPart(primId);
193 SceneObjectGroup group = part.ParentGroup; 193 SceneObjectGroup group = part.ParentGroup;
194 if (null == group) 194 if (null == group)
195 { 195 {
196 m_log.ErrorFormat( 196 m_log.ErrorFormat(
@@ -200,30 +200,30 @@ namespace OpenSim.Region.Environment.Scenes
200 200
201 return; 201 return;
202 } 202 }
203 203
204 // Retrieve item 204 // Retrieve item
205 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); 205 TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId);
206 if (null == item) 206 if (null == item)
207 { 207 {
208 return; 208 return;
209 } 209 }
210 210
211 // Create new asset 211 // Create new asset
212 // XXX Hardcoding the numbers is a temporary measure - need an enumeration for this 212 // XXX Hardcoding the numbers is a temporary measure - need an enumeration for this
213 // There may well be one in libsecondlife 213 // There may well be one in libsecondlife
214 AssetBase asset = CreateAsset(item.Name, item.Description, 10, 10, data); 214 AssetBase asset = CreateAsset(item.Name, item.Description, 10, 10, data);
215 AssetCache.AddAsset(asset); 215 AssetCache.AddAsset(asset);
216 216
217 // Update item with new asset 217 // Update item with new asset
218 item.AssetID = asset.FullID; 218 item.AssetID = asset.FullID;
219 group.UpdateInventoryItem(item); 219 group.UpdateInventoryItem(item);
220 group.GetProperties(remoteClient); 220 group.GetProperties(remoteClient);
221 221
222 // Trigger rerunning of script (use TriggerRezScript event, see RezScript) 222 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
223 if (isScriptRunning) 223 if (isScriptRunning)
224 { 224 {
225 group.StopScript(part.LocalId, item.ItemID); 225 group.StopScript(part.LocalId, item.ItemID);
226 group.StartScript(part.LocalId, item.ItemID); 226 group.StartScript(part.LocalId, item.ItemID);
227 } 227 }
228 } 228 }
229 229
@@ -272,7 +272,7 @@ namespace OpenSim.Region.Environment.Scenes
272 if (userInfo != null && userInfo.RootFolder != null) 272 if (userInfo != null && userInfo.RootFolder != null)
273 { 273 {
274 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 274 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
275 275
276 if (item != null) 276 if (item != null)
277 { 277 {
278 if (LLUUID.Zero == transactionID) 278 if (LLUUID.Zero == transactionID)
@@ -298,11 +298,11 @@ namespace OpenSim.Region.Environment.Scenes
298 } 298 }
299 else 299 else
300 { 300 {
301 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 301 IAgentAssetTransactions agentTransactions = RequestModuleInterface<IAgentAssetTransactions>();
302 if (agentTransactions != null) 302 if (agentTransactions != null)
303 { 303 {
304 agentTransactions.HandleItemUpdateFromTransaction( 304 agentTransactions.HandleItemUpdateFromTransaction(
305 remoteClient, transactionID, item); 305 remoteClient, transactionID, item);
306 } 306 }
307 } 307 }
308 } 308 }
@@ -318,7 +318,7 @@ namespace OpenSim.Region.Environment.Scenes
318 "[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update."); 318 "[AGENT INVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
319 } 319 }
320 } 320 }
321 321
322 /// <summary> 322 /// <summary>
323 /// Give an inventory item from one avatar to another 323 /// Give an inventory item from one avatar to another
324 /// </summary> 324 /// </summary>
@@ -328,13 +328,13 @@ namespace OpenSim.Region.Environment.Scenes
328 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId) 328 public void GiveInventoryItem(IClientAPI recipientClient, LLUUID senderId, LLUUID itemId)
329 { 329 {
330 // Retrieve the item from the sender 330 // Retrieve the item from the sender
331 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); 331 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId);
332 332
333 if (senderUserInfo == null) 333 if (senderUserInfo == null)
334 { 334 {
335 m_log.ErrorFormat( 335 m_log.ErrorFormat(
336 "[AGENT INVENTORY]: Failed to find sending user {0} for item {1}", senderId, itemId); 336 "[AGENT INVENTORY]: Failed to find sending user {0} for item {1}", senderId, itemId);
337 337
338 return; 338 return;
339 } 339 }
340 340
@@ -342,11 +342,11 @@ namespace OpenSim.Region.Environment.Scenes
342 { 342 {
343 InventoryItemBase item = senderUserInfo.RootFolder.HasItem(itemId); 343 InventoryItemBase item = senderUserInfo.RootFolder.HasItem(itemId);
344 if (item != null) 344 if (item != null)
345 { 345 {
346 // TODO get recipient's root folder 346 // TODO get recipient's root folder
347 CachedUserInfo recipientUserInfo 347 CachedUserInfo recipientUserInfo
348 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId); 348 = CommsManager.UserProfileCacheService.GetUserDetails(recipientClient.AgentId);
349 349
350 if (recipientUserInfo != null) 350 if (recipientUserInfo != null)
351 { 351 {
352 // Insert a copy of the item into the recipient 352 // Insert a copy of the item into the recipient
@@ -373,15 +373,15 @@ namespace OpenSim.Region.Environment.Scenes
373 itemCopy.SaleType = item.SaleType; 373 itemCopy.SaleType = item.SaleType;
374 374
375 recipientUserInfo.AddItem(recipientClient.AgentId, itemCopy); 375 recipientUserInfo.AddItem(recipientClient.AgentId, itemCopy);
376 376
377 // Let the recipient client know about this new item 377 // Let the recipient client know about this new item
378 recipientClient.SendBulkUpdateInventory(itemCopy); 378 recipientClient.SendBulkUpdateInventory(itemCopy);
379 } 379 }
380 else 380 else
381 { 381 {
382 m_log.ErrorFormat( 382 m_log.ErrorFormat(
383 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}", 383 "[AGENT INVENTORY]: Could not find userinfo for recipient user {0}, {1} of item {2}, {3} from {4}",
384 recipientClient.Name, recipientClient.AgentId, item.Name, 384 recipientClient.Name, recipientClient.AgentId, item.Name,
385 item.ID, senderId); 385 item.ID, senderId);
386 } 386 }
387 } 387 }
@@ -389,15 +389,15 @@ namespace OpenSim.Region.Environment.Scenes
389 { 389 {
390 m_log.ErrorFormat( 390 m_log.ErrorFormat(
391 "[AGENT INVENTORY]: Failed to find item {0} to give to {1}", itemId, senderId); 391 "[AGENT INVENTORY]: Failed to find item {0} to give to {1}", itemId, senderId);
392 392
393 return; 393 return;
394 } 394 }
395 } 395 }
396 else 396 else
397 { 397 {
398 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); 398 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId + ", no root folder");
399 return; 399 return;
400 } 400 }
401 } 401 }
402 402
403 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID, 403 public void CopyInventoryItem(IClientAPI remoteClient, uint callbackID, LLUUID oldAgentID, LLUUID oldItemID,
@@ -406,14 +406,14 @@ namespace OpenSim.Region.Environment.Scenes
406 m_log.DebugFormat( 406 m_log.DebugFormat(
407 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}", 407 "[AGENT INVENTORY]: CopyInventoryItem received by {0} with oldAgentID {1}, oldItemID {2}, new FolderID {3}, newName {4}",
408 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName); 408 remoteClient.AgentId, oldAgentID, oldItemID, newFolderID, newName);
409 409
410 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(oldItemID); 410 InventoryItemBase item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(oldItemID);
411 if (item == null) 411 if (item == null)
412 { 412 {
413 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID); 413 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
414 if (userInfo == null) 414 if (userInfo == null)
415 { 415 {
416 m_log.Error("[AGENT INVENTORY]: Failed to find user " + oldAgentID.ToString()); 416 m_log.Error("[AGENT INVENTORY]: Failed to find user " + oldAgentID);
417 return; 417 return;
418 } 418 }
419 419
@@ -422,20 +422,20 @@ namespace OpenSim.Region.Environment.Scenes
422 item = userInfo.RootFolder.HasItem(oldItemID); 422 item = userInfo.RootFolder.HasItem(oldItemID);
423 if (item == null) 423 if (item == null)
424 { 424 {
425 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); 425 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID);
426 return; 426 return;
427 } 427 }
428 } 428 }
429 else 429 else
430 { 430 {
431 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString()); 431 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID);
432 return; 432 return;
433 } 433 }
434 } 434 }
435 435
436 AssetBase asset 436 AssetBase asset
437 = AssetCache.GetAsset( 437 = AssetCache.GetAsset(
438 item.AssetID, (item.AssetType == (int)AssetType.Texture ? true : false)); 438 item.AssetID, (item.AssetType == (int) AssetType.Texture ? true : false));
439 439
440 if (asset != null) 440 if (asset != null)
441 { 441 {
@@ -447,7 +447,7 @@ namespace OpenSim.Region.Environment.Scenes
447 { 447 {
448 m_log.ErrorFormat( 448 m_log.ErrorFormat(
449 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found", 449 "[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
450 item.Name, item.AssetID); 450 item.Name, item.AssetID);
451 } 451 }
452 } 452 }
453 453
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Scenes
472 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 472 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
473 if (userInfo == null) 473 if (userInfo == null)
474 { 474 {
475 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 475 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId);
476 return; 476 return;
477 } 477 }
478 478
@@ -493,13 +493,13 @@ namespace OpenSim.Region.Environment.Scenes
493 } 493 }
494 else 494 else
495 { 495 {
496 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString()); 496 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID);
497 return; 497 return;
498 } 498 }
499 } 499 }
500 else 500 else
501 { 501 {
502 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder"); 502 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID + ", no root folder");
503 return; 503 return;
504 } 504 }
505 } 505 }
@@ -515,9 +515,9 @@ namespace OpenSim.Region.Environment.Scenes
515 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 515 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
516 AssetBase asset, uint nextOwnerMask) 516 AssetBase asset, uint nextOwnerMask)
517 { 517 {
518 CachedUserInfo userInfo 518 CachedUserInfo userInfo
519 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 519 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
520 520
521 if (userInfo != null) 521 if (userInfo != null)
522 { 522 {
523 InventoryItemBase item = new InventoryItemBase(); 523 InventoryItemBase item = new InventoryItemBase();
@@ -539,8 +539,8 @@ namespace OpenSim.Region.Environment.Scenes
539 else 539 else
540 { 540 {
541 m_log.WarnFormat( 541 m_log.WarnFormat(
542 "No user details associated with client {0} uuid {1} in CreateNewInventoryItem!", 542 "No user details associated with client {0} uuid {1} in CreateNewInventoryItem!",
543 remoteClient.Name, remoteClient.AgentId); 543 remoteClient.Name, remoteClient.AgentId);
544 } 544 }
545 } 545 }
546 546
@@ -564,25 +564,25 @@ namespace OpenSim.Region.Environment.Scenes
564 byte wearableType, uint nextOwnerMask) 564 byte wearableType, uint nextOwnerMask)
565 { 565 {
566// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID); 566// m_log.DebugFormat("[AGENT INVENTORY]: Received request to create inventory item {0} in folder {1}", name, folderID);
567 567
568 if (transactionID == LLUUID.Zero) 568 if (transactionID == LLUUID.Zero)
569 { 569 {
570 CachedUserInfo userInfo 570 CachedUserInfo userInfo
571 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 571 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
572 572
573 if (userInfo != null) 573 if (userInfo != null)
574 { 574 {
575 ScenePresence presence; 575 ScenePresence presence;
576 TryGetAvatar(remoteClient.AgentId, out presence); 576 TryGetAvatar(remoteClient.AgentId, out presence);
577 byte[] data = null; 577 byte[] data = null;
578 if(invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum 578 if (invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum
579 { 579 {
580 LLVector3 pos=presence.AbsolutePosition; 580 LLVector3 pos = presence.AbsolutePosition;
581 string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n", 581 string strdata = String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
582 presence.Scene.RegionInfo.RegionID, 582 presence.Scene.RegionInfo.RegionID,
583 pos.X, pos.Y, pos.Z, 583 pos.X, pos.Y, pos.Z,
584 presence.RegionHandle); 584 presence.RegionHandle);
585 data=Encoding.ASCII.GetBytes(strdata); 585 data = Encoding.ASCII.GetBytes(strdata);
586 } 586 }
587 587
588 AssetBase asset = CreateAsset(name, description, invType, assetType, data); 588 AssetBase asset = CreateAsset(name, description, invType, assetType, data);
@@ -593,21 +593,19 @@ namespace OpenSim.Region.Environment.Scenes
593 else 593 else
594 { 594 {
595 m_log.ErrorFormat( 595 m_log.ErrorFormat(
596 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem", 596 "userInfo for agent uuid {0} unexpectedly null in CreateNewInventoryItem",
597 remoteClient.AgentId); 597 remoteClient.AgentId);
598 } 598 }
599 } 599 }
600 else 600 else
601 { 601 {
602 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 602 IAgentAssetTransactions agentTransactions = RequestModuleInterface<IAgentAssetTransactions>();
603 if (agentTransactions != null) 603 if (agentTransactions != null)
604 { 604 {
605 agentTransactions.HandleItemCreationFromTransaction( 605 agentTransactions.HandleItemCreationFromTransaction(
606 remoteClient, transactionID, folderID, callbackID, description, 606 remoteClient, transactionID, folderID, callbackID, description,
607 name, invType, assetType, wearableType, nextOwnerMask); 607 name, invType, assetType, wearableType, nextOwnerMask);
608 } 608 }
609
610
611 } 609 }
612 } 610 }
613 611
@@ -617,7 +615,7 @@ namespace OpenSim.Region.Environment.Scenes
617 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 615 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
618 if (userInfo == null) 616 if (userInfo == null)
619 { 617 {
620 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 618 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId);
621 return; 619 return;
622 } 620 }
623 621
@@ -641,7 +639,7 @@ namespace OpenSim.Region.Environment.Scenes
641 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 639 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
642 if (userInfo == null) 640 if (userInfo == null)
643 { 641 {
644 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString()); 642 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId);
645 return; 643 return;
646 } 644 }
647 645
@@ -677,7 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
677 /// <param name="remoteClient"></param> 675 /// <param name="remoteClient"></param>
678 /// <param name="primLocalID"></param> 676 /// <param name="primLocalID"></param>
679 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) 677 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
680 { 678 {
681 SceneObjectGroup group = GetGroupByPrim(primLocalID); 679 SceneObjectGroup group = GetGroupByPrim(primLocalID);
682 if (group != null) 680 if (group != null)
683 { 681 {
@@ -725,7 +723,7 @@ namespace OpenSim.Region.Environment.Scenes
725 localID); 723 localID);
726 } 724 }
727 } 725 }
728 726
729 /// <summary> 727 /// <summary>
730 /// Move the given item in the given prim to a folder in the client's inventory 728 /// Move the given item in the given prim to a folder in the client's inventory
731 /// </summary> 729 /// </summary>
@@ -736,43 +734,43 @@ namespace OpenSim.Region.Environment.Scenes
736 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 734 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
737 { 735 {
738 SceneObjectGroup group = GetGroupByPrim(primLocalId); 736 SceneObjectGroup group = GetGroupByPrim(primLocalId);
739 737
740 if (null == group) 738 if (null == group)
741 { 739 {
742 m_log.WarnFormat( 740 m_log.WarnFormat(
743 "[PRIM INVENTORY]: " + 741 "[PRIM INVENTORY]: " +
744 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found", 742 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found",
745 itemId, primLocalId); 743 itemId, primLocalId);
746 744
747 return; 745 return;
748 } 746 }
749 747
750 TaskInventoryItem taskItem = group.GetInventoryItem(primLocalId, itemId); 748 TaskInventoryItem taskItem = group.GetInventoryItem(primLocalId, itemId);
751 749
752 if (null == taskItem) 750 if (null == taskItem)
753 { 751 {
754 // Console already notified of error in GetInventoryItem 752 // Console already notified of error in GetInventoryItem
755 return; 753 return;
756 } 754 }
757 755
758// bool permission; 756// bool permission;
759// permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId, 757// permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
760// ((SceneObjectGroup) selectedEnt).UUID); 758// ((SceneObjectGroup) selectedEnt).UUID);
761 759
762 // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner 760 // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner
763 // to copy 761 // to copy
764 if (remoteClient.AgentId != taskItem.OwnerID) 762 if (remoteClient.AgentId != taskItem.OwnerID)
765 { 763 {
766 m_log.InfoFormat( 764 m_log.InfoFormat(
767 "[PRIM INVENTORY]: Attempt made by {0} {1} to copy inventory item {2} {3} in prim {4} {5}," 765 "[PRIM INVENTORY]: Attempt made by {0} {1} to copy inventory item {2} {3} in prim {4} {5},"
768 + " but temporarily not allowed pending upstream bugfixes/feature implementation", 766 + " but temporarily not allowed pending upstream bugfixes/feature implementation",
769 remoteClient.Name, remoteClient.AgentId, taskItem.Name, taskItem.ItemID, group.Name, group.UUID); 767 remoteClient.Name, remoteClient.AgentId, taskItem.Name, taskItem.ItemID, group.Name, group.UUID);
770 768
771 return; 769 return;
772 } 770 }
773 771
774 InventoryItemBase agentItem = new InventoryItemBase(); 772 InventoryItemBase agentItem = new InventoryItemBase();
775 773
776 agentItem.ID = LLUUID.Random(); 774 agentItem.ID = LLUUID.Random();
777 agentItem.Creator = taskItem.CreatorID; 775 agentItem.Creator = taskItem.CreatorID;
778 agentItem.Owner = remoteClient.AgentId; 776 agentItem.Owner = remoteClient.AgentId;
@@ -783,8 +781,9 @@ namespace OpenSim.Region.Environment.Scenes
783 agentItem.InvType = taskItem.InvType; 781 agentItem.InvType = taskItem.InvType;
784 agentItem.Folder = folderId; 782 agentItem.Folder = folderId;
785 agentItem.EveryOnePermissions = taskItem.EveryoneMask; 783 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
786 784
787 if (remoteClient.AgentId != taskItem.OwnerID) { 785 if (remoteClient.AgentId != taskItem.OwnerID)
786 {
788 agentItem.BasePermissions = taskItem.NextOwnerMask; 787 agentItem.BasePermissions = taskItem.NextOwnerMask;
789 agentItem.CurrentPermissions = taskItem.NextOwnerMask; 788 agentItem.CurrentPermissions = taskItem.NextOwnerMask;
790 agentItem.NextPermissions = taskItem.NextOwnerMask; 789 agentItem.NextPermissions = taskItem.NextOwnerMask;
@@ -793,9 +792,9 @@ namespace OpenSim.Region.Environment.Scenes
793 { 792 {
794 agentItem.BasePermissions = taskItem.BaseMask; 793 agentItem.BasePermissions = taskItem.BaseMask;
795 agentItem.CurrentPermissions = taskItem.OwnerMask; 794 agentItem.CurrentPermissions = taskItem.OwnerMask;
796 agentItem.NextPermissions = taskItem.NextOwnerMask; 795 agentItem.NextPermissions = taskItem.NextOwnerMask;
797 } 796 }
798 797
799 AddInventoryItem(remoteClient, agentItem); 798 AddInventoryItem(remoteClient, agentItem);
800 } 799 }
801 800
@@ -834,7 +833,7 @@ namespace OpenSim.Region.Environment.Scenes
834 { 833 {
835 group.AddInventoryItem(remoteClient, primLocalID, item, copyID); 834 group.AddInventoryItem(remoteClient, primLocalID, item, copyID);
836 m_log.InfoFormat( 835 m_log.InfoFormat(
837 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 836 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
838 item.Name, primLocalID, remoteClient.Name); 837 item.Name, primLocalID, remoteClient.Name);
839 group.GetProperties(remoteClient); 838 group.GetProperties(remoteClient);
840 } 839 }
@@ -865,22 +864,22 @@ namespace OpenSim.Region.Environment.Scenes
865 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 864 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
866 { 865 {
867 LLUUID copyID = LLUUID.Random(); 866 LLUUID copyID = LLUUID.Random();
868 867
869 if (itemID != LLUUID.Zero) 868 if (itemID != LLUUID.Zero)
870 { 869 {
871 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 870 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
872 871
873 if (userInfo != null && userInfo.RootFolder != null) 872 if (userInfo != null && userInfo.RootFolder != null)
874 { 873 {
875 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 874 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
876 875
877 // Try library 876 // Try library
878 // XXX clumsy, possibly should be one call 877 // XXX clumsy, possibly should be one call
879 if (null == item) 878 if (null == item)
880 { 879 {
881 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID); 880 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID);
882 } 881 }
883 882
884 if (item != null) 883 if (item != null)
885 { 884 {
886 SceneObjectGroup group = GetGroupByPrim(localID); 885 SceneObjectGroup group = GetGroupByPrim(localID);
@@ -889,10 +888,10 @@ namespace OpenSim.Region.Environment.Scenes
889 group.AddInventoryItem(remoteClient, localID, item, copyID); 888 group.AddInventoryItem(remoteClient, localID, item, copyID);
890 group.StartScript(localID, copyID); 889 group.StartScript(localID, copyID);
891 group.GetProperties(remoteClient); 890 group.GetProperties(remoteClient);
892 891
893 // m_log.InfoFormat("[PRIMINVENTORY]: " + 892 // m_log.InfoFormat("[PRIMINVENTORY]: " +
894 // "Rezzed script {0} into prim local ID {1} for user {2}", 893 // "Rezzed script {0} into prim local ID {1} for user {2}",
895 // item.inventoryName, localID, remoteClient.Name); 894 // item.inventoryName, localID, remoteClient.Name);
896 } 895 }
897 else 896 else
898 { 897 {
@@ -911,7 +910,7 @@ namespace OpenSim.Region.Environment.Scenes
911 } 910 }
912 } 911 }
913 } 912 }
914 else // If the itemID is zero then the script has been rezzed directly in an object's inventory 913 else // If the itemID is zero then the script has been rezzed directly in an object's inventory
915 { 914 {
916 // not yet implemented 915 // not yet implemented
917 // TODO Need to get more details from original RezScript packet 916 // TODO Need to get more details from original RezScript packet
@@ -927,7 +926,7 @@ namespace OpenSim.Region.Environment.Scenes
927 /// <param name="packet"></param> 926 /// <param name="packet"></param>
928 /// <param name="simClient"></param> 927 /// <param name="simClient"></param>
929 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient) 928 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient)
930 { 929 {
931 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; 930 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet;
932 931
933 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) 932 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
@@ -937,11 +936,11 @@ namespace OpenSim.Region.Environment.Scenes
937 else 936 else
938 { 937 {
939 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) 938 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
940 { 939 {
941// m_log.DebugFormat( 940// m_log.DebugFormat(
942// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}", 941// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}",
943// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID); 942// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID);
944 943
945 EntityBase selectedEnt = null; 944 EntityBase selectedEnt = null;
946 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString()); 945 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString());
947 946
@@ -959,14 +958,16 @@ namespace OpenSim.Region.Environment.Scenes
959 { 958 {
960 bool permission; 959 bool permission;
961 if (DeRezPacket.AgentBlock.Destination == 1) 960 if (DeRezPacket.AgentBlock.Destination == 1)
962 { // Take Copy 961 {
963 permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId, 962 // Take Copy
964 ((SceneObjectGroup) selectedEnt).UUID); 963 permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
964 (selectedEnt).UUID);
965 } 965 }
966 else 966 else
967 { // Take 967 {
968 permission = PermissionsMngr.CanDeRezObject(remoteClient.AgentId, 968 // Take
969 ((SceneObjectGroup) selectedEnt).UUID); 969 permission = PermissionsMngr.CanDeRezObject(remoteClient.AgentId,
970 (selectedEnt).UUID);
970 } 971 }
971 972
972 if (permission) 973 if (permission)
@@ -997,7 +998,8 @@ namespace OpenSim.Region.Environment.Scenes
997 item.InvType = asset.InvType; 998 item.InvType = asset.InvType;
998 item.Folder = DeRezPacket.AgentBlock.DestinationID; 999 item.Folder = DeRezPacket.AgentBlock.DestinationID;
999 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1000 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1000 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID) { 1001 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID)
1002 {
1001 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1003 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1002 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1004 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1003 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1005 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
@@ -1025,6 +1027,7 @@ namespace OpenSim.Region.Environment.Scenes
1025 } 1027 }
1026 } 1028 }
1027 } 1029 }
1030
1028 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID) 1031 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID)
1029 { 1032 {
1030 SceneObjectGroup objectGroup = grp; 1033 SceneObjectGroup objectGroup = grp;
@@ -1044,7 +1047,6 @@ namespace OpenSim.Region.Environment.Scenes
1044 // search through folders to find the asset. 1047 // search through folders to find the asset.
1045 while (searchfolders.Count > 0) 1048 while (searchfolders.Count > 0)
1046 { 1049 {
1047
1048 InventoryFolderImpl fld = searchfolders.Dequeue(); 1050 InventoryFolderImpl fld = searchfolders.Dequeue();
1049 lock (fld) 1051 lock (fld)
1050 { 1052 {
@@ -1069,8 +1071,8 @@ namespace OpenSim.Region.Environment.Scenes
1069 AssetBase asset = CreateAsset( 1071 AssetBase asset = CreateAsset(
1070 objectGroup.GetPartName(objectGroup.LocalId), 1072 objectGroup.GetPartName(objectGroup.LocalId),
1071 objectGroup.GetPartDescription(objectGroup.LocalId), 1073 objectGroup.GetPartDescription(objectGroup.LocalId),
1072 (sbyte)InventoryType.Object, 1074 (sbyte) InventoryType.Object,
1073 (sbyte)AssetType.Object, 1075 (sbyte) AssetType.Object,
1074 Helpers.StringToField(sceneObjectXml)); 1076 Helpers.StringToField(sceneObjectXml));
1075 AssetCache.AddAsset(asset); 1077 AssetCache.AddAsset(asset);
1076 1078
@@ -1086,7 +1088,7 @@ namespace OpenSim.Region.Environment.Scenes
1086 1088
1087 // Sticking it in root folder for now.. objects folder later? 1089 // Sticking it in root folder for now.. objects folder later?
1088 1090
1089 item.Folder = foundFolder;// DeRezPacket.AgentBlock.DestinationID; 1091 item.Folder = foundFolder; // DeRezPacket.AgentBlock.DestinationID;
1090 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1092 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1091 if (agentID != objectGroup.RootPart.OwnerID) 1093 if (agentID != objectGroup.RootPart.OwnerID)
1092 { 1094 {
@@ -1108,10 +1110,10 @@ namespace OpenSim.Region.Environment.Scenes
1108 { 1110 {
1109 remoteClient.SendInventoryItemCreateUpdate(item); 1111 remoteClient.SendInventoryItemCreateUpdate(item);
1110 } 1112 }
1111
1112 } 1113 }
1113 } 1114 }
1114 } 1115 }
1116
1115 public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) 1117 public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId)
1116 { 1118 {
1117 SceneObjectGroup objectGroup = grp; 1119 SceneObjectGroup objectGroup = grp;
@@ -1126,8 +1128,8 @@ namespace OpenSim.Region.Environment.Scenes
1126 AssetBase asset = CreateAsset( 1128 AssetBase asset = CreateAsset(
1127 objectGroup.GetPartName(objectGroup.LocalId), 1129 objectGroup.GetPartName(objectGroup.LocalId),
1128 objectGroup.GetPartDescription(objectGroup.LocalId), 1130 objectGroup.GetPartDescription(objectGroup.LocalId),
1129 (sbyte)InventoryType.Object, 1131 (sbyte) InventoryType.Object,
1130 (sbyte)AssetType.Object, 1132 (sbyte) AssetType.Object,
1131 Helpers.StringToField(sceneObjectXml)); 1133 Helpers.StringToField(sceneObjectXml));
1132 AssetCache.AddAsset(asset); 1134 AssetCache.AddAsset(asset);
1133 1135
@@ -1140,10 +1142,10 @@ namespace OpenSim.Region.Environment.Scenes
1140 item.Name = asset.Name; 1142 item.Name = asset.Name;
1141 item.AssetType = asset.Type; 1143 item.AssetType = asset.Type;
1142 item.InvType = asset.InvType; 1144 item.InvType = asset.InvType;
1143 1145
1144 // Sticking it in root folder for now.. objects folder later? 1146 // Sticking it in root folder for now.. objects folder later?
1145 1147
1146 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID; 1148 item.Folder = userInfo.RootFolder.ID; // DeRezPacket.AgentBlock.DestinationID;
1147 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1149 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1148 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID) 1150 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID)
1149 { 1151 {
@@ -1165,7 +1167,6 @@ namespace OpenSim.Region.Environment.Scenes
1165 return LLUUID.Zero; 1167 return LLUUID.Zero;
1166 } 1168 }
1167 return LLUUID.Zero; 1169 return LLUUID.Zero;
1168
1169 } 1170 }
1170 1171
1171 /// <summary> 1172 /// <summary>
@@ -1187,64 +1188,63 @@ namespace OpenSim.Region.Environment.Scenes
1187 /// <param name="RemoveItem"></param> 1188 /// <param name="RemoveItem"></param>
1188 /// <param name="fromTaskID"></param> 1189 /// <param name="fromTaskID"></param>
1189 public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, 1190 public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart,
1190 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 1191 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
1191 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, 1192 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
1192 bool RezSelected, bool RemoveItem, LLUUID fromTaskID) 1193 bool RezSelected, bool RemoveItem, LLUUID fromTaskID)
1193 { 1194 {
1194 SceneObjectGroup sog = RezObject(remoteClient, itemID, RayEnd, RayStart, 1195 SceneObjectGroup sog = RezObject(remoteClient, itemID, RayEnd, RayStart,
1195 RayTargetID, BypassRayCast, RayEndIsIntersection, 1196 RayTargetID, BypassRayCast, RayEndIsIntersection,
1196 EveryoneMask, GroupMask, NextOwnerMask, ItemFlags, 1197 EveryoneMask, GroupMask, NextOwnerMask, ItemFlags,
1197 RezSelected, RemoveItem, fromTaskID, false); 1198 RezSelected, RemoveItem, fromTaskID, false);
1198 } 1199 }
1199 1200
1200 1201
1201 1202 /// <summary>
1202 /// <summary> 1203 /// Returns SceneObjectGroup or null from asset request.
1203 /// Returns SceneObjectGroup or null from asset request. 1204 /// </summary>
1204 /// </summary> 1205 /// <param name="remoteClient"></param>
1205 /// <param name="remoteClient"></param> 1206 /// <param name="itemID"></param>
1206 /// <param name="itemID"></param> 1207 /// <param name="RayEnd"></param>
1207 /// <param name="RayEnd"></param> 1208 /// <param name="RayStart"></param>
1208 /// <param name="RayStart"></param> 1209 /// <param name="RayTargetID"></param>
1209 /// <param name="RayTargetID"></param> 1210 /// <param name="BypassRayCast"></param>
1210 /// <param name="BypassRayCast"></param> 1211 /// <param name="RayEndIsIntersection"></param>
1211 /// <param name="RayEndIsIntersection"></param> 1212 /// <param name="EveryoneMask"></param>
1212 /// <param name="EveryoneMask"></param> 1213 /// <param name="GroupMask"></param>
1213 /// <param name="GroupMask"></param> 1214 /// <param name="NextOwnerMask"></param>
1214 /// <param name="NextOwnerMask"></param> 1215 /// <param name="ItemFlags"></param>
1215 /// <param name="ItemFlags"></param> 1216 /// <param name="RezSelected"></param>
1216 /// <param name="RezSelected"></param> 1217 /// <param name="RemoveItem"></param>
1217 /// <param name="RemoveItem"></param> 1218 /// <param name="fromTaskID"></param>
1218 /// <param name="fromTaskID"></param> 1219 /// <param name="difference"></param>
1219 /// <param name="difference"></param> 1220 /// <returns></returns>
1220 /// <returns></returns>
1221 public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, 1221 public virtual SceneObjectGroup RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart,
1222 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 1222 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
1223 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, 1223 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
1224 bool RezSelected, bool RemoveItem, LLUUID fromTaskID, bool attachment) 1224 bool RezSelected, bool RemoveItem, LLUUID fromTaskID, bool attachment)
1225 { 1225 {
1226 // Work out position details 1226 // Work out position details
1227 byte bRayEndIsIntersection = (byte)0; 1227 byte bRayEndIsIntersection = 0;
1228 1228
1229 if (RayEndIsIntersection) 1229 if (RayEndIsIntersection)
1230 { 1230 {
1231 bRayEndIsIntersection = (byte)1; 1231 bRayEndIsIntersection = 1;
1232 } 1232 }
1233 else 1233 else
1234 { 1234 {
1235 bRayEndIsIntersection = (byte)0; 1235 bRayEndIsIntersection = 0;
1236 } 1236 }
1237 1237
1238 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f); 1238 LLVector3 scale = new LLVector3(0.5f, 0.5f, 0.5f);
1239 1239
1240 1240
1241 LLVector3 pos = GetNewRezLocation( 1241 LLVector3 pos = GetNewRezLocation(
1242 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), 1242 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1),
1243 BypassRayCast, bRayEndIsIntersection,true,scale, false); 1243 BypassRayCast, bRayEndIsIntersection, true, scale, false);
1244 1244
1245 if (!PermissionsMngr.CanRezObject(remoteClient.AgentId, pos) && !attachment) 1245 if (!PermissionsMngr.CanRezObject(remoteClient.AgentId, pos) && !attachment)
1246 { 1246 {
1247 return null; 1247 return null;
1248 } 1248 }
1249 1249
1250 // Rez object 1250 // Rez object
@@ -1260,7 +1260,7 @@ namespace OpenSim.Region.Environment.Scenes
1260 1260
1261 if (rezAsset != null) 1261 if (rezAsset != null)
1262 { 1262 {
1263 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data); 1263 string xmlData = Helpers.FieldToUTF8String(rezAsset.Data);
1264 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData); 1264 SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
1265 group.ResetIDs(); 1265 group.ResetIDs();
1266 AddEntity(group); 1266 AddEntity(group);
@@ -1270,8 +1270,8 @@ namespace OpenSim.Region.Environment.Scenes
1270 if (!attachment) 1270 if (!attachment)
1271 { 1271 {
1272 pos = GetNewRezLocation( 1272 pos = GetNewRezLocation(
1273 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1), 1273 RayStart, RayEnd, RayTargetID, new LLQuaternion(0, 0, 0, 1),
1274 BypassRayCast, bRayEndIsIntersection, true, group.GroupScale(), false); 1274 BypassRayCast, bRayEndIsIntersection, true, group.GroupScale(), false);
1275 group.AbsolutePosition = pos; 1275 group.AbsolutePosition = pos;
1276 } 1276 }
1277 else 1277 else
@@ -1280,7 +1280,7 @@ namespace OpenSim.Region.Environment.Scenes
1280 } 1280 }
1281 1281
1282 SceneObjectPart rootPart = group.GetChildPart(group.UUID); 1282 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1283 1283
1284 // Since renaming the item in the inventory does not affect the name stored 1284 // Since renaming the item in the inventory does not affect the name stored
1285 // in the serialization, transfer the correct name from the inventory to the 1285 // in the serialization, transfer the correct name from the inventory to the
1286 // object itself before we rez. 1286 // object itself before we rez.
@@ -1301,22 +1301,22 @@ namespace OpenSim.Region.Environment.Scenes
1301 part.ChangeInventoryOwner(item.Owner); 1301 part.ChangeInventoryOwner(item.Owner);
1302 } 1302 }
1303 } 1303 }
1304 1304
1305 rootPart.TrimPermissions(); 1305 rootPart.TrimPermissions();
1306 1306
1307 if (!attachment) 1307 if (!attachment)
1308 { 1308 {
1309 if (group.RootPart.Shape.PCode == (byte)PCode.Prim) 1309 if (group.RootPart.Shape.PCode == (byte) PCode.Prim)
1310 { 1310 {
1311 group.ClearPartAttachmentData(); 1311 group.ClearPartAttachmentData();
1312 } 1312 }
1313 group.ApplyPhysics(m_physicalPrim); 1313 group.ApplyPhysics(m_physicalPrim);
1314 } 1314 }
1315 1315
1316 1316
1317 group.StartScripts(); 1317 group.StartScripts();
1318 1318
1319 1319
1320 if (!attachment) 1320 if (!attachment)
1321 rootPart.ScheduleFullUpdate(); 1321 rootPart.ScheduleFullUpdate();
1322 1322
@@ -1327,7 +1327,5 @@ namespace OpenSim.Region.Environment.Scenes
1327 } 1327 }
1328 return null; 1328 return null;
1329 } 1329 }
1330
1331
1332 } 1330 }
1333} 1331} \ No newline at end of file