diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 3c6bbe6..208bc9e 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -694,7 +694,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
694 | case WearableType.Shape: | 694 | case WearableType.Shape: |
695 | case WearableType.Skin: | 695 | case WearableType.Skin: |
696 | //case WearableType.Underpants: | 696 | //case WearableType.Underpants: |
697 | TryAndRepair((WearableType)i, invService, userID, appearance); | 697 | TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
698 | resetwearable = true; | 698 | resetwearable = true; |
699 | m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values."); | 699 | m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values."); |
700 | resetwearable = true; | 700 | resetwearable = true; |
@@ -714,7 +714,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
714 | case WearableType.Shape: | 714 | case WearableType.Shape: |
715 | case WearableType.Skin: | 715 | case WearableType.Skin: |
716 | //case WearableType.Underpants: | 716 | //case WearableType.Underpants: |
717 | TryAndRepair((WearableType)i, invService, userID, appearance); | 717 | TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
718 | 718 | ||
719 | m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); | 719 | m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); |
720 | resetwearable = true; | 720 | resetwearable = true; |
@@ -730,6 +730,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
730 | if (baseItem != null) | 730 | if (baseItem != null) |
731 | { | 731 | { |
732 | appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); | 732 | appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); |
733 | int unmodifiedWearableIndexForClosure = i; | ||
734 | m_scene.AssetService.Get(baseItem.AssetID.ToString(), this, | ||
735 | delegate(string x, object y, AssetBase z) | ||
736 | { | ||
737 | if (z == null) | ||
738 | { | ||
739 | TryAndRepairBrokenWearable( | ||
740 | (WearableType)unmodifiedWearableIndexForClosure, invService, | ||
741 | userID, appearance); | ||
742 | } | ||
743 | }); | ||
733 | } | 744 | } |
734 | else | 745 | else |
735 | { | 746 | { |
@@ -737,7 +748,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
737 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", | 748 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", |
738 | appearance.Wearables[i][j].ItemID, (WearableType)i); | 749 | appearance.Wearables[i][j].ItemID, (WearableType)i); |
739 | 750 | ||
740 | TryAndRepair((WearableType)i, invService, userID, appearance); | 751 | TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
741 | resetwearable = true; | 752 | resetwearable = true; |
742 | 753 | ||
743 | } | 754 | } |
@@ -749,7 +760,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
749 | { | 760 | { |
750 | m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); | 761 | m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); |
751 | 762 | ||
752 | TryAndRepair(WearableType.Eyes, invService, userID, appearance); | 763 | TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); |
753 | resetwearable = true; | 764 | resetwearable = true; |
754 | } | 765 | } |
755 | else | 766 | else |
@@ -759,7 +770,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
759 | m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}", | 770 | m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}", |
760 | appearance.Wearables[(int) WearableType.Eyes][0].ItemID, | 771 | appearance.Wearables[(int) WearableType.Eyes][0].ItemID, |
761 | appearance.Wearables[(int) WearableType.Eyes][0].AssetID); | 772 | appearance.Wearables[(int) WearableType.Eyes][0].AssetID); |
762 | TryAndRepair(WearableType.Eyes, invService, userID, appearance); | 773 | TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); |
763 | resetwearable = true; | 774 | resetwearable = true; |
764 | 775 | ||
765 | } | 776 | } |
@@ -770,7 +781,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
770 | { | 781 | { |
771 | m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape)); | 782 | m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape)); |
772 | 783 | ||
773 | TryAndRepair(WearableType.Shape, invService, userID, appearance); | 784 | TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance); |
774 | resetwearable = true; | 785 | resetwearable = true; |
775 | } | 786 | } |
776 | else | 787 | else |
@@ -780,7 +791,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
780 | m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}", | 791 | m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}", |
781 | appearance.Wearables[(int)WearableType.Shape][0].ItemID, | 792 | appearance.Wearables[(int)WearableType.Shape][0].ItemID, |
782 | appearance.Wearables[(int)WearableType.Shape][0].AssetID); | 793 | appearance.Wearables[(int)WearableType.Shape][0].AssetID); |
783 | TryAndRepair(WearableType.Shape, invService, userID, appearance); | 794 | TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance); |
784 | resetwearable = true; | 795 | resetwearable = true; |
785 | 796 | ||
786 | } | 797 | } |
@@ -791,7 +802,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
791 | { | 802 | { |
792 | m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair)); | 803 | m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair)); |
793 | 804 | ||
794 | TryAndRepair(WearableType.Hair, invService, userID, appearance); | 805 | TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance); |
795 | resetwearable = true; | 806 | resetwearable = true; |
796 | } | 807 | } |
797 | else | 808 | else |
@@ -801,7 +812,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
801 | m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}", | 812 | m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}", |
802 | appearance.Wearables[(int)WearableType.Hair][0].ItemID, | 813 | appearance.Wearables[(int)WearableType.Hair][0].ItemID, |
803 | appearance.Wearables[(int)WearableType.Hair][0].AssetID); | 814 | appearance.Wearables[(int)WearableType.Hair][0].AssetID); |
804 | TryAndRepair(WearableType.Hair, invService, userID, appearance); | 815 | TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance); |
805 | resetwearable = true; | 816 | resetwearable = true; |
806 | 817 | ||
807 | } | 818 | } |
@@ -812,7 +823,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
812 | { | 823 | { |
813 | m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin)); | 824 | m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin)); |
814 | 825 | ||
815 | TryAndRepair(WearableType.Skin, invService, userID, appearance); | 826 | TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance); |
816 | resetwearable = true; | 827 | resetwearable = true; |
817 | } | 828 | } |
818 | else | 829 | else |
@@ -822,7 +833,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
822 | m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}", | 833 | m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}", |
823 | appearance.Wearables[(int)WearableType.Skin][0].ItemID, | 834 | appearance.Wearables[(int)WearableType.Skin][0].ItemID, |
824 | appearance.Wearables[(int)WearableType.Skin][0].AssetID); | 835 | appearance.Wearables[(int)WearableType.Skin][0].AssetID); |
825 | TryAndRepair(WearableType.Skin, invService, userID, appearance); | 836 | TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance); |
826 | resetwearable = true; | 837 | resetwearable = true; |
827 | 838 | ||
828 | } | 839 | } |
@@ -844,7 +855,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
844 | m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); | 855 | m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); |
845 | } | 856 | } |
846 | } | 857 | } |
847 | private void TryAndRepair(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) | 858 | private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) |
848 | { | 859 | { |
849 | UUID defaultwearable = GetDefaultItem(type); | 860 | UUID defaultwearable = GetDefaultItem(type); |
850 | if (defaultwearable != UUID.Zero) | 861 | if (defaultwearable != UUID.Zero) |