diff options
author | teravus | 2013-01-29 06:12:04 -0500 |
---|---|---|
committer | teravus | 2013-01-29 06:12:04 -0500 |
commit | e83893c8bcb26d0af191df7e19c5059c80896f51 (patch) | |
tree | 0aea8d9b782688c409d857edf8cb2b8f828e91b4 /OpenSim/Region/CoreModules/Avatar/AvatarFactory | |
parent | Change default avatar replacements to be ruth rather than urban male (diff) | |
download | opensim-SC_OLD-e83893c8bcb26d0af191df7e19c5059c80896f51.zip opensim-SC_OLD-e83893c8bcb26d0af191df7e19c5059c80896f51.tar.gz opensim-SC_OLD-e83893c8bcb26d0af191df7e19c5059c80896f51.tar.bz2 opensim-SC_OLD-e83893c8bcb26d0af191df7e19c5059c80896f51.tar.xz |
* This Checks the asset of each wearable asynchronously and repairs if it's required.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory')
-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 a9d11d5..1adff7e 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -691,7 +691,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
691 | case WearableType.Shape: | 691 | case WearableType.Shape: |
692 | case WearableType.Skin: | 692 | case WearableType.Skin: |
693 | //case WearableType.Underpants: | 693 | //case WearableType.Underpants: |
694 | TryAndRepair((WearableType)i, invService, userID, appearance); | 694 | TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
695 | resetwearable = true; | 695 | resetwearable = true; |
696 | m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values."); | 696 | m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values."); |
697 | resetwearable = true; | 697 | resetwearable = true; |
@@ -711,7 +711,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
711 | case WearableType.Shape: | 711 | case WearableType.Shape: |
712 | case WearableType.Skin: | 712 | case WearableType.Skin: |
713 | //case WearableType.Underpants: | 713 | //case WearableType.Underpants: |
714 | TryAndRepair((WearableType)i, invService, userID, appearance); | 714 | TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
715 | 715 | ||
716 | m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); | 716 | m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i); |
717 | resetwearable = true; | 717 | resetwearable = true; |
@@ -727,6 +727,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
727 | if (baseItem != null) | 727 | if (baseItem != null) |
728 | { | 728 | { |
729 | appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); | 729 | appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); |
730 | int unmodifiedWearableIndexForClosure = i; | ||
731 | m_scene.AssetService.Get(baseItem.AssetID.ToString(), this, | ||
732 | delegate(string x, object y, AssetBase z) | ||
733 | { | ||
734 | if (z == null) | ||
735 | { | ||
736 | TryAndRepairBrokenWearable( | ||
737 | (WearableType)unmodifiedWearableIndexForClosure, invService, | ||
738 | userID, appearance); | ||
739 | } | ||
740 | }); | ||
730 | } | 741 | } |
731 | else | 742 | else |
732 | { | 743 | { |
@@ -734,7 +745,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
734 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", | 745 | "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", |
735 | appearance.Wearables[i][j].ItemID, (WearableType)i); | 746 | appearance.Wearables[i][j].ItemID, (WearableType)i); |
736 | 747 | ||
737 | TryAndRepair((WearableType)i, invService, userID, appearance); | 748 | TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); |
738 | resetwearable = true; | 749 | resetwearable = true; |
739 | 750 | ||
740 | } | 751 | } |
@@ -746,7 +757,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
746 | { | 757 | { |
747 | m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); | 758 | m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes)); |
748 | 759 | ||
749 | TryAndRepair(WearableType.Eyes, invService, userID, appearance); | 760 | TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); |
750 | resetwearable = true; | 761 | resetwearable = true; |
751 | } | 762 | } |
752 | else | 763 | else |
@@ -756,7 +767,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
756 | m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}", | 767 | m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}", |
757 | appearance.Wearables[(int) WearableType.Eyes][0].ItemID, | 768 | appearance.Wearables[(int) WearableType.Eyes][0].ItemID, |
758 | appearance.Wearables[(int) WearableType.Eyes][0].AssetID); | 769 | appearance.Wearables[(int) WearableType.Eyes][0].AssetID); |
759 | TryAndRepair(WearableType.Eyes, invService, userID, appearance); | 770 | TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance); |
760 | resetwearable = true; | 771 | resetwearable = true; |
761 | 772 | ||
762 | } | 773 | } |
@@ -767,7 +778,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
767 | { | 778 | { |
768 | m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape)); | 779 | m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape)); |
769 | 780 | ||
770 | TryAndRepair(WearableType.Shape, invService, userID, appearance); | 781 | TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance); |
771 | resetwearable = true; | 782 | resetwearable = true; |
772 | } | 783 | } |
773 | else | 784 | else |
@@ -777,7 +788,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
777 | m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}", | 788 | m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}", |
778 | appearance.Wearables[(int)WearableType.Shape][0].ItemID, | 789 | appearance.Wearables[(int)WearableType.Shape][0].ItemID, |
779 | appearance.Wearables[(int)WearableType.Shape][0].AssetID); | 790 | appearance.Wearables[(int)WearableType.Shape][0].AssetID); |
780 | TryAndRepair(WearableType.Shape, invService, userID, appearance); | 791 | TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance); |
781 | resetwearable = true; | 792 | resetwearable = true; |
782 | 793 | ||
783 | } | 794 | } |
@@ -788,7 +799,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
788 | { | 799 | { |
789 | m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair)); | 800 | m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair)); |
790 | 801 | ||
791 | TryAndRepair(WearableType.Hair, invService, userID, appearance); | 802 | TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance); |
792 | resetwearable = true; | 803 | resetwearable = true; |
793 | } | 804 | } |
794 | else | 805 | else |
@@ -798,7 +809,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
798 | m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}", | 809 | m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}", |
799 | appearance.Wearables[(int)WearableType.Hair][0].ItemID, | 810 | appearance.Wearables[(int)WearableType.Hair][0].ItemID, |
800 | appearance.Wearables[(int)WearableType.Hair][0].AssetID); | 811 | appearance.Wearables[(int)WearableType.Hair][0].AssetID); |
801 | TryAndRepair(WearableType.Hair, invService, userID, appearance); | 812 | TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance); |
802 | resetwearable = true; | 813 | resetwearable = true; |
803 | 814 | ||
804 | } | 815 | } |
@@ -809,7 +820,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
809 | { | 820 | { |
810 | m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin)); | 821 | m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin)); |
811 | 822 | ||
812 | TryAndRepair(WearableType.Skin, invService, userID, appearance); | 823 | TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance); |
813 | resetwearable = true; | 824 | resetwearable = true; |
814 | } | 825 | } |
815 | else | 826 | else |
@@ -819,7 +830,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
819 | m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}", | 830 | m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}", |
820 | appearance.Wearables[(int)WearableType.Skin][0].ItemID, | 831 | appearance.Wearables[(int)WearableType.Skin][0].ItemID, |
821 | appearance.Wearables[(int)WearableType.Skin][0].AssetID); | 832 | appearance.Wearables[(int)WearableType.Skin][0].AssetID); |
822 | TryAndRepair(WearableType.Skin, invService, userID, appearance); | 833 | TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance); |
823 | resetwearable = true; | 834 | resetwearable = true; |
824 | 835 | ||
825 | } | 836 | } |
@@ -841,7 +852,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
841 | m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); | 852 | m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); |
842 | } | 853 | } |
843 | } | 854 | } |
844 | private void TryAndRepair(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) | 855 | private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) |
845 | { | 856 | { |
846 | UUID defaultwearable = GetDefaultItem(type); | 857 | UUID defaultwearable = GetDefaultItem(type); |
847 | if (defaultwearable != UUID.Zero) | 858 | if (defaultwearable != UUID.Zero) |