diff options
author | Diva Canto | 2017-04-26 09:58:15 -0700 |
---|---|---|
committer | Diva Canto | 2017-04-26 09:58:15 -0700 |
commit | 8dfab8757ca4d8b8af6213f2d3b3bf1fd1d2f18e (patch) | |
tree | 0db99cc75c201d1a6425b32d6311e8150e6c4a13 /OpenSim | |
parent | If we're going to show regions twice (in standalone) at least make the format... (diff) | |
download | opensim-SC-8dfab8757ca4d8b8af6213f2d3b3bf1fd1d2f18e.zip opensim-SC-8dfab8757ca4d8b8af6213f2d3b3bf1fd1d2f18e.tar.gz opensim-SC-8dfab8757ca4d8b8af6213f2d3b3bf1fd1d2f18e.tar.bz2 opensim-SC-8dfab8757ca4d8b8af6213f2d3b3bf1fd1d2f18e.tar.xz |
Fill out Current Outfit folder with links when creating the initial avatar appearance. Some viewers (e.g. Singularity 1.8.7) get seriously confused when the avatar has no current outfit links.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Services/UserAccountService/UserAccountService.cs | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index f6b003a..a22754f 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -640,9 +640,11 @@ namespace OpenSim.Services.UserAccountService | |||
640 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); | 640 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Creating default appearance items for {0}", principalID); |
641 | 641 | ||
642 | InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart); | 642 | InventoryFolderBase bodyPartsFolder = m_InventoryService.GetFolderForType(principalID, FolderType.BodyPart); |
643 | // Get Current Outfit folder | ||
644 | InventoryFolderBase currentOutfitFolder = m_InventoryService.GetFolderForType(principalID, FolderType.CurrentOutfit); | ||
643 | 645 | ||
644 | InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); | 646 | InventoryItemBase eyes = new InventoryItemBase(UUID.Random(), principalID); |
645 | eyes.AssetID = new UUID("4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7"); | 647 | eyes.AssetID = AvatarWearable.DEFAULT_EYES_ASSET; |
646 | eyes.Name = "Default Eyes"; | 648 | eyes.Name = "Default Eyes"; |
647 | eyes.CreatorId = principalID.ToString(); | 649 | eyes.CreatorId = principalID.ToString(); |
648 | eyes.AssetType = (int)AssetType.Bodypart; | 650 | eyes.AssetType = (int)AssetType.Bodypart; |
@@ -655,6 +657,7 @@ namespace OpenSim.Services.UserAccountService | |||
655 | eyes.NextPermissions = (uint)PermissionMask.All; | 657 | eyes.NextPermissions = (uint)PermissionMask.All; |
656 | eyes.Flags = (uint)WearableType.Eyes; | 658 | eyes.Flags = (uint)WearableType.Eyes; |
657 | m_InventoryService.AddItem(eyes); | 659 | m_InventoryService.AddItem(eyes); |
660 | CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Eyes, eyes.Name, eyes.ID, principalID, currentOutfitFolder.ID); | ||
658 | 661 | ||
659 | InventoryItemBase shape = new InventoryItemBase(UUID.Random(), principalID); | 662 | InventoryItemBase shape = new InventoryItemBase(UUID.Random(), principalID); |
660 | shape.AssetID = AvatarWearable.DEFAULT_BODY_ASSET; | 663 | shape.AssetID = AvatarWearable.DEFAULT_BODY_ASSET; |
@@ -670,6 +673,7 @@ namespace OpenSim.Services.UserAccountService | |||
670 | shape.NextPermissions = (uint)PermissionMask.All; | 673 | shape.NextPermissions = (uint)PermissionMask.All; |
671 | shape.Flags = (uint)WearableType.Shape; | 674 | shape.Flags = (uint)WearableType.Shape; |
672 | m_InventoryService.AddItem(shape); | 675 | m_InventoryService.AddItem(shape); |
676 | CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Shape, shape.Name, shape.ID, principalID, currentOutfitFolder.ID); | ||
673 | 677 | ||
674 | InventoryItemBase skin = new InventoryItemBase(UUID.Random(), principalID); | 678 | InventoryItemBase skin = new InventoryItemBase(UUID.Random(), principalID); |
675 | skin.AssetID = AvatarWearable.DEFAULT_SKIN_ASSET; | 679 | skin.AssetID = AvatarWearable.DEFAULT_SKIN_ASSET; |
@@ -685,6 +689,7 @@ namespace OpenSim.Services.UserAccountService | |||
685 | skin.NextPermissions = (uint)PermissionMask.All; | 689 | skin.NextPermissions = (uint)PermissionMask.All; |
686 | skin.Flags = (uint)WearableType.Skin; | 690 | skin.Flags = (uint)WearableType.Skin; |
687 | m_InventoryService.AddItem(skin); | 691 | m_InventoryService.AddItem(skin); |
692 | CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Skin, skin.Name, skin.ID, principalID, currentOutfitFolder.ID); | ||
688 | 693 | ||
689 | InventoryItemBase hair = new InventoryItemBase(UUID.Random(), principalID); | 694 | InventoryItemBase hair = new InventoryItemBase(UUID.Random(), principalID); |
690 | hair.AssetID = AvatarWearable.DEFAULT_HAIR_ASSET; | 695 | hair.AssetID = AvatarWearable.DEFAULT_HAIR_ASSET; |
@@ -700,6 +705,7 @@ namespace OpenSim.Services.UserAccountService | |||
700 | hair.NextPermissions = (uint)PermissionMask.All; | 705 | hair.NextPermissions = (uint)PermissionMask.All; |
701 | hair.Flags = (uint)WearableType.Hair; | 706 | hair.Flags = (uint)WearableType.Hair; |
702 | m_InventoryService.AddItem(hair); | 707 | m_InventoryService.AddItem(hair); |
708 | CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Hair, hair.Name, hair.ID, principalID, currentOutfitFolder.ID); | ||
703 | 709 | ||
704 | InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing); | 710 | InventoryFolderBase clothingFolder = m_InventoryService.GetFolderForType(principalID, FolderType.Clothing); |
705 | 711 | ||
@@ -717,6 +723,7 @@ namespace OpenSim.Services.UserAccountService | |||
717 | shirt.NextPermissions = (uint)PermissionMask.All; | 723 | shirt.NextPermissions = (uint)PermissionMask.All; |
718 | shirt.Flags = (uint)WearableType.Shirt; | 724 | shirt.Flags = (uint)WearableType.Shirt; |
719 | m_InventoryService.AddItem(shirt); | 725 | m_InventoryService.AddItem(shirt); |
726 | CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Shirt, shirt.Name, shirt.ID, principalID, currentOutfitFolder.ID); | ||
720 | 727 | ||
721 | InventoryItemBase pants = new InventoryItemBase(UUID.Random(), principalID); | 728 | InventoryItemBase pants = new InventoryItemBase(UUID.Random(), principalID); |
722 | pants.AssetID = AvatarWearable.DEFAULT_PANTS_ASSET; | 729 | pants.AssetID = AvatarWearable.DEFAULT_PANTS_ASSET; |
@@ -732,6 +739,7 @@ namespace OpenSim.Services.UserAccountService | |||
732 | pants.NextPermissions = (uint)PermissionMask.All; | 739 | pants.NextPermissions = (uint)PermissionMask.All; |
733 | pants.Flags = (uint)WearableType.Pants; | 740 | pants.Flags = (uint)WearableType.Pants; |
734 | m_InventoryService.AddItem(pants); | 741 | m_InventoryService.AddItem(pants); |
742 | CreateCurrentOutfitLink((int)InventoryType.Wearable, (uint)WearableType.Pants, pants.Name, pants.ID, principalID, currentOutfitFolder.ID); | ||
735 | 743 | ||
736 | if (m_AvatarService != null) | 744 | if (m_AvatarService != null) |
737 | { | 745 | { |
@@ -815,6 +823,8 @@ namespace OpenSim.Services.UserAccountService | |||
815 | { | 823 | { |
816 | // Get Clothing folder of receiver | 824 | // Get Clothing folder of receiver |
817 | InventoryFolderBase destinationFolder = m_InventoryService.GetFolderForType(destination, FolderType.Clothing); | 825 | InventoryFolderBase destinationFolder = m_InventoryService.GetFolderForType(destination, FolderType.Clothing); |
826 | // Get Current Outfit folder | ||
827 | InventoryFolderBase currentOutfitFolder = m_InventoryService.GetFolderForType(destination, FolderType.CurrentOutfit); | ||
818 | 828 | ||
819 | if (destinationFolder == null) | 829 | if (destinationFolder == null) |
820 | throw new Exception("Cannot locate folder(s)"); | 830 | throw new Exception("Cannot locate folder(s)"); |
@@ -841,6 +851,7 @@ namespace OpenSim.Services.UserAccountService | |||
841 | for (int i = 0; i < wearables.Length; i++) | 851 | for (int i = 0; i < wearables.Length; i++) |
842 | { | 852 | { |
843 | wearable = wearables[i]; | 853 | wearable = wearables[i]; |
854 | m_log.DebugFormat("[XXX]: Getting item {0} from avie {1}", wearable[0].ItemID, source); | ||
844 | if (wearable[0].ItemID != UUID.Zero) | 855 | if (wearable[0].ItemID != UUID.Zero) |
845 | { | 856 | { |
846 | // Get inventory item and copy it | 857 | // Get inventory item and copy it |
@@ -878,6 +889,9 @@ namespace OpenSim.Services.UserAccountService | |||
878 | AvatarWearable newWearable = new AvatarWearable(); | 889 | AvatarWearable newWearable = new AvatarWearable(); |
879 | newWearable.Wear(destinationItem.ID, wearable[0].AssetID); | 890 | newWearable.Wear(destinationItem.ID, wearable[0].AssetID); |
880 | avatarAppearance.SetWearable(i, newWearable); | 891 | avatarAppearance.SetWearable(i, newWearable); |
892 | |||
893 | // Add to Current Outfit | ||
894 | CreateCurrentOutfitLink((int)InventoryType.Wearable, item.Flags, item.Name, destinationItem.ID, destination, currentOutfitFolder.ID); | ||
881 | } | 895 | } |
882 | else | 896 | else |
883 | { | 897 | { |
@@ -930,6 +944,9 @@ namespace OpenSim.Services.UserAccountService | |||
930 | // Attach item | 944 | // Attach item |
931 | avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); | 945 | avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); |
932 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Attached {0}", destinationItem.ID); | 946 | m_log.DebugFormat("[USER ACCOUNT SERVICE]: Attached {0}", destinationItem.ID); |
947 | |||
948 | // Add to Current Outfit | ||
949 | CreateCurrentOutfitLink(destinationItem.InvType, item.Flags, item.Name, destinationItem.ID, destination, currentOutfitFolder.ID); | ||
933 | } | 950 | } |
934 | else | 951 | else |
935 | { | 952 | { |
@@ -939,6 +956,30 @@ namespace OpenSim.Services.UserAccountService | |||
939 | } | 956 | } |
940 | } | 957 | } |
941 | 958 | ||
959 | protected void CreateCurrentOutfitLink(int invType, uint itemType, string name, UUID itemID, UUID userID, UUID currentOutfitFolderUUID) | ||
960 | { | ||
961 | UUID LinkInvItem = UUID.Random(); | ||
962 | InventoryItemBase itembase = new InventoryItemBase(LinkInvItem, userID) | ||
963 | { | ||
964 | AssetID = itemID, | ||
965 | AssetType = (int)AssetType.Link, | ||
966 | CreatorId = userID.ToString(), | ||
967 | InvType = invType, | ||
968 | Description = "", | ||
969 | //Folder = m_InventoryService.GetFolderForType(userID, FolderType.CurrentOutfit).ID, | ||
970 | Folder = currentOutfitFolderUUID, | ||
971 | Flags = itemType, | ||
972 | Name = name, | ||
973 | BasePermissions = (uint)PermissionMask.Copy, | ||
974 | CurrentPermissions = (uint)PermissionMask.Copy, | ||
975 | EveryOnePermissions = (uint)PermissionMask.Copy, | ||
976 | GroupPermissions = (uint)PermissionMask.Copy, | ||
977 | NextPermissions = (uint)PermissionMask.Copy | ||
978 | }; | ||
979 | |||
980 | m_InventoryService.AddItem(itembase); | ||
981 | } | ||
982 | |||
942 | /// <summary> | 983 | /// <summary> |
943 | /// Apply next owner permissions. | 984 | /// Apply next owner permissions. |
944 | /// </summary> | 985 | /// </summary> |