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') 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