aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorDiva Canto2014-02-21 10:05:06 -0800
committerDiva Canto2014-02-21 10:05:06 -0800
commit97c74afca897acf8f000b0560ff041fd51897e5b (patch)
tree71efc4ababc6f428de291a56e289fa158cbf2272 /OpenSim/Region/CoreModules/Avatar
parentAdded 2 new behavirors to pCampBot. These are part of a systematic study I'm ... (diff)
parentIf texture decode fails in Warp3D map maker, log uuid of asset that failed to... (diff)
downloadopensim-SC-97c74afca897acf8f000b0560ff041fd51897e5b.zip
opensim-SC-97c74afca897acf8f000b0560ff041fd51897e5b.tar.gz
opensim-SC-97c74afca897acf8f000b0560ff041fd51897e5b.tar.bz2
opensim-SC-97c74afca897acf8f000b0560ff041fd51897e5b.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs340
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs11
3 files changed, 217 insertions, 146 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 09cc998..cdad729 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -687,187 +687,238 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
687 m_scene.EventManager.TriggerAvatarAppearanceChanged(sp); 687 m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
688 } 688 }
689 689
690 /// <summary>
691 /// For a given set of appearance items, check whether the items are valid and add their asset IDs to
692 /// appearance data.
693 /// </summary>
694 /// <param name='userID'></param>
695 /// <param name='appearance'></param>
690 private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance) 696 private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
691 { 697 {
692 IInventoryService invService = m_scene.InventoryService; 698 IInventoryService invService = m_scene.InventoryService;
693 bool resetwearable = false; 699
694 if (invService.GetRootFolder(userID) != null) 700 if (invService.GetRootFolder(userID) != null)
695 { 701 {
696 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 702 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
697 { 703 {
698 for (int j = 0; j < appearance.Wearables[i].Count; j++) 704 for (int j = 0; j < appearance.Wearables[i].Count; j++)
699 { 705 {
700 // Check if the default wearables are not set
701 if (appearance.Wearables[i][j].ItemID == UUID.Zero) 706 if (appearance.Wearables[i][j].ItemID == UUID.Zero)
702 { 707 {
703 switch ((WearableType) i) 708 m_log.WarnFormat(
704 { 709 "[AVFACTORY]: Wearable item {0}:{1} for user {2} unexpectedly UUID.Zero. Ignoring.",
705 case WearableType.Eyes: 710 i, j, userID);
706 case WearableType.Hair: 711
707 case WearableType.Shape:
708 case WearableType.Skin:
709 //case WearableType.Underpants:
710 TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
711 resetwearable = true;
712 m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values.");
713 resetwearable = true;
714 break;
715
716 }
717 continue; 712 continue;
718 } 713 }
719 714
720 // Ignore ruth's assets except for the body parts! missing body parts fail avatar appearance on V1 715 // Ignore ruth's assets
721 if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID) 716 if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID)
722 {
723 switch ((WearableType)i)
724 {
725 case WearableType.Eyes:
726 case WearableType.Hair:
727 case WearableType.Shape:
728 case WearableType.Skin:
729 //case WearableType.Underpants:
730 TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
731
732 m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i);
733 resetwearable = true;
734 break;
735
736 }
737 continue; 717 continue;
738 } 718
739
740 InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); 719 InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
741 baseItem = invService.GetItem(baseItem); 720 baseItem = invService.GetItem(baseItem);
742 721
743 if (baseItem != null) 722 if (baseItem != null)
744 { 723 {
745 appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); 724 appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID);
746 int unmodifiedWearableIndexForClosure = i;
747 m_scene.AssetService.Get(baseItem.AssetID.ToString(), this,
748 delegate(string x, object y, AssetBase z)
749 {
750 if (z == null)
751 {
752 TryAndRepairBrokenWearable(
753 (WearableType)unmodifiedWearableIndexForClosure, invService,
754 userID, appearance);
755 }
756 });
757 } 725 }
758 else 726 else
759 { 727 {
760 m_log.ErrorFormat( 728 m_log.WarnFormat(
761 "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", 729 "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default",
762 appearance.Wearables[i][j].ItemID, (WearableType)i); 730 appearance.Wearables[i][j].ItemID, (WearableType)i);
763 731
764 TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance); 732 appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID);
765 resetwearable = true;
766
767 } 733 }
768 } 734 }
769 } 735 }
770
771 // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
772 if (appearance.Wearables[(int) WearableType.Eyes] == null)
773 {
774 m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes));
775
776 TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance);
777 resetwearable = true;
778 }
779 else
780 {
781 if (appearance.Wearables[(int) WearableType.Eyes][0].ItemID == UUID.Zero)
782 {
783 m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}",
784 appearance.Wearables[(int) WearableType.Eyes][0].ItemID,
785 appearance.Wearables[(int) WearableType.Eyes][0].AssetID);
786 TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance);
787 resetwearable = true;
788
789 }
790
791 }
792 // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
793 if (appearance.Wearables[(int)WearableType.Shape] == null)
794 {
795 m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape));
796
797 TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance);
798 resetwearable = true;
799 }
800 else
801 {
802 if (appearance.Wearables[(int)WearableType.Shape][0].ItemID == UUID.Zero)
803 {
804 m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}",
805 appearance.Wearables[(int)WearableType.Shape][0].ItemID,
806 appearance.Wearables[(int)WearableType.Shape][0].AssetID);
807 TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance);
808 resetwearable = true;
809
810 }
811
812 }
813 // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
814 if (appearance.Wearables[(int)WearableType.Hair] == null)
815 {
816 m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair));
817
818 TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance);
819 resetwearable = true;
820 }
821 else
822 {
823 if (appearance.Wearables[(int)WearableType.Hair][0].ItemID == UUID.Zero)
824 {
825 m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}",
826 appearance.Wearables[(int)WearableType.Hair][0].ItemID,
827 appearance.Wearables[(int)WearableType.Hair][0].AssetID);
828 TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance);
829 resetwearable = true;
830
831 }
832
833 }
834 // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
835 if (appearance.Wearables[(int)WearableType.Skin] == null)
836 {
837 m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin));
838
839 TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance);
840 resetwearable = true;
841 }
842 else
843 {
844 if (appearance.Wearables[(int)WearableType.Skin][0].ItemID == UUID.Zero)
845 {
846 m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}",
847 appearance.Wearables[(int)WearableType.Skin][0].ItemID,
848 appearance.Wearables[(int)WearableType.Skin][0].AssetID);
849 TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance);
850 resetwearable = true;
851
852 }
853
854 }
855 if (resetwearable)
856 {
857 ScenePresence presence = null;
858 if (m_scene.TryGetScenePresence(userID, out presence))
859 {
860 presence.ControllingClient.SendWearables(presence.Appearance.Wearables,
861 presence.Appearance.Serial++);
862 }
863 }
864
865 } 736 }
866 else 737 else
867 { 738 {
868 m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); 739 m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID);
869 } 740 }
741
742// IInventoryService invService = m_scene.InventoryService;
743// bool resetwearable = false;
744// if (invService.GetRootFolder(userID) != null)
745// {
746// for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
747// {
748// for (int j = 0; j < appearance.Wearables[i].Count; j++)
749// {
750// // Check if the default wearables are not set
751// if (appearance.Wearables[i][j].ItemID == UUID.Zero)
752// {
753// switch ((WearableType) i)
754// {
755// case WearableType.Eyes:
756// case WearableType.Hair:
757// case WearableType.Shape:
758// case WearableType.Skin:
759// //case WearableType.Underpants:
760// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
761// resetwearable = true;
762// m_log.Warn("[AVFACTORY]: UUID.Zero Wearables, passing fake values.");
763// resetwearable = true;
764// break;
765//
766// }
767// continue;
768// }
769//
770// // Ignore ruth's assets except for the body parts! missing body parts fail avatar appearance on V1
771// if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID)
772// {
773// switch ((WearableType)i)
774// {
775// case WearableType.Eyes:
776// case WearableType.Hair:
777// case WearableType.Shape:
778// case WearableType.Skin:
779// //case WearableType.Underpants:
780// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
781//
782// m_log.WarnFormat("[AVFACTORY]: {0} Default Wearables, passing existing values.", (WearableType)i);
783// resetwearable = true;
784// break;
785//
786// }
787// continue;
788// }
789//
790// InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
791// baseItem = invService.GetItem(baseItem);
792//
793// if (baseItem != null)
794// {
795// appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID);
796// int unmodifiedWearableIndexForClosure = i;
797// m_scene.AssetService.Get(baseItem.AssetID.ToString(), this,
798// delegate(string x, object y, AssetBase z)
799// {
800// if (z == null)
801// {
802// TryAndRepairBrokenWearable(
803// (WearableType)unmodifiedWearableIndexForClosure, invService,
804// userID, appearance);
805// }
806// });
807// }
808// else
809// {
810// m_log.ErrorFormat(
811// "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default",
812// appearance.Wearables[i][j].ItemID, (WearableType)i);
813//
814// TryAndRepairBrokenWearable((WearableType)i, invService, userID, appearance);
815// resetwearable = true;
816//
817// }
818// }
819// }
820//
821// // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
822// if (appearance.Wearables[(int) WearableType.Eyes] == null)
823// {
824// m_log.WarnFormat("[AVFACTORY]: {0} Eyes are Null, passing existing values.", (WearableType.Eyes));
825//
826// TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance);
827// resetwearable = true;
828// }
829// else
830// {
831// if (appearance.Wearables[(int) WearableType.Eyes][0].ItemID == UUID.Zero)
832// {
833// m_log.WarnFormat("[AVFACTORY]: Eyes are UUID.Zero are broken, {0} {1}",
834// appearance.Wearables[(int) WearableType.Eyes][0].ItemID,
835// appearance.Wearables[(int) WearableType.Eyes][0].AssetID);
836// TryAndRepairBrokenWearable(WearableType.Eyes, invService, userID, appearance);
837// resetwearable = true;
838//
839// }
840//
841// }
842// // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
843// if (appearance.Wearables[(int)WearableType.Shape] == null)
844// {
845// m_log.WarnFormat("[AVFACTORY]: {0} shape is Null, passing existing values.", (WearableType.Shape));
846//
847// TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance);
848// resetwearable = true;
849// }
850// else
851// {
852// if (appearance.Wearables[(int)WearableType.Shape][0].ItemID == UUID.Zero)
853// {
854// m_log.WarnFormat("[AVFACTORY]: Shape is UUID.Zero and broken, {0} {1}",
855// appearance.Wearables[(int)WearableType.Shape][0].ItemID,
856// appearance.Wearables[(int)WearableType.Shape][0].AssetID);
857// TryAndRepairBrokenWearable(WearableType.Shape, invService, userID, appearance);
858// resetwearable = true;
859//
860// }
861//
862// }
863// // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
864// if (appearance.Wearables[(int)WearableType.Hair] == null)
865// {
866// m_log.WarnFormat("[AVFACTORY]: {0} Hair is Null, passing existing values.", (WearableType.Hair));
867//
868// TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance);
869// resetwearable = true;
870// }
871// else
872// {
873// if (appearance.Wearables[(int)WearableType.Hair][0].ItemID == UUID.Zero)
874// {
875// m_log.WarnFormat("[AVFACTORY]: Hair is UUID.Zero and broken, {0} {1}",
876// appearance.Wearables[(int)WearableType.Hair][0].ItemID,
877// appearance.Wearables[(int)WearableType.Hair][0].AssetID);
878// TryAndRepairBrokenWearable(WearableType.Hair, invService, userID, appearance);
879// resetwearable = true;
880//
881// }
882//
883// }
884// // I don't know why we have to test for this again... but the above switches do not capture these scenarios for some reason....
885// if (appearance.Wearables[(int)WearableType.Skin] == null)
886// {
887// m_log.WarnFormat("[AVFACTORY]: {0} Skin is Null, passing existing values.", (WearableType.Skin));
888//
889// TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance);
890// resetwearable = true;
891// }
892// else
893// {
894// if (appearance.Wearables[(int)WearableType.Skin][0].ItemID == UUID.Zero)
895// {
896// m_log.WarnFormat("[AVFACTORY]: Skin is UUID.Zero and broken, {0} {1}",
897// appearance.Wearables[(int)WearableType.Skin][0].ItemID,
898// appearance.Wearables[(int)WearableType.Skin][0].AssetID);
899// TryAndRepairBrokenWearable(WearableType.Skin, invService, userID, appearance);
900// resetwearable = true;
901//
902// }
903//
904// }
905// if (resetwearable)
906// {
907// ScenePresence presence = null;
908// if (m_scene.TryGetScenePresence(userID, out presence))
909// {
910// presence.ControllingClient.SendWearables(presence.Appearance.Wearables,
911// presence.Appearance.Serial++);
912// }
913// }
914//
915// }
916// else
917// {
918// m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID);
919// }
870 } 920 }
921
871 private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance) 922 private void TryAndRepairBrokenWearable(WearableType type, IInventoryService invService, UUID userID,AvatarAppearance appearance)
872 { 923 {
873 UUID defaultwearable = GetDefaultItem(type); 924 UUID defaultwearable = GetDefaultItem(type);
@@ -957,6 +1008,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
957 } 1008 }
958 } 1009 }
959 } 1010 }
1011
960 private UUID GetDefaultItem(WearableType wearable) 1012 private UUID GetDefaultItem(WearableType wearable)
961 { 1013 {
962 // These are ruth 1014 // These are ruth
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
index 7bf19c2..c51b30f 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/HGMessageTransferModule.cs
@@ -282,7 +282,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
282 string uasURL = circuit.ServiceURLs["HomeURI"].ToString(); 282 string uasURL = circuit.ServiceURLs["HomeURI"].ToString();
283 m_log.DebugFormat("[HG MESSAGE TRANSFER]: getting UUI of user {0} from {1}", toAgent, uasURL); 283 m_log.DebugFormat("[HG MESSAGE TRANSFER]: getting UUI of user {0} from {1}", toAgent, uasURL);
284 UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uasURL); 284 UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uasURL);
285 return uasConn.GetUUI(fromAgent, toAgent); 285
286 string agentUUI = string.Empty;
287 try
288 {
289 agentUUI = uasConn.GetUUI(fromAgent, toAgent);
290 }
291 catch (Exception e) {
292 m_log.Debug("[HG MESSAGE TRANSFER]: GetUUI call failed ", e);
293 }
294
295 return agentUUI;
286 } 296 }
287 } 297 }
288 } 298 }
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index 2da0a74..f3e757a 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -1164,7 +1164,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
1164 1164
1165 UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url); 1165 UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url);
1166 1166
1167 Dictionary<string, object> account = uConn.GetUserInfo(userID); 1167 Dictionary<string, object> account;
1168 try
1169 {
1170 account = uConn.GetUserInfo(userID);
1171 }
1172 catch (Exception e)
1173 {
1174 m_log.Debug("[PROFILES]: GetUserInfo call failed ", e);
1175 account = new Dictionary<string, object>();
1176 }
1168 1177
1169 if (account.Count > 0) 1178 if (account.Count > 0)
1170 { 1179 {