aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2014-08-07 23:29:31 +0100
committerUbitUmarov2014-08-07 23:29:31 +0100
commit4ae0bb7df1774426ffa77898ac062a24bc6234f5 (patch)
tree5fa22dbe944bda41a5e88eef2696c106b454472f /OpenSim/Framework
parentupdate the max number of texture faces and wearables to current values. (diff)
downloadopensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.zip
opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.tar.gz
opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.tar.bz2
opensim-SC-4ae0bb7df1774426ffa77898ac062a24bc6234f5.tar.xz
add limites checks on wearables size, revert to max 15 for
compatibility/testing
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs12
-rw-r--r--OpenSim/Framework/AvatarWearable.cs6
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs7
3 files changed, 19 insertions, 6 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 40179a2..c384336 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -462,7 +462,10 @@ namespace OpenSim.Framework
462// m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); 462// m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID);
463// DEBUG OFF 463// DEBUG OFF
464 m_wearables[wearableId].Clear(); 464 m_wearables[wearableId].Clear();
465 for (int i = 0; i < wearable.Count; i++) 465 int count = wearable.Count;
466 if (count > AvatarWearable.MAX_WEARABLES)
467 count = AvatarWearable.MAX_WEARABLES;
468 for (int i = 0; i < count; i++)
466 m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); 469 m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID);
467 } 470 }
468 471
@@ -755,7 +758,12 @@ namespace OpenSim.Framework
755 if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) 758 if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array)
756 { 759 {
757 OSDArray wears = (OSDArray)(data["wearables"]); 760 OSDArray wears = (OSDArray)(data["wearables"]);
758 for (int i = 0; i < wears.Count; i++) 761
762 int count = wears.Count;
763 if (count > AvatarWearable.MAX_WEARABLES)
764 count = AvatarWearable.MAX_WEARABLES;
765
766 for (int i = 0; i < count; i++)
759 m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); 767 m_wearables[i] = new AvatarWearable((OSDArray)wears[i]);
760 } 768 }
761 else 769 else
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index b104325..7d33abc 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -67,10 +67,10 @@ namespace OpenSim.Framework
67 67
68 public static readonly int ALPHA = 13; 68 public static readonly int ALPHA = 13;
69 public static readonly int TATTOO = 14; 69 public static readonly int TATTOO = 14;
70 public static readonly int PHYSICS = 15; 70// public static readonly int PHYSICS = 15;
71 71
72 public static readonly int MAX_WEARABLES = 16; 72// public static readonly int MAX_WEARABLES = 16;
73// public static readonly int MAX_WEARABLES = 15; 73 public static readonly int MAX_WEARABLES = 15;
74 74
75 public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); 75 public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
76 public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); 76 public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 2a8e67d..5beb37d 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -665,7 +665,12 @@ namespace OpenSim.Framework
665 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) 665 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
666 { 666 {
667 OSDArray wears = (OSDArray)(args["wearables"]); 667 OSDArray wears = (OSDArray)(args["wearables"]);
668 for (int i = 0; i < wears.Count / 2; i++) 668
669 int count = wears.Count;
670 if (count > AvatarWearable.MAX_WEARABLES)
671 count = AvatarWearable.MAX_WEARABLES;
672
673 for (int i = 0; i < count / 2; i++)
669 { 674 {
670 AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); 675 AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
671 Appearance.SetWearable(i,awear); 676 Appearance.SetWearable(i,awear);