aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2014-10-20 09:14:27 +0100
committerUbitUmarov2014-10-20 09:14:27 +0100
commitafa9b4a002f0cc929d60e1770535eefcdefe3a43 (patch)
tree8e5f9fd00aa720759c7ba2a5383f681d01349448
parent try to fix propagation of seeds to all relevante regions (diff)
downloadopensim-SC_OLD-afa9b4a002f0cc929d60e1770535eefcdefe3a43.zip
opensim-SC_OLD-afa9b4a002f0cc929d60e1770535eefcdefe3a43.tar.gz
opensim-SC_OLD-afa9b4a002f0cc929d60e1770535eefcdefe3a43.tar.bz2
opensim-SC_OLD-afa9b4a002f0cc929d60e1770535eefcdefe3a43.tar.xz
Assume childreen don't need to know caps seeds
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs37
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs71
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs9
3 files changed, 84 insertions, 33 deletions
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
355 public UUID ActiveGroupID; 355 public UUID ActiveGroupID;
356 356
357 public AgentGroupData[] Groups; 357 public AgentGroupData[] Groups;
358 public Dictionary<ulong, string> ChildrenCapSeeds = null;
358 public Animation[] Anims; 359 public Animation[] Anims;
359 public Animation DefaultAnim = null; 360 public Animation DefaultAnim = null;
360 public Animation AnimState = null; 361 public Animation AnimState = null;
@@ -440,6 +441,19 @@ namespace OpenSim.Framework
440 args["groups"] = groups; 441 args["groups"] = groups;
441 } 442 }
442 443
444 if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0)
445 {
446 OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count);
447 foreach (KeyValuePair<ulong, string> kvp in ChildrenCapSeeds)
448 {
449 OSDMap pair = new OSDMap();
450 pair["handle"] = OSD.FromString(kvp.Key.ToString());
451 pair["seed"] = OSD.FromString(kvp.Value);
452 childrenSeeds.Add(pair);
453 }
454 args["children_seeds"] = childrenSeeds;
455 }
456
443 if ((Anims != null) && (Anims.Length > 0)) 457 if ((Anims != null) && (Anims.Length > 0))
444 { 458 {
445 OSDArray anims = new OSDArray(Anims.Length); 459 OSDArray anims = new OSDArray(Anims.Length);
@@ -663,6 +677,29 @@ namespace OpenSim.Framework
663 } 677 }
664 } 678 }
665 679
680 if (args.ContainsKey("children_seeds") && (args["children_seeds"] != null) &&
681 (args["children_seeds"].Type == OSDType.Array))
682 {
683 OSDArray childrenSeeds = (OSDArray)(args["children_seeds"]);
684 ChildrenCapSeeds = new Dictionary<ulong, string>();
685 foreach (OSD o in childrenSeeds)
686 {
687 if (o.Type == OSDType.Map)
688 {
689 ulong handle = 0;
690 string seed = "";
691 OSDMap pair = (OSDMap)o;
692 if (pair["handle"] != null)
693 if (!UInt64.TryParse(pair["handle"].AsString(), out handle))
694 continue;
695 if (pair["seed"] != null)
696 seed = pair["seed"].AsString();
697 if (!ChildrenCapSeeds.ContainsKey(handle))
698 ChildrenCapSeeds.Add(handle, seed);
699 }
700 }
701 }
702
666 if ((args["animations"] != null) && (args["animations"]).Type == OSDType.Array) 703 if ((args["animations"] != null) && (args["animations"]).Type == OSDType.Array)
667 { 704 {
668 OSDArray anims = (OSDArray)(args["animations"]); 705 OSDArray anims = (OSDArray)(args["animations"]);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 87a0ff6..19f748a 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1655,13 +1655,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1655 int ts = Util.EnvironmentTickCount(); 1655 int ts = Util.EnvironmentTickCount();
1656 try 1656 try
1657 { 1657 {
1658
1659 AgentData cAgent = new AgentData(); 1658 AgentData cAgent = new AgentData();
1660 agent.CopyTo(cAgent); 1659 agent.CopyTo(cAgent);
1661 1660
1662// agent.Appearance.WearableCacheItems = null; 1661// agent.Appearance.WearableCacheItems = null;
1663 1662
1664 cAgent.Position = pos; 1663 cAgent.Position = pos;
1664
1665 cAgent.ChildrenCapSeeds = agent.KnownRegions;
1666
1665 if (isFlying) 1667 if (isFlying)
1666 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 1668 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
1667 1669
@@ -1707,8 +1709,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1707 bool isFlying, string version) 1709 bool isFlying, string version)
1708 { 1710 {
1709 1711
1710 agent.ControllingClient.RequestClientInfo();
1711
1712 string agentcaps; 1712 string agentcaps;
1713 if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps)) 1713 if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
1714 { 1714 {
@@ -1719,8 +1719,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1719 1719
1720 // No turning back 1720 // No turning back
1721 1721
1722
1723
1724 agent.IsChildAgent = true; 1722 agent.IsChildAgent = true;
1725 1723
1726 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); 1724 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
@@ -1732,7 +1730,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1732 if (m_eqModule != null) 1730 if (m_eqModule != null)
1733 { 1731 {
1734 m_eqModule.CrossRegion( 1732 m_eqModule.CrossRegion(
1735 neighbourRegion.RegionHandle, pos + agent.Velocity, vel2 /* agent.Velocity */, 1733 neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */,
1736 neighbourRegion.ExternalEndPoint, 1734 neighbourRegion.ExternalEndPoint,
1737 capsPath, agent.UUID, agent.ControllingClient.SessionId, 1735 capsPath, agent.UUID, agent.ControllingClient.SessionId,
1738 neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); 1736 neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
@@ -1740,7 +1738,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1740 else 1738 else
1741 { 1739 {
1742 m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader); 1740 m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader);
1743 agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos + agent.Velocity, agent.Velocity, neighbourRegion.ExternalEndPoint, 1741 agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1744 capsPath); 1742 capsPath);
1745 } 1743 }
1746 1744
@@ -1866,13 +1864,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1866 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 1864 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
1867 seeds.Add(regionhandler, agent.CapsPath); 1865 seeds.Add(regionhandler, agent.CapsPath);
1868 1866
1869 agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); 1867// agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
1870 1868 agent.ChildrenCapSeeds = null;
1869
1871 if (sp.Scene.CapsModule != null) 1870 if (sp.Scene.CapsModule != null)
1872 { 1871 {
1873 sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, seeds); 1872 sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, seeds);
1874 } 1873 }
1875
1876 sp.KnownRegions = seeds; 1874 sp.KnownRegions = seeds;
1877 1875
1878 if (currentAgentCircuit != null) 1876 if (currentAgentCircuit != null)
@@ -1884,7 +1882,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1884 agent.Mac = currentAgentCircuit.Mac; 1882 agent.Mac = currentAgentCircuit.Mac;
1885 agent.Id0 = currentAgentCircuit.Id0; 1883 agent.Id0 = currentAgentCircuit.Id0;
1886 } 1884 }
1887 1885/*
1888 AgentPosition agentpos = null; 1886 AgentPosition agentpos = null;
1889 1887
1890 if (oldregions.Count > 0) 1888 if (oldregions.Count > 0)
@@ -1901,7 +1899,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1901 agentpos.Throttles = sp.ControllingClient.GetThrottlesPacked(1); 1899 agentpos.Throttles = sp.ControllingClient.GetThrottlesPacked(1);
1902 agentpos.ChildrenCapSeeds = seeds; 1900 agentpos.ChildrenCapSeeds = seeds;
1903 } 1901 }
1904 1902*/
1905 IPEndPoint external = region.ExternalEndPoint; 1903 IPEndPoint external = region.ExternalEndPoint;
1906 if (external != null) 1904 if (external != null)
1907 { 1905 {
@@ -1910,7 +1908,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1910 InformClientOfNeighbourCompleted, 1908 InformClientOfNeighbourCompleted,
1911 d); 1909 d);
1912 } 1910 }
1913 1911/*
1914 if(oldregions.Count >0) 1912 if(oldregions.Count >0)
1915 { 1913 {
1916 uint neighbourx; 1914 uint neighbourx;
@@ -1924,6 +1922,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1924 sp.Scene.SimulationService.UpdateAgent(neighbour, agentpos); 1922 sp.Scene.SimulationService.UpdateAgent(neighbour, agentpos);
1925 } 1923 }
1926 } 1924 }
1925 */
1927 } 1926 }
1928 1927
1929 #endregion 1928 #endregion
@@ -1943,7 +1942,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1943 // assumes that out of view range regions are disconnected by the previus region 1942 // assumes that out of view range regions are disconnected by the previus region
1944 1943
1945 List<GridRegion> neighbours = new List<GridRegion>(); 1944 List<GridRegion> neighbours = new List<GridRegion>();
1946 RegionInfo m_regionInfo = sp.Scene.RegionInfo; 1945 Scene spScene = sp.Scene;
1946 RegionInfo m_regionInfo = spScene.RegionInfo;
1947 1947
1948 if (m_regionInfo != null) 1948 if (m_regionInfo != null)
1949 { 1949 {
@@ -1954,13 +1954,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1954 m_log.Debug("[ENTITY TRANSFER MODULE]: m_regionInfo was null in EnableChildAgents, is this a NPC?"); 1954 m_log.Debug("[ENTITY TRANSFER MODULE]: m_regionInfo was null in EnableChildAgents, is this a NPC?");
1955 } 1955 }
1956 1956
1957 LinkedList<ulong> previousRegionNeighbourHandles; 1957 ulong currentRegionHandler = m_regionInfo.RegionHandle;
1958 1958
1959 LinkedList<ulong> previousRegionNeighbourHandles;
1959 Dictionary<ulong, string> seeds; 1960 Dictionary<ulong, string> seeds;
1960 1961 ICapabilitiesModule capsModule = spScene.CapsModule;
1961 if (sp.Scene.CapsModule != null) 1962
1963 if (capsModule != null)
1962 { 1964 {
1963 seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); 1965 seeds = new Dictionary<ulong, string>(capsModule.GetChildrenSeeds(sp.UUID));
1964 previousRegionNeighbourHandles = new LinkedList<ulong>(seeds.Keys); 1966 previousRegionNeighbourHandles = new LinkedList<ulong>(seeds.Keys);
1965 } 1967 }
1966 else 1968 else
@@ -1969,16 +1971,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1969 previousRegionNeighbourHandles = new LinkedList<ulong>(); 1971 previousRegionNeighbourHandles = new LinkedList<ulong>();
1970 } 1972 }
1971 1973
1972 if (!seeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle)) 1974 IClientAPI spClient = sp.ControllingClient;
1973 seeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath);
1974 1975
1975 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 1976 if (!seeds.ContainsKey(currentRegionHandler))
1977 seeds.Add(currentRegionHandler, spClient.RequestClientInfo().CapsPath);
1978
1979 AgentCircuitData currentAgentCircuit =
1980 spScene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
1976 1981
1977 List<AgentCircuitData> cagents = new List<AgentCircuitData>(); 1982 List<AgentCircuitData> cagents = new List<AgentCircuitData>();
1978 List<ulong> newneighbours = new List<ulong>(); 1983 List<ulong> newneighbours = new List<ulong>();
1979 1984
1980 ulong currentRegionHandler = sp.Scene.RegionInfo.RegionHandle;
1981
1982 foreach (GridRegion neighbour in neighbours) 1985 foreach (GridRegion neighbour in neighbours)
1983 { 1986 {
1984 ulong handler = neighbour.RegionHandle; 1987 ulong handler = neighbour.RegionHandle;
@@ -1994,7 +1997,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1994 continue; 1997 continue;
1995 1998
1996 // a new region to add 1999 // a new region to add
1997 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); 2000 AgentCircuitData agent = spClient.RequestClientInfo();
1998 agent.BaseFolder = UUID.Zero; 2001 agent.BaseFolder = UUID.Zero;
1999 agent.InventoryFolder = UUID.Zero; 2002 agent.InventoryFolder = UUID.Zero;
2000 agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour); 2003 agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
@@ -2015,6 +2018,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2015 newneighbours.Add(handler); 2018 newneighbours.Add(handler);
2016 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 2019 agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
2017 seeds.Add(handler, agent.CapsPath); 2020 seeds.Add(handler, agent.CapsPath);
2021
2022 agent.ChildrenCapSeeds = null;
2018 cagents.Add(agent); 2023 cagents.Add(agent);
2019 } 2024 }
2020 2025
@@ -2026,25 +2031,25 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2026 seeds.Remove(handler); 2031 seeds.Remove(handler);
2027 2032
2028 /// Update all child agent with everyone's seeds 2033 /// Update all child agent with everyone's seeds
2029 foreach (AgentCircuitData a in cagents) 2034// foreach (AgentCircuitData a in cagents)
2030 a.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds); 2035// a.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
2031 2036
2032 if (sp.Scene.CapsModule != null) 2037 if (capsModule != null)
2033 sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, seeds); 2038 capsModule.SetChildrenSeed(sp.UUID, seeds);
2034 2039
2035 sp.KnownRegions = seeds; 2040 sp.KnownRegions = seeds;
2036 2041
2037 AgentPosition agentpos = new AgentPosition(); 2042 AgentPosition agentpos = new AgentPosition();
2038 agentpos.AgentID = new UUID(sp.UUID.Guid); 2043 agentpos.AgentID = new UUID(sp.UUID.Guid);
2039 agentpos.SessionID = sp.ControllingClient.SessionId; 2044 agentpos.SessionID = spClient.SessionId;
2040 agentpos.Size = sp.Appearance.AvatarSize; 2045 agentpos.Size = sp.Appearance.AvatarSize;
2041 agentpos.Center = sp.CameraPosition; 2046 agentpos.Center = sp.CameraPosition;
2042 agentpos.Far = sp.DrawDistance; 2047 agentpos.Far = sp.DrawDistance;
2043 agentpos.Position = sp.AbsolutePosition; 2048 agentpos.Position = sp.AbsolutePosition;
2044 agentpos.Velocity = sp.Velocity; 2049 agentpos.Velocity = sp.Velocity;
2045 agentpos.RegionHandle = currentRegionHandler; 2050 agentpos.RegionHandle = currentRegionHandler;
2046 agentpos.Throttles = sp.ControllingClient.GetThrottlesPacked(1); 2051 agentpos.Throttles = spClient.GetThrottlesPacked(1);
2047 agentpos.ChildrenCapSeeds = seeds; 2052// agentpos.ChildrenCapSeeds = seeds;
2048 2053
2049 if (neighbours.Count - previousRegionNeighbourHandles.Count > 0) 2054 if (neighbours.Count - previousRegionNeighbourHandles.Count > 0)
2050 { 2055 {
@@ -2066,7 +2071,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2066 } 2071 }
2067 else if(!previousRegionNeighbourHandles.Contains(handler)) 2072 else if(!previousRegionNeighbourHandles.Contains(handler))
2068 { 2073 {
2069 sp.Scene.SimulationService.UpdateAgent(neighbour, agentpos); 2074 spScene.SimulationService.UpdateAgent(neighbour, agentpos);
2070 } 2075 }
2071 } 2076 }
2072 catch (ArgumentOutOfRangeException) 2077 catch (ArgumentOutOfRangeException)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 405ad73..754dd96 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -4262,6 +4262,15 @@ namespace OpenSim.Region.Framework.Scenes
4262 // DrawDistance = cAgent.Far; 4262 // DrawDistance = cAgent.Far;
4263 DrawDistance = Scene.DefaultDrawDistance; 4263 DrawDistance = Scene.DefaultDrawDistance;
4264 4264
4265 if (cAgent.ChildrenCapSeeds != null && cAgent.ChildrenCapSeeds.Count > 0)
4266 {
4267 if (Scene.CapsModule != null)
4268 {
4269 Scene.CapsModule.SetChildrenSeed(UUID, cAgent.ChildrenCapSeeds);
4270 }
4271 KnownRegions = cAgent.ChildrenCapSeeds;
4272 }
4273
4265 if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) 4274 if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
4266 ControllingClient.SetChildAgentThrottle(cAgent.Throttles); 4275 ControllingClient.SetChildAgentThrottle(cAgent.Throttles);
4267 4276