mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Fix an issue where under teleport v2 protocol, teleporting from regions in an line from A->B->C would not close region A when reaching C
The root cause was that v2 was only closing neighbour agents if the root connection also needed a close. However, fixing this requires the neighbour regions also detect when they should not close due to re-teleports re-establishing the child connection. This involves restructuring the code to introduce a scene presence state machine that can serialize the different add and remove client calls that are now possible with the late close of the This commit appears to fix these issues and improve teleport, but still has holes on at least quick reteleporting (and possibly occasionally on ordinary teleports). Also, has not been completely tested yet in scenarios where regions are running on different simulators
This commit is contained in:
@@ -1064,8 +1064,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
// May still need to signal neighbours whether child agents may need closing irrespective of whether this
|
||||
// one needed closing. Neighbour regions also contain logic to prevent a close if a subsequent move or
|
||||
// teleport re-established the child connection.
|
||||
sp.CloseChildAgents(newRegionX, newRegionY);
|
||||
|
||||
// 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))
|
||||
{
|
||||
sp.DoNotCloseAfterTeleport = false;
|
||||
@@ -1081,14 +1085,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (!sp.DoNotCloseAfterTeleport)
|
||||
{
|
||||
// OK, it got this agent. Let's close everything
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name);
|
||||
sp.CloseChildAgents(newRegionX, newRegionY);
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing agent {0} in {1}", sp.Name, Scene.Name);
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID, false);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.Name);
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name);
|
||||
sp.DoNotCloseAfterTeleport = false;
|
||||
}
|
||||
}
|
||||
@@ -1863,10 +1865,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles);
|
||||
List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles);
|
||||
|
||||
//Dump("Current Neighbors", neighbourHandles);
|
||||
//Dump("Previous Neighbours", previousRegionNeighbourHandles);
|
||||
//Dump("New Neighbours", newRegions);
|
||||
//Dump("Old Neighbours", oldRegions);
|
||||
Dump("Current Neighbors", neighbourHandles);
|
||||
Dump("Previous Neighbours", previousRegionNeighbourHandles);
|
||||
Dump("New Neighbours", newRegions);
|
||||
Dump("Old Neighbours", oldRegions);
|
||||
|
||||
/// Update the scene presence's known regions here on this region
|
||||
sp.DropOldNeighbours(oldRegions);
|
||||
@@ -1874,8 +1876,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// Collect as many seeds as possible
|
||||
Dictionary<ulong, string> seeds;
|
||||
if (sp.Scene.CapsModule != null)
|
||||
seeds
|
||||
= new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
|
||||
seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
|
||||
else
|
||||
seeds = new Dictionary<ulong, string>();
|
||||
|
||||
@@ -1945,6 +1946,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
newAgent = true;
|
||||
else
|
||||
newAgent = false;
|
||||
// continue;
|
||||
|
||||
if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
|
||||
{
|
||||
@@ -2178,18 +2180,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return handles;
|
||||
}
|
||||
|
||||
// private void Dump(string msg, List<ulong> handles)
|
||||
// {
|
||||
// m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg);
|
||||
// foreach (ulong handle in handles)
|
||||
// {
|
||||
// uint x, y;
|
||||
// Utils.LongToUInts(handle, out x, out y);
|
||||
// x = x / Constants.RegionSize;
|
||||
// y = y / Constants.RegionSize;
|
||||
// m_log.InfoFormat("({0}, {1})", x, y);
|
||||
// }
|
||||
// }
|
||||
private void Dump(string msg, List<ulong> handles)
|
||||
{
|
||||
m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg);
|
||||
foreach (ulong handle in handles)
|
||||
{
|
||||
uint x, y;
|
||||
Utils.LongToUInts(handle, out x, out y);
|
||||
x = x / Constants.RegionSize;
|
||||
y = y / Constants.RegionSize;
|
||||
m_log.InfoFormat("({0}, {1})", x, y);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user