try to make child presence know its root region. Incomplete, some paths dont send the information.
parent
b871029a30
commit
38fc1cc445
|
@ -990,7 +990,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
sp.HasMovedAway(nearRegion);
|
||||
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
sp.MakeChildAgent(destinationHandle);
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
|
||||
|
@ -1009,11 +1009,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
|
||||
sp.Scene.CloseAgent(sp.UUID, false);
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
// now we have a child agent in this region.
|
||||
sp.Reset();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
|
||||
|
@ -1158,7 +1160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// KillEntity(sp.Scene, sp.LocalId);
|
||||
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
sp.MakeChildAgent(destinationHandle);
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
|
@ -1182,11 +1184,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
|
||||
sp.Scene.CloseAgent(sp.UUID, false);
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
// now we have a child agent in this region.
|
||||
sp.Reset();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1792,7 +1796,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
|
||||
// AgentHasMovedAway(agent, true);
|
||||
|
||||
agent.MakeChildAgent();
|
||||
agent.MakeChildAgent(neighbourRegion.RegionHandle);
|
||||
|
||||
// FIXME: Possibly this should occur lower down after other commands to close other agents,
|
||||
// but not sure yet what the side effects would be.
|
||||
|
@ -1869,7 +1873,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
|
||||
agent.BaseFolder = UUID.Zero;
|
||||
agent.InventoryFolder = UUID.Zero;
|
||||
agent.startpos = new Vector3(128, 128, 70);
|
||||
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, region);
|
||||
agent.child = true;
|
||||
|
||||
agent.Appearance = new AvatarAppearance();
|
||||
|
|
|
@ -1162,45 +1162,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene);
|
||||
|
||||
/* this should be done by groups module on TriggerOnMakeRootAgent(this) below
|
||||
at least XmlIRpcGroups
|
||||
UUID groupUUID = UUID.Zero;
|
||||
string GroupName = string.Empty;
|
||||
ulong groupPowers = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// ----------------------------------
|
||||
// Previous Agent Difference - AGNI sends an unsolicited AgentDataUpdate upon root agent status
|
||||
try
|
||||
{
|
||||
|
||||
if (gm != null)
|
||||
{
|
||||
groupUUID = ControllingClient.ActiveGroupId;
|
||||
GroupRecord record = gm.GetGroupRecord(groupUUID);
|
||||
if (record != null)
|
||||
GroupName = record.GroupName;
|
||||
GroupMembershipData groupMembershipData = gm.GetMembershipData(groupUUID, m_uuid);
|
||||
if (groupMembershipData != null)
|
||||
groupPowers = groupMembershipData.GroupPowers;
|
||||
}
|
||||
ControllingClient.SendAgentDataUpdate(m_uuid, groupUUID, Firstname, Lastname, groupPowers, GroupName,
|
||||
Grouptitle);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[AGENTUPDATE]: " + e.ToString());
|
||||
}
|
||||
// ------------------------------------
|
||||
*/
|
||||
if (ParentID == 0)
|
||||
{
|
||||
// Moved this from SendInitialData to ensure that Appearance is initialized
|
||||
// before the inventory is processed in MakeRootAgent. This fixes a race condition
|
||||
// related to the handling of attachments
|
||||
|
||||
if (m_scene.TestBorderCross(pos, Cardinals.E))
|
||||
{
|
||||
Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E);
|
||||
|
@ -1310,11 +1274,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// It doesn't get called for a teleport. Reason being, an agent that
|
||||
/// teleports out may not end up anywhere near this region
|
||||
/// </remarks>
|
||||
public void MakeChildAgent()
|
||||
public void MakeChildAgent(ulong newRegionHandle)
|
||||
{
|
||||
m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd;
|
||||
|
||||
m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1}", Name, Scene.RegionInfo.RegionName);
|
||||
RegionHandle = newRegionHandle;
|
||||
|
||||
m_log.DebugFormat("[SCENE PRESENCE]: Making {0} a child agent in {1} from root region {2}",
|
||||
Name, Scene.RegionInfo.RegionName, newRegionHandle);
|
||||
|
||||
// Reset the m_originRegionID as it has dual use as a flag to signal that the UpdateAgent() call orignating
|
||||
// from the source simulator has completed on a V2 teleport.
|
||||
|
@ -4023,6 +3990,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
}
|
||||
|
||||
/* useless. Either use MakeChild or delete the presence
|
||||
public void Reset()
|
||||
{
|
||||
// m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName);
|
||||
|
@ -4033,7 +4001,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
Animator.ResetAnimations();
|
||||
}
|
||||
|
||||
*/
|
||||
/// <summary>
|
||||
/// Computes which child agents to close when the scene presence moves to another region.
|
||||
/// Removes those regions from m_knownRegions.
|
||||
|
|
Loading…
Reference in New Issue