From 7f0f11304f0979355d75538ab7326b687b62e76e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 11 Jul 2010 14:26:57 +0200 Subject: Add scripted controllers into agent intersim messaging --- OpenSim/Framework/ChildAgentDataUpdate.cs | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index a1ac84c..89ee39c 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -265,6 +265,46 @@ namespace OpenSim.Framework } } + public class ControllerData + { + public UUID ItemID; + public uint IgnoreControls; + public uint EventControls; + + public ControllerData(UUID item, uint ignore, uint ev) + { + ItemID = item; + IgnoreControls = ignore; + EventControls = ev; + } + + public ControllerData(OSDMap args) + { + UnpackUpdateMessage(args); + } + + public OSDMap PackUpdateMessage() + { + OSDMap controldata = new OSDMap(); + controldata["item"] = OSD.FromUUID(ItemID); + controldata["ignore"] = OSD.FromInteger(IgnoreControls); + controldata["event"] = OSD.FromInteger(EventControls); + + return controldata; + } + + + public void UnpackUpdateMessage(OSDMap args) + { + if (args["item"] != null) + ItemID = args["item"].AsUUID(); + if (args["ignore"] != null) + IgnoreControls = (uint)args["ignore"].AsInteger(); + if (args["event"] != null) + EventControls = (uint)args["event"].AsInteger(); + } + } + public class AgentData : IAgentData { private UUID m_id; @@ -313,6 +353,9 @@ namespace OpenSim.Framework public UUID[] Wearables; public AttachmentData[] Attachments; + // Scripted + public ControllerData[] Controllers; + public string CallbackURI; public virtual OSDMap Pack() @@ -403,6 +446,14 @@ namespace OpenSim.Framework args["attachments"] = attachs; } + if ((Controllers != null) && (Controllers.Length > 0)) + { + OSDArray controls = new OSDArray(Controllers.Length); + foreach (ControllerData ctl in Controllers) + controls.Add(ctl.PackUpdateMessage()); + args["controllers"] = controls; + } + if ((CallbackURI != null) && (!CallbackURI.Equals(""))) args["callback_uri"] = OSD.FromString(CallbackURI); @@ -559,6 +610,20 @@ namespace OpenSim.Framework } } + if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) + { + OSDArray controls = (OSDArray)(args["controllers"]); + Controllers = new ControllerData[controls.Count]; + int i = 0; + foreach (OSD o in controls) + { + if (o.Type == OSDType.Map) + { + Controllers[i++] = new ControllerData((OSDMap)o); + } + } + } + if (args["callback_uri"] != null) CallbackURI = args["callback_uri"].AsString(); } -- cgit v1.1 From b3a71c6df1538c61247f7d4711aba4c840508db8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 24 Nov 2010 18:56:25 +0100 Subject: Prevent an overlength button label from producing a debug dump and aborting the script. --- OpenSim/Framework/ChildAgentDataUpdate.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index a227338..ce0b2fb 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -331,9 +331,7 @@ namespace OpenSim.Framework public virtual OSDMap Pack() { -// DEBUG ON - m_log.WarnFormat("[CHILDAGENTDATAUPDATE] Pack data"); -// DEBUG OFF + m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); OSDMap args = new OSDMap(); args["message_type"] = OSD.FromString("AgentData"); @@ -454,9 +452,7 @@ namespace OpenSim.Framework /// public virtual void Unpack(OSDMap args) { -// DEBUG ON - m_log.WarnFormat("[CHILDAGENTDATAUPDATE] Unpack data"); -// DEBUG OFF + m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data"); if (args.ContainsKey("region_id")) UUID.TryParse(args["region_id"].AsString(), out RegionID); @@ -613,10 +609,8 @@ namespace OpenSim.Framework if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); -// DEBUG ON else m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); -// DEBUG OFF if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) { -- cgit v1.1 From 2d3381b795611a8857077d1effb41323c2cb8658 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 14 Feb 2012 23:16:20 +0100 Subject: Implement region crossing of sitting avatars. Edit mode and llSetPos work but unscripted default sit anim is lost. Still some Gfx glitching. Physical crossing doesn't work yet. --- OpenSim/Framework/ChildAgentDataUpdate.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 6d048f4..fe12874 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -308,6 +308,8 @@ namespace OpenSim.Framework public Animation[] Anims; public UUID GranterID; + public UUID ParentPart; + public Vector3 SitOffset; // Appearance public AvatarAppearance Appearance; @@ -468,6 +470,10 @@ namespace OpenSim.Framework } args["attach_objects"] = attObjs; } + + args["parent_part"] = OSD.FromUUID(ParentPart); + args["sit_offset"] = OSD.FromString(SitOffset.ToString()); + return args; } @@ -675,6 +681,11 @@ namespace OpenSim.Framework } } } + + if (args["parent_part"] != null) + ParentPart = args["parent_part"].AsUUID(); + if (args["sit_offset"] != null) + Vector3.TryParse(args["sit_offset"].AsString(), out SitOffset); } public AgentData() -- cgit v1.1 From 9f9693dab825c7753af49c6838a484653047d4ae Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 3 May 2012 01:18:51 +0200 Subject: Clear permissions given to the object we stand up from --- OpenSim/Framework/ChildAgentDataUpdate.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index fe12874..abff44a 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -229,12 +229,14 @@ namespace OpenSim.Framework public class ControllerData { + public UUID ObjectID; public UUID ItemID; public uint IgnoreControls; public uint EventControls; - public ControllerData(UUID item, uint ignore, uint ev) + public ControllerData(UUID obj, UUID item, uint ignore, uint ev) { + ObjectID = obj; ItemID = item; IgnoreControls = ignore; EventControls = ev; @@ -248,6 +250,7 @@ namespace OpenSim.Framework public OSDMap PackUpdateMessage() { OSDMap controldata = new OSDMap(); + controldata["object"] = OSD.FromUUID(ObjectID); controldata["item"] = OSD.FromUUID(ItemID); controldata["ignore"] = OSD.FromInteger(IgnoreControls); controldata["event"] = OSD.FromInteger(EventControls); @@ -258,6 +261,8 @@ namespace OpenSim.Framework public void UnpackUpdateMessage(OSDMap args) { + if (args["object"] != null) + ObjectID = args["object"].AsUUID(); if (args["item"] != null) ItemID = args["item"].AsUUID(); if (args["ignore"] != null) -- cgit v1.1 From 333d013b5c34d7ed8c016251e50b80b62500aa3f Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 4 May 2012 20:33:48 +0200 Subject: Add the default animation to the child agent data update --- OpenSim/Framework/ChildAgentDataUpdate.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index abff44a..7962ff4 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -311,6 +311,7 @@ namespace OpenSim.Framework public AgentGroupData[] Groups; public Animation[] Anims; + public Animation DefaultAnim = null; public UUID GranterID; public UUID ParentPart; @@ -397,6 +398,11 @@ namespace OpenSim.Framework args["animations"] = anims; } + if (DefaultAnim != null) + { + args["default_animation"] = DefaultAnim.PackUpdateMessage(); + } + if (Appearance != null) args["packed_appearance"] = Appearance.Pack(); @@ -594,6 +600,11 @@ namespace OpenSim.Framework } } + if (args["default_animation"] != null) + { + DefaultAnim = new Animation((OSDMap)args["default_animation"]); + } + //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) //{ // OSDArray textures = (OSDArray)(args["agent_textures"]); -- cgit v1.1 From 197163e12a265af66a9393bc6753c7a50520c5b1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 4 May 2012 21:00:41 +0200 Subject: Fix teleporting from older to newer regions --- OpenSim/Framework/ChildAgentDataUpdate.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 7962ff4..e718aa6 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -602,7 +602,14 @@ namespace OpenSim.Framework if (args["default_animation"] != null) { - DefaultAnim = new Animation((OSDMap)args["default_animation"]); + try + { + DefaultAnim = new Animation((OSDMap)args["default_animation"]); + } + catch + { + DefaultAnim = null; + } } //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) -- cgit v1.1 From 4ae0bb7df1774426ffa77898ac062a24bc6234f5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 7 Aug 2014 23:29:31 +0100 Subject: add limites checks on wearables size, revert to max 15 for compatibility/testing --- OpenSim/Framework/ChildAgentDataUpdate.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') 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 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) { OSDArray wears = (OSDArray)(args["wearables"]); - for (int i = 0; i < wears.Count / 2; i++) + + int count = wears.Count; + if (count > AvatarWearable.MAX_WEARABLES) + count = AvatarWearable.MAX_WEARABLES; + + for (int i = 0; i < count / 2; i++) { AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); Appearance.SetWearable(i,awear); -- cgit v1.1 From 447fd0850ae3e5e4165561185dca8e5f99904e75 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 15 Aug 2014 21:39:37 +0100 Subject: remove duplication of textures, wearables and attachments on crossings. receiver checks old method if it doesnt get packed appeareace --- OpenSim/Framework/ChildAgentDataUpdate.cs | 83 ++++++++++++++++++------------- 1 file changed, 49 insertions(+), 34 deletions(-) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 5beb37d..91df64d 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -431,6 +431,8 @@ namespace OpenSim.Framework // The code to pack textures, visuals, wearables and attachments // should be removed; packed appearance contains the full appearance // This is retained for backward compatibility only + +/* then lets remove if (Appearance.Texture != null) { byte[] rawtextures = Appearance.Texture.GetBytes(); @@ -459,7 +461,7 @@ namespace OpenSim.Framework args["attachments"] = attachs; } // End of code to remove - +*/ if ((Controllers != null) && (Controllers.Length > 0)) { OSDArray controls = new OSDArray(Controllers.Length); @@ -647,58 +649,71 @@ namespace OpenSim.Framework // AgentTextures[i++] = o.AsUUID(); //} - Appearance = new AvatarAppearance(); - // The code to unpack textures, visuals, wearables and attachments - // should be removed; packed appearance contains the full appearance - // This is retained for backward compatibility only - if (args["texture_entry"] != null) + // packed_appearence should contain all appearance information + if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) { - byte[] rawtextures = args["texture_entry"].AsBinary(); - Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length); - Appearance.SetTextureEntries(textures); + m_log.WarnFormat("[CHILDAGENTDATAUPDATE] got packed appearance"); + Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]); } + else + { + // if missing try the old pack method + m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance, checking old method"); - if (args["visual_params"] != null) - Appearance.SetVisualParams(args["visual_params"].AsBinary()); + Appearance = new AvatarAppearance(); - if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) - { - OSDArray wears = (OSDArray)(args["wearables"]); + // The code to unpack textures, visuals, wearables and attachments + // should be removed; packed appearance contains the full appearance + // This is retained for backward compatibility only + if (args["texture_entry"] != null) + { + byte[] rawtextures = args["texture_entry"].AsBinary(); + Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures, 0, rawtextures.Length); + Appearance.SetTextureEntries(textures); + } - int count = wears.Count; - if (count > AvatarWearable.MAX_WEARABLES) - count = AvatarWearable.MAX_WEARABLES; + if (args["visual_params"] != null) + Appearance.SetVisualParams(args["visual_params"].AsBinary()); - for (int i = 0; i < count / 2; i++) + if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) { - AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); - Appearance.SetWearable(i,awear); + OSDArray wears = (OSDArray)(args["wearables"]); + + int count = wears.Count; + if (count > AvatarWearable.MAX_WEARABLES) + count = AvatarWearable.MAX_WEARABLES; + + for (int i = 0; i < count / 2; i++) + { + AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); + Appearance.SetWearable(i, awear); + } } - } - if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) - { - OSDArray attachs = (OSDArray)(args["attachments"]); - foreach (OSD o in attachs) + if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) { - if (o.Type == OSDType.Map) + OSDArray attachs = (OSDArray)(args["attachments"]); + foreach (OSD o in attachs) { - // We know all of these must end up as attachments so we - // append rather than replace to ensure multiple attachments - // per point continues to work -// m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID); - Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); + if (o.Type == OSDType.Map) + { + // We know all of these must end up as attachments so we + // append rather than replace to ensure multiple attachments + // per point continues to work + // m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID); + Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); + } } } + // end of code to remove } - // end of code to remove - +/* moved above if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]); else m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); - +*/ if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) { OSDArray controls = (OSDArray)(args["controllers"]); -- cgit v1.1 From 016e58e354e11825510e1c4bc534e275168577bc Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 9 Sep 2014 21:53:27 +0100 Subject: *test* --- OpenSim/Framework/ChildAgentDataUpdate.cs | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 91df64d..538e1b5 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -349,6 +349,8 @@ namespace OpenSim.Framework public List AttachmentObjects; public List AttachmentObjectStates; + public Dictionary MovementAnimationOverRides = new Dictionary(); + public virtual OSDMap Pack() { // m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); @@ -417,6 +419,21 @@ namespace OpenSim.Framework args["animation_state"] = AnimState.PackUpdateMessage(); } + if (MovementAnimationOverRides.Count > 0) + { + OSDArray AOs = new OSDArray(MovementAnimationOverRides.Count); + { + foreach (KeyValuePair kvp in MovementAnimationOverRides) + { + OSDMap ao = new OSDMap(2); + ao["state"] = OSD.FromString(kvp.Key); + ao["uuid"] = OSD.FromUUID(kvp.Value); + AOs.Add(ao); + } + } + args["movementAO"] = AOs; + } + if (Appearance != null) args["packed_appearance"] = Appearance.Pack(); @@ -640,6 +657,25 @@ namespace OpenSim.Framework } } + MovementAnimationOverRides.Clear(); + + if (args["movementAO"] != null && args["movementAO"].Type == OSDType.Array) + { + OSDArray AOs = (OSDArray)(args["movementAO"]); + int count = AOs.Count; + + for (int i = 0; i < count; i++) + { + OSDMap ao = (OSDMap)AOs[i]; + if (ao["state"] != null && ao["uuid"] != null) + { + string state = ao["state"].AsString(); + UUID id = ao["uuid"].AsUUID(); + MovementAnimationOverRides[state] = id; + } + } + } + //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) //{ // OSDArray textures = (OSDArray)(args["agent_textures"]); -- cgit v1.1 From 2bea66ed27d86ddd7f34ee1e7d0292ae4f1c5644 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 17 Oct 2014 14:07:11 +0100 Subject: send motion control state in update to childs. Reset CollisionPlane on makechild --- OpenSim/Framework/ChildAgentDataUpdate.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 538e1b5..5078f69 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -320,6 +320,7 @@ namespace OpenSim.Framework public Animation[] Anims; public Animation DefaultAnim = null; public Animation AnimState = null; + public Byte MotionState = 0; public UUID GranterID; public UUID ParentPart; @@ -434,6 +435,11 @@ namespace OpenSim.Framework args["movementAO"] = AOs; } + if (MotionState != 0) + { + args["motion_state"] = OSD.FromInteger(MotionState); + } + if (Appearance != null) args["packed_appearance"] = Appearance.Pack(); @@ -676,6 +682,9 @@ namespace OpenSim.Framework } } + if (args.ContainsKey("motion_state")) + MotionState = (byte)args["motion_state"].AsInteger(); + //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) //{ // OSDArray textures = (OSDArray)(args["agent_textures"]); -- cgit v1.1 From f44c29effbd0d14427f288470aee028e9e09d6e3 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 19 Oct 2014 15:51:12 +0100 Subject: try to fix propagation of seeds to all relevante regions --- OpenSim/Framework/ChildAgentDataUpdate.cs | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 5078f69..0763bbc 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -94,6 +94,7 @@ namespace OpenSim.Framework // This probably shouldn't be here public byte[] Throttles; + public Dictionary ChildrenCapSeeds = null; public OSDMap Pack() { @@ -119,6 +120,19 @@ namespace OpenSim.Framework if ((Throttles != null) && (Throttles.Length > 0)) args["throttles"] = OSD.FromBinary(Throttles); + if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0) + { + OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); + foreach (KeyValuePair kvp in ChildrenCapSeeds) + { + OSDMap pair = new OSDMap(); + pair["handle"] = OSD.FromString(kvp.Key.ToString()); + pair["seed"] = OSD.FromString(kvp.Value); + childrenSeeds.Add(pair); + } + args["children_seeds"] = childrenSeeds; + } + return args; } @@ -165,6 +179,30 @@ namespace OpenSim.Framework if (args["throttles"] != null) Throttles = args["throttles"].AsBinary(); + + if (args.ContainsKey("children_seeds") && (args["children_seeds"] != null) && + (args["children_seeds"].Type == OSDType.Array)) + { + OSDArray childrenSeeds = (OSDArray)(args["children_seeds"]); + ChildrenCapSeeds = new Dictionary(); + foreach (OSD o in childrenSeeds) + { + if (o.Type == OSDType.Map) + { + ulong handle = 0; + string seed = ""; + OSDMap pair = (OSDMap)o; + if (pair["handle"] != null) + if (!UInt64.TryParse(pair["handle"].AsString(), out handle)) + continue; + if (pair["seed"] != null) + seed = pair["seed"].AsString(); + if (!ChildrenCapSeeds.ContainsKey(handle)) + ChildrenCapSeeds.Add(handle, seed); + } + } + } + } /// -- cgit v1.1 From afa9b4a002f0cc929d60e1770535eefcdefe3a43 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 20 Oct 2014 09:14:27 +0100 Subject: Assume childreen don't need to know caps seeds --- OpenSim/Framework/ChildAgentDataUpdate.cs | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 0763bbc..a714d86 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -355,6 +355,7 @@ namespace OpenSim.Framework public UUID ActiveGroupID; public AgentGroupData[] Groups; + public Dictionary ChildrenCapSeeds = null; public Animation[] Anims; public Animation DefaultAnim = null; public Animation AnimState = null; @@ -440,6 +441,19 @@ namespace OpenSim.Framework args["groups"] = groups; } + if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0) + { + OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count); + foreach (KeyValuePair kvp in ChildrenCapSeeds) + { + OSDMap pair = new OSDMap(); + pair["handle"] = OSD.FromString(kvp.Key.ToString()); + pair["seed"] = OSD.FromString(kvp.Value); + childrenSeeds.Add(pair); + } + args["children_seeds"] = childrenSeeds; + } + if ((Anims != null) && (Anims.Length > 0)) { OSDArray anims = new OSDArray(Anims.Length); @@ -663,6 +677,29 @@ namespace OpenSim.Framework } } + if (args.ContainsKey("children_seeds") && (args["children_seeds"] != null) && + (args["children_seeds"].Type == OSDType.Array)) + { + OSDArray childrenSeeds = (OSDArray)(args["children_seeds"]); + ChildrenCapSeeds = new Dictionary(); + foreach (OSD o in childrenSeeds) + { + if (o.Type == OSDType.Map) + { + ulong handle = 0; + string seed = ""; + OSDMap pair = (OSDMap)o; + if (pair["handle"] != null) + if (!UInt64.TryParse(pair["handle"].AsString(), out handle)) + continue; + if (pair["seed"] != null) + seed = pair["seed"].AsString(); + if (!ChildrenCapSeeds.ContainsKey(handle)) + ChildrenCapSeeds.Add(handle, seed); + } + } + } + if ((args["animations"] != null) && (args["animations"]).Type == OSDType.Array) { OSDArray anims = (OSDArray)(args["animations"]); -- cgit v1.1