Assume childreen don't need to know caps seeds
parent
f44c29effb
commit
afa9b4a002
|
@ -355,6 +355,7 @@ namespace OpenSim.Framework
|
||||||
public UUID ActiveGroupID;
|
public UUID ActiveGroupID;
|
||||||
|
|
||||||
public AgentGroupData[] Groups;
|
public AgentGroupData[] Groups;
|
||||||
|
public Dictionary<ulong, string> ChildrenCapSeeds = null;
|
||||||
public Animation[] Anims;
|
public Animation[] Anims;
|
||||||
public Animation DefaultAnim = null;
|
public Animation DefaultAnim = null;
|
||||||
public Animation AnimState = null;
|
public Animation AnimState = null;
|
||||||
|
@ -440,6 +441,19 @@ namespace OpenSim.Framework
|
||||||
args["groups"] = groups;
|
args["groups"] = groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ChildrenCapSeeds != null && ChildrenCapSeeds.Count > 0)
|
||||||
|
{
|
||||||
|
OSDArray childrenSeeds = new OSDArray(ChildrenCapSeeds.Count);
|
||||||
|
foreach (KeyValuePair<ulong, string> 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))
|
if ((Anims != null) && (Anims.Length > 0))
|
||||||
{
|
{
|
||||||
OSDArray anims = new OSDArray(Anims.Length);
|
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<ulong, string>();
|
||||||
|
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)
|
if ((args["animations"] != null) && (args["animations"]).Type == OSDType.Array)
|
||||||
{
|
{
|
||||||
OSDArray anims = (OSDArray)(args["animations"]);
|
OSDArray anims = (OSDArray)(args["animations"]);
|
||||||
|
|
|
@ -1655,13 +1655,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
int ts = Util.EnvironmentTickCount();
|
int ts = Util.EnvironmentTickCount();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
AgentData cAgent = new AgentData();
|
AgentData cAgent = new AgentData();
|
||||||
agent.CopyTo(cAgent);
|
agent.CopyTo(cAgent);
|
||||||
|
|
||||||
// agent.Appearance.WearableCacheItems = null;
|
// agent.Appearance.WearableCacheItems = null;
|
||||||
|
|
||||||
cAgent.Position = pos;
|
cAgent.Position = pos;
|
||||||
|
|
||||||
|
cAgent.ChildrenCapSeeds = agent.KnownRegions;
|
||||||
|
|
||||||
if (isFlying)
|
if (isFlying)
|
||||||
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
||||||
|
|
||||||
|
@ -1707,8 +1709,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
bool isFlying, string version)
|
bool isFlying, string version)
|
||||||
{
|
{
|
||||||
|
|
||||||
agent.ControllingClient.RequestClientInfo();
|
|
||||||
|
|
||||||
string agentcaps;
|
string agentcaps;
|
||||||
if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
|
if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
|
||||||
{
|
{
|
||||||
|
@ -1719,8 +1719,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
// No turning back
|
// No turning back
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
agent.IsChildAgent = true;
|
agent.IsChildAgent = true;
|
||||||
|
|
||||||
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
|
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
|
||||||
|
@ -1732,7 +1730,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (m_eqModule != null)
|
if (m_eqModule != null)
|
||||||
{
|
{
|
||||||
m_eqModule.CrossRegion(
|
m_eqModule.CrossRegion(
|
||||||
neighbourRegion.RegionHandle, pos + agent.Velocity, vel2 /* agent.Velocity */,
|
neighbourRegion.RegionHandle, pos, vel2 /* agent.Velocity */,
|
||||||
neighbourRegion.ExternalEndPoint,
|
neighbourRegion.ExternalEndPoint,
|
||||||
capsPath, agent.UUID, agent.ControllingClient.SessionId,
|
capsPath, agent.UUID, agent.ControllingClient.SessionId,
|
||||||
neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
|
neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
|
||||||
|
@ -1740,7 +1738,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader);
|
m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader);
|
||||||
agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos + agent.Velocity, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||||
capsPath);
|
capsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1866,13 +1864,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||||
seeds.Add(regionhandler, agent.CapsPath);
|
seeds.Add(regionhandler, agent.CapsPath);
|
||||||
|
|
||||||
agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
|
// agent.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
|
||||||
|
agent.ChildrenCapSeeds = null;
|
||||||
|
|
||||||
if (sp.Scene.CapsModule != null)
|
if (sp.Scene.CapsModule != null)
|
||||||
{
|
{
|
||||||
sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, seeds);
|
sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, seeds);
|
||||||
}
|
}
|
||||||
|
|
||||||
sp.KnownRegions = seeds;
|
sp.KnownRegions = seeds;
|
||||||
|
|
||||||
if (currentAgentCircuit != null)
|
if (currentAgentCircuit != null)
|
||||||
|
@ -1884,7 +1882,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
agent.Mac = currentAgentCircuit.Mac;
|
agent.Mac = currentAgentCircuit.Mac;
|
||||||
agent.Id0 = currentAgentCircuit.Id0;
|
agent.Id0 = currentAgentCircuit.Id0;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
AgentPosition agentpos = null;
|
AgentPosition agentpos = null;
|
||||||
|
|
||||||
if (oldregions.Count > 0)
|
if (oldregions.Count > 0)
|
||||||
|
@ -1901,7 +1899,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
agentpos.Throttles = sp.ControllingClient.GetThrottlesPacked(1);
|
agentpos.Throttles = sp.ControllingClient.GetThrottlesPacked(1);
|
||||||
agentpos.ChildrenCapSeeds = seeds;
|
agentpos.ChildrenCapSeeds = seeds;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
IPEndPoint external = region.ExternalEndPoint;
|
IPEndPoint external = region.ExternalEndPoint;
|
||||||
if (external != null)
|
if (external != null)
|
||||||
{
|
{
|
||||||
|
@ -1910,7 +1908,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
InformClientOfNeighbourCompleted,
|
InformClientOfNeighbourCompleted,
|
||||||
d);
|
d);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if(oldregions.Count >0)
|
if(oldregions.Count >0)
|
||||||
{
|
{
|
||||||
uint neighbourx;
|
uint neighbourx;
|
||||||
|
@ -1924,6 +1922,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
sp.Scene.SimulationService.UpdateAgent(neighbour, agentpos);
|
sp.Scene.SimulationService.UpdateAgent(neighbour, agentpos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1943,7 +1942,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// assumes that out of view range regions are disconnected by the previus region
|
// assumes that out of view range regions are disconnected by the previus region
|
||||||
|
|
||||||
List<GridRegion> neighbours = new List<GridRegion>();
|
List<GridRegion> neighbours = new List<GridRegion>();
|
||||||
RegionInfo m_regionInfo = sp.Scene.RegionInfo;
|
Scene spScene = sp.Scene;
|
||||||
|
RegionInfo m_regionInfo = spScene.RegionInfo;
|
||||||
|
|
||||||
if (m_regionInfo != null)
|
if (m_regionInfo != null)
|
||||||
{
|
{
|
||||||
|
@ -1954,13 +1954,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.Debug("[ENTITY TRANSFER MODULE]: m_regionInfo was null in EnableChildAgents, is this a NPC?");
|
m_log.Debug("[ENTITY TRANSFER MODULE]: m_regionInfo was null in EnableChildAgents, is this a NPC?");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ulong currentRegionHandler = m_regionInfo.RegionHandle;
|
||||||
|
|
||||||
LinkedList<ulong> previousRegionNeighbourHandles;
|
LinkedList<ulong> previousRegionNeighbourHandles;
|
||||||
|
|
||||||
Dictionary<ulong, string> seeds;
|
Dictionary<ulong, string> seeds;
|
||||||
|
ICapabilitiesModule capsModule = spScene.CapsModule;
|
||||||
|
|
||||||
if (sp.Scene.CapsModule != null)
|
if (capsModule != null)
|
||||||
{
|
{
|
||||||
seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
|
seeds = new Dictionary<ulong, string>(capsModule.GetChildrenSeeds(sp.UUID));
|
||||||
previousRegionNeighbourHandles = new LinkedList<ulong>(seeds.Keys);
|
previousRegionNeighbourHandles = new LinkedList<ulong>(seeds.Keys);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1969,16 +1971,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
previousRegionNeighbourHandles = new LinkedList<ulong>();
|
previousRegionNeighbourHandles = new LinkedList<ulong>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!seeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle))
|
IClientAPI spClient = sp.ControllingClient;
|
||||||
seeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath);
|
|
||||||
|
|
||||||
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
if (!seeds.ContainsKey(currentRegionHandler))
|
||||||
|
seeds.Add(currentRegionHandler, spClient.RequestClientInfo().CapsPath);
|
||||||
|
|
||||||
|
AgentCircuitData currentAgentCircuit =
|
||||||
|
spScene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
||||||
|
|
||||||
List<AgentCircuitData> cagents = new List<AgentCircuitData>();
|
List<AgentCircuitData> cagents = new List<AgentCircuitData>();
|
||||||
List<ulong> newneighbours = new List<ulong>();
|
List<ulong> newneighbours = new List<ulong>();
|
||||||
|
|
||||||
ulong currentRegionHandler = sp.Scene.RegionInfo.RegionHandle;
|
|
||||||
|
|
||||||
foreach (GridRegion neighbour in neighbours)
|
foreach (GridRegion neighbour in neighbours)
|
||||||
{
|
{
|
||||||
ulong handler = neighbour.RegionHandle;
|
ulong handler = neighbour.RegionHandle;
|
||||||
|
@ -1994,7 +1997,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// a new region to add
|
// a new region to add
|
||||||
AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
|
AgentCircuitData agent = spClient.RequestClientInfo();
|
||||||
agent.BaseFolder = UUID.Zero;
|
agent.BaseFolder = UUID.Zero;
|
||||||
agent.InventoryFolder = UUID.Zero;
|
agent.InventoryFolder = UUID.Zero;
|
||||||
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
|
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
|
||||||
|
@ -2015,6 +2018,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
newneighbours.Add(handler);
|
newneighbours.Add(handler);
|
||||||
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
agent.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||||
seeds.Add(handler, agent.CapsPath);
|
seeds.Add(handler, agent.CapsPath);
|
||||||
|
|
||||||
|
agent.ChildrenCapSeeds = null;
|
||||||
cagents.Add(agent);
|
cagents.Add(agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2026,25 +2031,25 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
seeds.Remove(handler);
|
seeds.Remove(handler);
|
||||||
|
|
||||||
/// Update all child agent with everyone's seeds
|
/// Update all child agent with everyone's seeds
|
||||||
foreach (AgentCircuitData a in cagents)
|
// foreach (AgentCircuitData a in cagents)
|
||||||
a.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
|
// a.ChildrenCapSeeds = new Dictionary<ulong, string>(seeds);
|
||||||
|
|
||||||
if (sp.Scene.CapsModule != null)
|
if (capsModule != null)
|
||||||
sp.Scene.CapsModule.SetChildrenSeed(sp.UUID, seeds);
|
capsModule.SetChildrenSeed(sp.UUID, seeds);
|
||||||
|
|
||||||
sp.KnownRegions = seeds;
|
sp.KnownRegions = seeds;
|
||||||
|
|
||||||
AgentPosition agentpos = new AgentPosition();
|
AgentPosition agentpos = new AgentPosition();
|
||||||
agentpos.AgentID = new UUID(sp.UUID.Guid);
|
agentpos.AgentID = new UUID(sp.UUID.Guid);
|
||||||
agentpos.SessionID = sp.ControllingClient.SessionId;
|
agentpos.SessionID = spClient.SessionId;
|
||||||
agentpos.Size = sp.Appearance.AvatarSize;
|
agentpos.Size = sp.Appearance.AvatarSize;
|
||||||
agentpos.Center = sp.CameraPosition;
|
agentpos.Center = sp.CameraPosition;
|
||||||
agentpos.Far = sp.DrawDistance;
|
agentpos.Far = sp.DrawDistance;
|
||||||
agentpos.Position = sp.AbsolutePosition;
|
agentpos.Position = sp.AbsolutePosition;
|
||||||
agentpos.Velocity = sp.Velocity;
|
agentpos.Velocity = sp.Velocity;
|
||||||
agentpos.RegionHandle = currentRegionHandler;
|
agentpos.RegionHandle = currentRegionHandler;
|
||||||
agentpos.Throttles = sp.ControllingClient.GetThrottlesPacked(1);
|
agentpos.Throttles = spClient.GetThrottlesPacked(1);
|
||||||
agentpos.ChildrenCapSeeds = seeds;
|
// agentpos.ChildrenCapSeeds = seeds;
|
||||||
|
|
||||||
if (neighbours.Count - previousRegionNeighbourHandles.Count > 0)
|
if (neighbours.Count - previousRegionNeighbourHandles.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -2066,7 +2071,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
else if(!previousRegionNeighbourHandles.Contains(handler))
|
else if(!previousRegionNeighbourHandles.Contains(handler))
|
||||||
{
|
{
|
||||||
sp.Scene.SimulationService.UpdateAgent(neighbour, agentpos);
|
spScene.SimulationService.UpdateAgent(neighbour, agentpos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
|
|
|
@ -4262,6 +4262,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// DrawDistance = cAgent.Far;
|
// DrawDistance = cAgent.Far;
|
||||||
DrawDistance = Scene.DefaultDrawDistance;
|
DrawDistance = Scene.DefaultDrawDistance;
|
||||||
|
|
||||||
|
if (cAgent.ChildrenCapSeeds != null && cAgent.ChildrenCapSeeds.Count > 0)
|
||||||
|
{
|
||||||
|
if (Scene.CapsModule != null)
|
||||||
|
{
|
||||||
|
Scene.CapsModule.SetChildrenSeed(UUID, cAgent.ChildrenCapSeeds);
|
||||||
|
}
|
||||||
|
KnownRegions = cAgent.ChildrenCapSeeds;
|
||||||
|
}
|
||||||
|
|
||||||
if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
|
if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
|
||||||
ControllingClient.SetChildAgentThrottle(cAgent.Throttles);
|
ControllingClient.SetChildAgentThrottle(cAgent.Throttles);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue