aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 18:04:42 +0000
committerAdam Frisby2008-05-01 18:04:42 +0000
commit20a9bf08f51351e1e0a9de94f184ff56cd572665 (patch)
tree52da64dab26353b903c8e4befed0178fa72a188b /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentMore config cleanup in LaunchSLClient. (diff)
downloadopensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.zip
opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.gz
opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.bz2
opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.xz
* Rolled back a few changes.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs316
1 files changed, 159 insertions, 157 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 1e6ebf9..6bd5d1a 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 = RequestModuleInterface<IAgentAssetTransactions>(); 301 IAgentAssetTransactions agentTransactions = this.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 + ", no root folder"); 398 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", 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); 416 m_log.Error("[AGENT INVENTORY]: Failed to find user " + oldAgentID.ToString());
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); 425 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
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); 431 m_log.Error("[AGENT INVENTORY]: Failed to find item " + oldItemID.ToString());
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); 475 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
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); 496 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString());
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 + ", no root folder"); 502 m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemID.ToString() + ", 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,19 +593,21 @@ 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 = RequestModuleInterface<IAgentAssetTransactions>(); 602 IAgentAssetTransactions agentTransactions = this.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
609 } 611 }
610 } 612 }
611 613
@@ -615,7 +617,7 @@ namespace OpenSim.Region.Environment.Scenes
615 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 617 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
616 if (userInfo == null) 618 if (userInfo == null)
617 { 619 {
618 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId); 620 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
619 return; 621 return;
620 } 622 }
621 623
@@ -639,7 +641,7 @@ namespace OpenSim.Region.Environment.Scenes
639 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 641 = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
640 if (userInfo == null) 642 if (userInfo == null)
641 { 643 {
642 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId); 644 m_log.Error("[AGENT INVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
643 return; 645 return;
644 } 646 }
645 647
@@ -675,7 +677,7 @@ namespace OpenSim.Region.Environment.Scenes
675 /// <param name="remoteClient"></param> 677 /// <param name="remoteClient"></param>
676 /// <param name="primLocalID"></param> 678 /// <param name="primLocalID"></param>
677 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID) 679 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
678 { 680 {
679 SceneObjectGroup group = GetGroupByPrim(primLocalID); 681 SceneObjectGroup group = GetGroupByPrim(primLocalID);
680 if (group != null) 682 if (group != null)
681 { 683 {
@@ -723,7 +725,7 @@ namespace OpenSim.Region.Environment.Scenes
723 localID); 725 localID);
724 } 726 }
725 } 727 }
726 728
727 /// <summary> 729 /// <summary>
728 /// Move the given item in the given prim to a folder in the client's inventory 730 /// Move the given item in the given prim to a folder in the client's inventory
729 /// </summary> 731 /// </summary>
@@ -734,43 +736,43 @@ namespace OpenSim.Region.Environment.Scenes
734 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) 736 public void MoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
735 { 737 {
736 SceneObjectGroup group = GetGroupByPrim(primLocalId); 738 SceneObjectGroup group = GetGroupByPrim(primLocalId);
737 739
738 if (null == group) 740 if (null == group)
739 { 741 {
740 m_log.WarnFormat( 742 m_log.WarnFormat(
741 "[PRIM INVENTORY]: " + 743 "[PRIM INVENTORY]: " +
742 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found", 744 "Move of inventory item {0} from prim with local id {1} failed because the prim could not be found",
743 itemId, primLocalId); 745 itemId, primLocalId);
744 746
745 return; 747 return;
746 } 748 }
747 749
748 TaskInventoryItem taskItem = group.GetInventoryItem(primLocalId, itemId); 750 TaskInventoryItem taskItem = group.GetInventoryItem(primLocalId, itemId);
749 751
750 if (null == taskItem) 752 if (null == taskItem)
751 { 753 {
752 // Console already notified of error in GetInventoryItem 754 // Console already notified of error in GetInventoryItem
753 return; 755 return;
754 } 756 }
755 757
756// bool permission; 758// bool permission;
757// permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId, 759// permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
758// ((SceneObjectGroup) selectedEnt).UUID); 760// ((SceneObjectGroup) selectedEnt).UUID);
759 761
760 // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner 762 // Pending resolving upstream problems with permissions, we just won't allow anybody who is not the owner
761 // to copy 763 // to copy
762 if (remoteClient.AgentId != taskItem.OwnerID) 764 if (remoteClient.AgentId != taskItem.OwnerID)
763 { 765 {
764 m_log.InfoFormat( 766 m_log.InfoFormat(
765 "[PRIM INVENTORY]: Attempt made by {0} {1} to copy inventory item {2} {3} in prim {4} {5}," 767 "[PRIM INVENTORY]: Attempt made by {0} {1} to copy inventory item {2} {3} in prim {4} {5},"
766 + " but temporarily not allowed pending upstream bugfixes/feature implementation", 768 + " but temporarily not allowed pending upstream bugfixes/feature implementation",
767 remoteClient.Name, remoteClient.AgentId, taskItem.Name, taskItem.ItemID, group.Name, group.UUID); 769 remoteClient.Name, remoteClient.AgentId, taskItem.Name, taskItem.ItemID, group.Name, group.UUID);
768 770
769 return; 771 return;
770 } 772 }
771 773
772 InventoryItemBase agentItem = new InventoryItemBase(); 774 InventoryItemBase agentItem = new InventoryItemBase();
773 775
774 agentItem.ID = LLUUID.Random(); 776 agentItem.ID = LLUUID.Random();
775 agentItem.Creator = taskItem.CreatorID; 777 agentItem.Creator = taskItem.CreatorID;
776 agentItem.Owner = remoteClient.AgentId; 778 agentItem.Owner = remoteClient.AgentId;
@@ -781,9 +783,8 @@ namespace OpenSim.Region.Environment.Scenes
781 agentItem.InvType = taskItem.InvType; 783 agentItem.InvType = taskItem.InvType;
782 agentItem.Folder = folderId; 784 agentItem.Folder = folderId;
783 agentItem.EveryOnePermissions = taskItem.EveryoneMask; 785 agentItem.EveryOnePermissions = taskItem.EveryoneMask;
784 786
785 if (remoteClient.AgentId != taskItem.OwnerID) 787 if (remoteClient.AgentId != taskItem.OwnerID) {
786 {
787 agentItem.BasePermissions = taskItem.NextOwnerMask; 788 agentItem.BasePermissions = taskItem.NextOwnerMask;
788 agentItem.CurrentPermissions = taskItem.NextOwnerMask; 789 agentItem.CurrentPermissions = taskItem.NextOwnerMask;
789 agentItem.NextPermissions = taskItem.NextOwnerMask; 790 agentItem.NextPermissions = taskItem.NextOwnerMask;
@@ -792,9 +793,9 @@ namespace OpenSim.Region.Environment.Scenes
792 { 793 {
793 agentItem.BasePermissions = taskItem.BaseMask; 794 agentItem.BasePermissions = taskItem.BaseMask;
794 agentItem.CurrentPermissions = taskItem.OwnerMask; 795 agentItem.CurrentPermissions = taskItem.OwnerMask;
795 agentItem.NextPermissions = taskItem.NextOwnerMask; 796 agentItem.NextPermissions = taskItem.NextOwnerMask;
796 } 797 }
797 798
798 AddInventoryItem(remoteClient, agentItem); 799 AddInventoryItem(remoteClient, agentItem);
799 } 800 }
800 801
@@ -833,7 +834,7 @@ namespace OpenSim.Region.Environment.Scenes
833 { 834 {
834 group.AddInventoryItem(remoteClient, primLocalID, item, copyID); 835 group.AddInventoryItem(remoteClient, primLocalID, item, copyID);
835 m_log.InfoFormat( 836 m_log.InfoFormat(
836 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 837 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
837 item.Name, primLocalID, remoteClient.Name); 838 item.Name, primLocalID, remoteClient.Name);
838 group.GetProperties(remoteClient); 839 group.GetProperties(remoteClient);
839 } 840 }
@@ -864,22 +865,22 @@ namespace OpenSim.Region.Environment.Scenes
864 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 865 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
865 { 866 {
866 LLUUID copyID = LLUUID.Random(); 867 LLUUID copyID = LLUUID.Random();
867 868
868 if (itemID != LLUUID.Zero) 869 if (itemID != LLUUID.Zero)
869 { 870 {
870 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 871 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
871 872
872 if (userInfo != null && userInfo.RootFolder != null) 873 if (userInfo != null && userInfo.RootFolder != null)
873 { 874 {
874 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID); 875 InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
875 876
876 // Try library 877 // Try library
877 // XXX clumsy, possibly should be one call 878 // XXX clumsy, possibly should be one call
878 if (null == item) 879 if (null == item)
879 { 880 {
880 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID); 881 item = CommsManager.UserProfileCacheService.libraryRoot.HasItem(itemID);
881 } 882 }
882 883
883 if (item != null) 884 if (item != null)
884 { 885 {
885 SceneObjectGroup group = GetGroupByPrim(localID); 886 SceneObjectGroup group = GetGroupByPrim(localID);
@@ -888,10 +889,10 @@ namespace OpenSim.Region.Environment.Scenes
888 group.AddInventoryItem(remoteClient, localID, item, copyID); 889 group.AddInventoryItem(remoteClient, localID, item, copyID);
889 group.StartScript(localID, copyID); 890 group.StartScript(localID, copyID);
890 group.GetProperties(remoteClient); 891 group.GetProperties(remoteClient);
891 892
892 // m_log.InfoFormat("[PRIMINVENTORY]: " + 893 // m_log.InfoFormat("[PRIMINVENTORY]: " +
893 // "Rezzed script {0} into prim local ID {1} for user {2}", 894 // "Rezzed script {0} into prim local ID {1} for user {2}",
894 // item.inventoryName, localID, remoteClient.Name); 895 // item.inventoryName, localID, remoteClient.Name);
895 } 896 }
896 else 897 else
897 { 898 {
@@ -910,7 +911,7 @@ namespace OpenSim.Region.Environment.Scenes
910 } 911 }
911 } 912 }
912 } 913 }
913 else // If the itemID is zero then the script has been rezzed directly in an object's inventory 914 else // If the itemID is zero then the script has been rezzed directly in an object's inventory
914 { 915 {
915 // not yet implemented 916 // not yet implemented
916 // TODO Need to get more details from original RezScript packet 917 // TODO Need to get more details from original RezScript packet
@@ -926,7 +927,7 @@ namespace OpenSim.Region.Environment.Scenes
926 /// <param name="packet"></param> 927 /// <param name="packet"></param>
927 /// <param name="simClient"></param> 928 /// <param name="simClient"></param>
928 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient) 929 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient)
929 { 930 {
930 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; 931 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet;
931 932
932 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero) 933 if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
@@ -936,11 +937,11 @@ namespace OpenSim.Region.Environment.Scenes
936 else 937 else
937 { 938 {
938 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData) 939 foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
939 { 940 {
940// m_log.DebugFormat( 941// m_log.DebugFormat(
941// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}", 942// "[AGENT INVENTORY]: Received request to derez {0} into folder {1}",
942// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID); 943// Data.ObjectLocalID, DeRezPacket.AgentBlock.DestinationID);
943 944
944 EntityBase selectedEnt = null; 945 EntityBase selectedEnt = null;
945 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString()); 946 //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString());
946 947
@@ -958,16 +959,14 @@ namespace OpenSim.Region.Environment.Scenes
958 { 959 {
959 bool permission; 960 bool permission;
960 if (DeRezPacket.AgentBlock.Destination == 1) 961 if (DeRezPacket.AgentBlock.Destination == 1)
961 { 962 { // Take Copy
962 // Take Copy 963 permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId,
963 permission = PermissionsMngr.CanCopyObject(remoteClient.AgentId, 964 ((SceneObjectGroup) selectedEnt).UUID);
964 (selectedEnt).UUID);
965 } 965 }
966 else 966 else
967 { 967 { // Take
968 // Take 968 permission = PermissionsMngr.CanDeRezObject(remoteClient.AgentId,
969 permission = PermissionsMngr.CanDeRezObject(remoteClient.AgentId, 969 ((SceneObjectGroup) selectedEnt).UUID);
970 (selectedEnt).UUID);
971 } 970 }
972 971
973 if (permission) 972 if (permission)
@@ -998,8 +997,7 @@ namespace OpenSim.Region.Environment.Scenes
998 item.InvType = asset.InvType; 997 item.InvType = asset.InvType;
999 item.Folder = DeRezPacket.AgentBlock.DestinationID; 998 item.Folder = DeRezPacket.AgentBlock.DestinationID;
1000 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 999 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1001 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID) 1000 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID) {
1002 {
1003 item.BasePermissions = objectGroup.RootPart.NextOwnerMask; 1001 item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
1004 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask; 1002 item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
1005 item.NextPermissions = objectGroup.RootPart.NextOwnerMask; 1003 item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
@@ -1027,7 +1025,6 @@ namespace OpenSim.Region.Environment.Scenes
1027 } 1025 }
1028 } 1026 }
1029 } 1027 }
1030
1031 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID) 1028 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID assetID, LLUUID agentID)
1032 { 1029 {
1033 SceneObjectGroup objectGroup = grp; 1030 SceneObjectGroup objectGroup = grp;
@@ -1047,6 +1044,7 @@ namespace OpenSim.Region.Environment.Scenes
1047 // search through folders to find the asset. 1044 // search through folders to find the asset.
1048 while (searchfolders.Count > 0) 1045 while (searchfolders.Count > 0)
1049 { 1046 {
1047
1050 InventoryFolderImpl fld = searchfolders.Dequeue(); 1048 InventoryFolderImpl fld = searchfolders.Dequeue();
1051 lock (fld) 1049 lock (fld)
1052 { 1050 {
@@ -1071,8 +1069,8 @@ namespace OpenSim.Region.Environment.Scenes
1071 AssetBase asset = CreateAsset( 1069 AssetBase asset = CreateAsset(
1072 objectGroup.GetPartName(objectGroup.LocalId), 1070 objectGroup.GetPartName(objectGroup.LocalId),
1073 objectGroup.GetPartDescription(objectGroup.LocalId), 1071 objectGroup.GetPartDescription(objectGroup.LocalId),
1074 (sbyte) InventoryType.Object, 1072 (sbyte)InventoryType.Object,
1075 (sbyte) AssetType.Object, 1073 (sbyte)AssetType.Object,
1076 Helpers.StringToField(sceneObjectXml)); 1074 Helpers.StringToField(sceneObjectXml));
1077 AssetCache.AddAsset(asset); 1075 AssetCache.AddAsset(asset);
1078 1076
@@ -1088,7 +1086,7 @@ namespace OpenSim.Region.Environment.Scenes
1088 1086
1089 // Sticking it in root folder for now.. objects folder later? 1087 // Sticking it in root folder for now.. objects folder later?
1090 1088
1091 item.Folder = foundFolder; // DeRezPacket.AgentBlock.DestinationID; 1089 item.Folder = foundFolder;// DeRezPacket.AgentBlock.DestinationID;
1092 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1090 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1093 if (agentID != objectGroup.RootPart.OwnerID) 1091 if (agentID != objectGroup.RootPart.OwnerID)
1094 { 1092 {
@@ -1110,10 +1108,10 @@ namespace OpenSim.Region.Environment.Scenes
1110 { 1108 {
1111 remoteClient.SendInventoryItemCreateUpdate(item); 1109 remoteClient.SendInventoryItemCreateUpdate(item);
1112 } 1110 }
1111
1113 } 1112 }
1114 } 1113 }
1115 } 1114 }
1116
1117 public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) 1115 public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId)
1118 { 1116 {
1119 SceneObjectGroup objectGroup = grp; 1117 SceneObjectGroup objectGroup = grp;
@@ -1128,8 +1126,8 @@ namespace OpenSim.Region.Environment.Scenes
1128 AssetBase asset = CreateAsset( 1126 AssetBase asset = CreateAsset(
1129 objectGroup.GetPartName(objectGroup.LocalId), 1127 objectGroup.GetPartName(objectGroup.LocalId),
1130 objectGroup.GetPartDescription(objectGroup.LocalId), 1128 objectGroup.GetPartDescription(objectGroup.LocalId),
1131 (sbyte) InventoryType.Object, 1129 (sbyte)InventoryType.Object,
1132 (sbyte) AssetType.Object, 1130 (sbyte)AssetType.Object,
1133 Helpers.StringToField(sceneObjectXml)); 1131 Helpers.StringToField(sceneObjectXml));
1134 AssetCache.AddAsset(asset); 1132 AssetCache.AddAsset(asset);
1135 1133
@@ -1142,10 +1140,10 @@ namespace OpenSim.Region.Environment.Scenes
1142 item.Name = asset.Name; 1140 item.Name = asset.Name;
1143 item.AssetType = asset.Type; 1141 item.AssetType = asset.Type;
1144 item.InvType = asset.InvType; 1142 item.InvType = asset.InvType;
1145 1143
1146 // Sticking it in root folder for now.. objects folder later? 1144 // Sticking it in root folder for now.. objects folder later?
1147 1145
1148 item.Folder = userInfo.RootFolder.ID; // DeRezPacket.AgentBlock.DestinationID; 1146 item.Folder = userInfo.RootFolder.ID;// DeRezPacket.AgentBlock.DestinationID;
1149 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask; 1147 item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
1150 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID) 1148 if (remoteClient.AgentId != objectGroup.RootPart.OwnerID)
1151 { 1149 {
@@ -1167,6 +1165,7 @@ namespace OpenSim.Region.Environment.Scenes
1167 return LLUUID.Zero; 1165 return LLUUID.Zero;
1168 } 1166 }
1169 return LLUUID.Zero; 1167 return LLUUID.Zero;
1168
1170 } 1169 }
1171 1170
1172 /// <summary> 1171 /// <summary>
@@ -1188,63 +1187,64 @@ namespace OpenSim.Region.Environment.Scenes
1188 /// <param name="RemoveItem"></param> 1187 /// <param name="RemoveItem"></param>
1189 /// <param name="fromTaskID"></param> 1188 /// <param name="fromTaskID"></param>
1190 public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart, 1189 public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart,
1191 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 1190 LLUUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
1192 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags, 1191 uint EveryoneMask, uint GroupMask, uint NextOwnerMask, uint ItemFlags,
1193 bool RezSelected, bool RemoveItem, LLUUID fromTaskID) 1192 bool RezSelected, bool RemoveItem, LLUUID fromTaskID)
1194 { 1193 {
1195 SceneObjectGroup sog = RezObject(remoteClient, itemID, RayEnd, RayStart, 1194 SceneObjectGroup sog = RezObject(remoteClient, itemID, RayEnd, RayStart,
1196 RayTargetID, BypassRayCast, RayEndIsIntersection, 1195 RayTargetID, BypassRayCast, RayEndIsIntersection,
1197 EveryoneMask, GroupMask, NextOwnerMask, ItemFlags, 1196 EveryoneMask, GroupMask, NextOwnerMask, ItemFlags,
1198 RezSelected, RemoveItem, fromTaskID, false); 1197 RezSelected, RemoveItem, fromTaskID, false);
1199 } 1198 }
1200 1199
1201 1200
1202 /// <summary> 1201
1203 /// Returns SceneObjectGroup or null from asset request. 1202 /// <summary>
1204 /// </summary> 1203 /// Returns SceneObjectGroup or null from asset request.
1205 /// <param name="remoteClient"></param> 1204 /// </summary>
1206 /// <param name="itemID"></param> 1205 /// <param name="remoteClient"></param>
1207 /// <param name="RayEnd"></param> 1206 /// <param name="itemID"></param>
1208 /// <param name="RayStart"></param> 1207 /// <param name="RayEnd"></param>
1209 /// <param name="RayTargetID"></param> 1208 /// <param name="RayStart"></param>
1210 /// <param name="BypassRayCast"></param> 1209 /// <param name="RayTargetID"></param>
1211 /// <param name="RayEndIsIntersection"></param> 1210 /// <param name="BypassRayCast"></param>
1212 /// <param name="EveryoneMask"></param> 1211 /// <param name="RayEndIsIntersection"></param>
1213 /// <param name="GroupMask"></param> 1212 /// <param name="EveryoneMask"></param>
1214 /// <param name="NextOwnerMask"></param> 1213 /// <param name="GroupMask"></param>
1215 /// <param name="ItemFlags"></param> 1214 /// <param name="NextOwnerMask"></param>
1216 /// <param name="RezSelected"></param> 1215 /// <param name="ItemFlags"></param>
1217 /// <param name="RemoveItem"></param> 1216 /// <param name="RezSelected"></param>
1218 /// <param name="fromTaskID"></param> 1217 /// <param name="RemoveItem"></param>
1219 /// <param name="difference"></param> 1218 /// <param name="fromTaskID"></param>
1220 /// <returns></returns> 1219 /// <param name="difference"></param>
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 = 0; 1227 byte bRayEndIsIntersection = (byte)0;
1228 1228
1229 if (RayEndIsIntersection) 1229 if (RayEndIsIntersection)
1230 { 1230 {
1231 bRayEndIsIntersection = 1; 1231 bRayEndIsIntersection = (byte)1;
1232 } 1232 }
1233 else 1233 else
1234 { 1234 {
1235 bRayEndIsIntersection = 0; 1235 bRayEndIsIntersection = (byte)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,5 +1327,7 @@ namespace OpenSim.Region.Environment.Scenes
1327 } 1327 }
1328 return null; 1328 return null;
1329 } 1329 }
1330
1331
1330 } 1332 }
1331} \ No newline at end of file 1333}