aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-08 23:29:30 +0100
committerJustin Clark-Casey (justincc)2013-08-08 23:29:30 +0100
commitb1c26a56b3d615f3709363e3a2f91b5423f5891f (patch)
treeea87893e6a13813dcf383d064fe33d3b3740c7ce /OpenSim/Region/CoreModules
parentminor: Remove console lines at bottom of FakeParcelIDTests() regression test ... (diff)
downloadopensim-SC_OLD-b1c26a56b3d615f3709363e3a2f91b5423f5891f.zip
opensim-SC_OLD-b1c26a56b3d615f3709363e3a2f91b5423f5891f.tar.gz
opensim-SC_OLD-b1c26a56b3d615f3709363e3a2f91b5423f5891f.tar.bz2
opensim-SC_OLD-b1c26a56b3d615f3709363e3a2f91b5423f5891f.tar.xz
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
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs48
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs6
2 files changed, 28 insertions, 26 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 01ef710..2f74253 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1064,8 +1064,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1064 // Now let's make it officially a child agent 1064 // Now let's make it officially a child agent
1065 sp.MakeChildAgent(); 1065 sp.MakeChildAgent();
1066 1066
1067 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1067 // May still need to signal neighbours whether child agents may need closing irrespective of whether this
1068 // one needed closing. Neighbour regions also contain logic to prevent a close if a subsequent move or
1069 // teleport re-established the child connection.
1070 sp.CloseChildAgents(newRegionX, newRegionY);
1068 1071
1072 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1069 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 1073 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
1070 { 1074 {
1071 sp.DoNotCloseAfterTeleport = false; 1075 sp.DoNotCloseAfterTeleport = false;
@@ -1081,14 +1085,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1081 if (!sp.DoNotCloseAfterTeleport) 1085 if (!sp.DoNotCloseAfterTeleport)
1082 { 1086 {
1083 // OK, it got this agent. Let's close everything 1087 // OK, it got this agent. Let's close everything
1084 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name); 1088 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing agent {0} in {1}", sp.Name, Scene.Name);
1085 sp.CloseChildAgents(newRegionX, newRegionY);
1086 sp.Scene.IncomingCloseAgent(sp.UUID, false); 1089 sp.Scene.IncomingCloseAgent(sp.UUID, false);
1087
1088 } 1090 }
1089 else 1091 else
1090 { 1092 {
1091 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.Name); 1093 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name);
1092 sp.DoNotCloseAfterTeleport = false; 1094 sp.DoNotCloseAfterTeleport = false;
1093 } 1095 }
1094 } 1096 }
@@ -1863,10 +1865,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1863 List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles); 1865 List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles);
1864 List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles); 1866 List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles);
1865 1867
1866 //Dump("Current Neighbors", neighbourHandles); 1868 Dump("Current Neighbors", neighbourHandles);
1867 //Dump("Previous Neighbours", previousRegionNeighbourHandles); 1869 Dump("Previous Neighbours", previousRegionNeighbourHandles);
1868 //Dump("New Neighbours", newRegions); 1870 Dump("New Neighbours", newRegions);
1869 //Dump("Old Neighbours", oldRegions); 1871 Dump("Old Neighbours", oldRegions);
1870 1872
1871 /// Update the scene presence's known regions here on this region 1873 /// Update the scene presence's known regions here on this region
1872 sp.DropOldNeighbours(oldRegions); 1874 sp.DropOldNeighbours(oldRegions);
@@ -1874,8 +1876,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1874 /// Collect as many seeds as possible 1876 /// Collect as many seeds as possible
1875 Dictionary<ulong, string> seeds; 1877 Dictionary<ulong, string> seeds;
1876 if (sp.Scene.CapsModule != null) 1878 if (sp.Scene.CapsModule != null)
1877 seeds 1879 seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
1878 = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
1879 else 1880 else
1880 seeds = new Dictionary<ulong, string>(); 1881 seeds = new Dictionary<ulong, string>();
1881 1882
@@ -1945,6 +1946,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1945 newAgent = true; 1946 newAgent = true;
1946 else 1947 else
1947 newAgent = false; 1948 newAgent = false;
1949// continue;
1948 1950
1949 if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle) 1951 if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
1950 { 1952 {
@@ -2178,18 +2180,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2178 return handles; 2180 return handles;
2179 } 2181 }
2180 2182
2181// private void Dump(string msg, List<ulong> handles) 2183 private void Dump(string msg, List<ulong> handles)
2182// { 2184 {
2183// m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); 2185 m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg);
2184// foreach (ulong handle in handles) 2186 foreach (ulong handle in handles)
2185// { 2187 {
2186// uint x, y; 2188 uint x, y;
2187// Utils.LongToUInts(handle, out x, out y); 2189 Utils.LongToUInts(handle, out x, out y);
2188// x = x / Constants.RegionSize; 2190 x = x / Constants.RegionSize;
2189// y = y / Constants.RegionSize; 2191 y = y / Constants.RegionSize;
2190// m_log.InfoFormat("({0}, {1})", x, y); 2192 m_log.InfoFormat("({0}, {1})", x, y);
2191// } 2193 }
2192// } 2194 }
2193 2195
2194 #endregion 2196 #endregion
2195 2197
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 121b2aa..31547a6 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -562,7 +562,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
562 if (!Scene.TeleportClientHome(user, s.ControllingClient)) 562 if (!Scene.TeleportClientHome(user, s.ControllingClient))
563 { 563 {
564 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out."); 564 s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
565 s.ControllingClient.Close(); 565 Scene.IncomingCloseAgent(s.UUID, false);
566 } 566 }
567 } 567 }
568 } 568 }
@@ -797,7 +797,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
797 if (!Scene.TeleportClientHome(prey, s.ControllingClient)) 797 if (!Scene.TeleportClientHome(prey, s.ControllingClient))
798 { 798 {
799 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); 799 s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
800 s.ControllingClient.Close(); 800 Scene.IncomingCloseAgent(s.UUID, false);
801 } 801 }
802 } 802 }
803 } 803 }
@@ -820,7 +820,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
820 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient)) 820 if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient))
821 { 821 {
822 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out."); 822 p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
823 p.ControllingClient.Close(); 823 Scene.IncomingCloseAgent(p.UUID, false);
824 } 824 }
825 } 825 }
826 } 826 }