diff options
Diffstat (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs')
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index a714d86..72c2c34 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -61,8 +61,8 @@ namespace OpenSim.Framework | |||
61 | { | 61 | { |
62 | UUID AgentID { get; set; } | 62 | UUID AgentID { get; set; } |
63 | 63 | ||
64 | OSDMap Pack(); | 64 | OSDMap Pack(EntityTransferContext ctx); |
65 | void Unpack(OSDMap map, IScene scene); | 65 | void Unpack(OSDMap map, IScene scene, EntityTransferContext ctx); |
66 | } | 66 | } |
67 | 67 | ||
68 | /// <summary> | 68 | /// <summary> |
@@ -96,7 +96,7 @@ namespace OpenSim.Framework | |||
96 | 96 | ||
97 | public Dictionary<ulong, string> ChildrenCapSeeds = null; | 97 | public Dictionary<ulong, string> ChildrenCapSeeds = null; |
98 | 98 | ||
99 | public OSDMap Pack() | 99 | public OSDMap Pack(EntityTransferContext ctx) |
100 | { | 100 | { |
101 | OSDMap args = new OSDMap(); | 101 | OSDMap args = new OSDMap(); |
102 | args["message_type"] = OSD.FromString("AgentPosition"); | 102 | args["message_type"] = OSD.FromString("AgentPosition"); |
@@ -136,7 +136,7 @@ namespace OpenSim.Framework | |||
136 | return args; | 136 | return args; |
137 | } | 137 | } |
138 | 138 | ||
139 | public void Unpack(OSDMap args, IScene scene) | 139 | public void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx) |
140 | { | 140 | { |
141 | if (args.ContainsKey("region_handle")) | 141 | if (args.ContainsKey("region_handle")) |
142 | UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle); | 142 | UInt64.TryParse(args["region_handle"].AsString(), out RegionHandle); |
@@ -391,8 +391,10 @@ namespace OpenSim.Framework | |||
391 | 391 | ||
392 | public Dictionary<string, UUID> MovementAnimationOverRides = new Dictionary<string, UUID>(); | 392 | public Dictionary<string, UUID> MovementAnimationOverRides = new Dictionary<string, UUID>(); |
393 | 393 | ||
394 | public virtual OSDMap Pack() | 394 | public virtual OSDMap Pack(EntityTransferContext ctx) |
395 | { | 395 | { |
396 | int wearablesCount = -1; | ||
397 | |||
396 | // m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); | 398 | // m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); |
397 | 399 | ||
398 | OSDMap args = new OSDMap(); | 400 | OSDMap args = new OSDMap(); |
@@ -493,7 +495,7 @@ namespace OpenSim.Framework | |||
493 | } | 495 | } |
494 | 496 | ||
495 | if (Appearance != null) | 497 | if (Appearance != null) |
496 | args["packed_appearance"] = Appearance.Pack(); | 498 | args["packed_appearance"] = Appearance.Pack(ctx); |
497 | 499 | ||
498 | //if ((AgentTextures != null) && (AgentTextures.Length > 0)) | 500 | //if ((AgentTextures != null) && (AgentTextures.Length > 0)) |
499 | //{ | 501 | //{ |
@@ -584,7 +586,7 @@ namespace OpenSim.Framework | |||
584 | /// Avoiding reflection makes it painful to write, but that's the price! | 586 | /// Avoiding reflection makes it painful to write, but that's the price! |
585 | /// </summary> | 587 | /// </summary> |
586 | /// <param name="hash"></param> | 588 | /// <param name="hash"></param> |
587 | public virtual void Unpack(OSDMap args, IScene scene) | 589 | public virtual void Unpack(OSDMap args, IScene scene, EntityTransferContext ctx) |
588 | { | 590 | { |
589 | //m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data"); | 591 | //m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data"); |
590 | 592 | ||
@@ -800,11 +802,7 @@ namespace OpenSim.Framework | |||
800 | { | 802 | { |
801 | OSDArray wears = (OSDArray)(args["wearables"]); | 803 | OSDArray wears = (OSDArray)(args["wearables"]); |
802 | 804 | ||
803 | int count = wears.Count; | 805 | for (int i = 0; i < wears.Count / 2; i++) |
804 | if (count > AvatarWearable.MAX_WEARABLES) | ||
805 | count = AvatarWearable.MAX_WEARABLES; | ||
806 | |||
807 | for (int i = 0; i < count / 2; i++) | ||
808 | { | 806 | { |
809 | AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); | 807 | AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); |
810 | Appearance.SetWearable(i, awear); | 808 | Appearance.SetWearable(i, awear); |
@@ -897,14 +895,14 @@ namespace OpenSim.Framework | |||
897 | 895 | ||
898 | public class CompleteAgentData : AgentData | 896 | public class CompleteAgentData : AgentData |
899 | { | 897 | { |
900 | public override OSDMap Pack() | 898 | public override OSDMap Pack(EntityTransferContext ctx) |
901 | { | 899 | { |
902 | return base.Pack(); | 900 | return base.Pack(ctx); |
903 | } | 901 | } |
904 | 902 | ||
905 | public override void Unpack(OSDMap map, IScene scene) | 903 | public override void Unpack(OSDMap map, IScene scene, EntityTransferContext ctx) |
906 | { | 904 | { |
907 | base.Unpack(map, scene); | 905 | base.Unpack(map, scene, ctx); |
908 | } | 906 | } |
909 | } | 907 | } |
910 | } | 908 | } |