aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-03-28 02:29:07 +0000
committerMelanie2013-03-28 02:29:07 +0000
commitf548a41fb88bd45deda99a19889960f81a1969c4 (patch)
treef53b612d628f83bbe60040735fd869fa7c8261b6 /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentAdd back a log message when we attempt a megaregion auto-reteleport (diff)
downloadopensim-SC-f548a41fb88bd45deda99a19889960f81a1969c4.zip
opensim-SC-f548a41fb88bd45deda99a19889960f81a1969c4.tar.gz
opensim-SC-f548a41fb88bd45deda99a19889960f81a1969c4.tar.bz2
opensim-SC-f548a41fb88bd45deda99a19889960f81a1969c4.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs25
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs130
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs2
5 files changed, 100 insertions, 62 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index f6e501d..37285e3 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -97,6 +97,14 @@ namespace OpenSim.Region.ClientStack.Linden
97 + " >= 1 - turns on outgoing event logging\n" 97 + " >= 1 - turns on outgoing event logging\n"
98 + " >= 2 - turns on poll notification", 98 + " >= 2 - turns on poll notification",
99 HandleDebugEq); 99 HandleDebugEq);
100
101 MainConsole.Instance.Commands.AddCommand(
102 "Debug",
103 false,
104 "show eq",
105 "show eq",
106 "Show contents of event queues for logged in avatars. Used for debugging.",
107 HandleShowEq);
100 } 108 }
101 109
102 public void RemoveRegion(Scene scene) 110 public void RemoveRegion(Scene scene)
@@ -138,7 +146,7 @@ namespace OpenSim.Region.ClientStack.Linden
138 146
139 if (!(args.Length == 3 && int.TryParse(args[2], out debugLevel))) 147 if (!(args.Length == 3 && int.TryParse(args[2], out debugLevel)))
140 { 148 {
141 MainConsole.Instance.OutputFormat("Usage: debug eq [0|1]"); 149 MainConsole.Instance.OutputFormat("Usage: debug eq [0|1|2]");
142 } 150 }
143 else 151 else
144 { 152 {
@@ -148,6 +156,21 @@ namespace OpenSim.Region.ClientStack.Linden
148 } 156 }
149 } 157 }
150 158
159 protected void HandleShowEq(string module, string[] args)
160 {
161 MainConsole.Instance.OutputFormat("For scene {0}", m_scene.Name);
162
163 lock (queues)
164 {
165 foreach (KeyValuePair<UUID, Queue<OSD>> kvp in queues)
166 {
167 MainConsole.Instance.OutputFormat(
168 "For agent {0} there are {1} messages queued for send.",
169 kvp.Key, kvp.Value.Count);
170 }
171 }
172 }
173
151 /// <summary> 174 /// <summary>
152 /// Always returns a valid queue 175 /// Always returns a valid queue
153 /// </summary> 176 /// </summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 6c9fd86..a34f2d2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -154,7 +154,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
154 154
155 void OnIncomingInstantMessage(GridInstantMessage im) 155 void OnIncomingInstantMessage(GridInstantMessage im)
156 { 156 {
157 if (im.dialog == (byte)InstantMessageDialog.RequestTeleport) 157 if (im.dialog == (byte)InstantMessageDialog.RequestTeleport
158 || im.dialog == (byte)InstantMessageDialog.GodLikeRequestTeleport)
158 { 159 {
159 UUID sessionID = new UUID(im.imSessionID); 160 UUID sessionID = new UUID(im.imSessionID);
160 161
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
index f3adb95..0c64f19 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
@@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
165 (uint)presence.AbsolutePosition.Y, 165 (uint)presence.AbsolutePosition.Y,
166 (uint)presence.AbsolutePosition.Z + 2); 166 (uint)presence.AbsolutePosition.Z + 2);
167 167
168 m_log.DebugFormat("[LURE]: TP invite with message {0}", message); 168 m_log.DebugFormat("TP invite with message {0}, type {1}", message, lureType);
169 169
170 GridInstantMessage m; 170 GridInstantMessage m;
171 171
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index a7935b1..e3f4e74 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -117,6 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
117 new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>(); 117 new ExpiringCache<UUID, ExpiringCache<ulong, DateTime>>();
118 118
119 private IEventQueue m_eqModule; 119 private IEventQueue m_eqModule;
120 private IRegionCombinerModule m_regionCombinerModule;
120 121
121 #region ISharedRegionModule 122 #region ISharedRegionModule
122 123
@@ -255,10 +256,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
255 256
256 public virtual void RemoveRegion(Scene scene) 257 public virtual void RemoveRegion(Scene scene)
257 { 258 {
258 StatsManager.DeregisterStat(m_interRegionTeleportAttempts); 259 if (m_Enabled)
259 StatsManager.DeregisterStat(m_interRegionTeleportAborts); 260 {
260 StatsManager.DeregisterStat(m_interRegionTeleportCancels); 261 StatsManager.DeregisterStat(m_interRegionTeleportAttempts);
261 StatsManager.DeregisterStat(m_interRegionTeleportFailures); 262 StatsManager.DeregisterStat(m_interRegionTeleportAborts);
263 StatsManager.DeregisterStat(m_interRegionTeleportCancels);
264 StatsManager.DeregisterStat(m_interRegionTeleportFailures);
265 }
262 } 266 }
263 267
264 public virtual void RegionLoaded(Scene scene) 268 public virtual void RegionLoaded(Scene scene)
@@ -267,6 +271,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
267 return; 271 return;
268 272
269 m_eqModule = Scene.RequestModuleInterface<IEventQueue>(); 273 m_eqModule = Scene.RequestModuleInterface<IEventQueue>();
274 m_regionCombinerModule = Scene.RequestModuleInterface<IRegionCombinerModule>();
270 } 275 }
271 276
272 #endregion 277 #endregion
@@ -377,8 +382,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
377 Vector3 emergencyPos = new Vector3(128, 128, 128); 382 Vector3 emergencyPos = new Vector3(128, 128, 128);
378 383
379 m_log.WarnFormat( 384 m_log.WarnFormat(
380 "[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 385 "[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2} in {3}. Substituting {4}",
381 position, sp.Name, sp.UUID, emergencyPos); 386 position, sp.Name, sp.UUID, Scene.Name, emergencyPos);
382 387
383 position = emergencyPos; 388 position = emergencyPos;
384 } 389 }
@@ -1010,41 +1015,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1010 1015
1011 protected virtual bool NeedsNewAgent(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY) 1016 protected virtual bool NeedsNewAgent(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY)
1012 { 1017 {
1013 Border[] northBorders = Scene.NorthBorders.ToArray(); 1018 if (m_regionCombinerModule != null && m_regionCombinerModule.IsRootForMegaregion(Scene.RegionInfo.RegionID))
1014 Border[] southBorders = Scene.SouthBorders.ToArray();
1015 Border[] eastBorders = Scene.EastBorders.ToArray();
1016 Border[] westBorders = Scene.WestBorders.ToArray();
1017
1018 // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't
1019 // clear what should be done with a "far view" given that megaregions already extended the
1020 // view to include everything in the megaregion
1021 if (northBorders.Length > 1 || southBorders.Length > 1 || eastBorders.Length > 1 || westBorders.Length > 1)
1022 { 1019 {
1023 Vector2 extent = Vector2.Zero; 1020 Vector2 swCorner, neCorner;
1024 for (int i = 0; i < eastBorders.Length; i++) 1021 GetMegaregionViewRange(out swCorner, out neCorner);
1025 {
1026 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X;
1027 }
1028 for (int i = 0; i < northBorders.Length; i++)
1029 {
1030 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y;
1031 }
1032
1033 // Loss of fraction on purpose
1034 extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1;
1035 extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1;
1036
1037 uint startX = oldRegionX - 1;
1038 uint startY = oldRegionY - 1;
1039
1040 uint endX = oldRegionX + (uint)extent.X;
1041 uint endY = oldRegionY + (uint)extent.Y;
1042 1022
1043 m_log.DebugFormat( 1023 m_log.DebugFormat(
1044 "[ENTITY TRANSFER MODULE]: Megaregion view of {0} is from {1},{2} to {3},{4} with new agent check for {5},{6}", 1024 "[ENTITY TRANSFER MODULE]: Megaregion view of {0} is from {1} to {2} with new agent check for {3},{4}",
1045 Scene.Name, startX, startY, endX, endY, newRegionX, newRegionY); 1025 Scene.Name, swCorner, neCorner, newRegionX, newRegionY);
1046 1026
1047 return !(newRegionX >= startX && newRegionX <= endX && newRegionY >= startY && newRegionY <= endY); 1027 return !(newRegionX >= swCorner.X && newRegionX <= neCorner.X && newRegionY >= swCorner.Y && newRegionY <= neCorner.Y);
1048 } 1028 }
1049 else 1029 else
1050 { 1030 {
@@ -1328,7 +1308,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1328 Scene initiatingScene) 1308 Scene initiatingScene)
1329 { 1309 {
1330 Thread.Sleep(10000); 1310 Thread.Sleep(10000);
1331 1311
1312 m_log.DebugFormat(
1313 "[ENTITY TRANSFER MODULE]: Auto-reteleporting {0} to correct megaregion location {1},{2},{3} from {4}",
1314 agent.Name, regionX, regionY, position, initiatingScene.Name);
1315
1316 agent.Scene.RequestTeleportLocation(
1317 agent.ControllingClient,
1318 Utils.UIntsToLong(regionX * (uint)Constants.RegionSize, regionY * (uint)Constants.RegionSize),
1319 position,
1320 agent.Lookat,
1321 (uint)Constants.TeleportFlags.ViaLocation);
1322
1323 /*
1332 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>(); 1324 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
1333 if (im != null) 1325 if (im != null)
1334 { 1326 {
@@ -1363,6 +1355,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1363 }); 1355 });
1364 1356
1365 } 1357 }
1358 */
1366 } 1359 }
1367 1360
1368 private void InformClientToInitiateTeleportToLocationCompleted(IAsyncResult iar) 1361 private void InformClientToInitiateTeleportToLocationCompleted(IAsyncResult iar)
@@ -1871,6 +1864,37 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1871 } 1864 }
1872 1865
1873 /// <summary> 1866 /// <summary>
1867 /// Gets the range considered in view of this megaregion (assuming this is a megaregion).
1868 /// </summary>
1869 /// <remarks>Expressed in 256m units</remarks>
1870 /// <param name='swCorner'></param>
1871 /// <param name='neCorner'></param>
1872 private void GetMegaregionViewRange(out Vector2 swCorner, out Vector2 neCorner)
1873 {
1874 Border[] northBorders = Scene.NorthBorders.ToArray();
1875 Border[] eastBorders = Scene.EastBorders.ToArray();
1876
1877 Vector2 extent = Vector2.Zero;
1878 for (int i = 0; i < eastBorders.Length; i++)
1879 {
1880 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X;
1881 }
1882 for (int i = 0; i < northBorders.Length; i++)
1883 {
1884 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y;
1885 }
1886
1887 // Loss of fraction on purpose
1888 extent.X = ((int)extent.X / (int)Constants.RegionSize);
1889 extent.Y = ((int)extent.Y / (int)Constants.RegionSize);
1890
1891 swCorner.X = Scene.RegionInfo.RegionLocX - 1;
1892 swCorner.Y = Scene.RegionInfo.RegionLocY - 1;
1893 neCorner.X = Scene.RegionInfo.RegionLocX + extent.X;
1894 neCorner.Y = Scene.RegionInfo.RegionLocY + extent.Y;
1895 }
1896
1897 /// <summary>
1874 /// Return the list of regions that are considered to be neighbours to the given scene. 1898 /// Return the list of regions that are considered to be neighbours to the given scene.
1875 /// </summary> 1899 /// </summary>
1876 /// <param name="pScene"></param> 1900 /// <param name="pScene"></param>
@@ -1890,7 +1914,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1890 // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't 1914 // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't
1891 // clear what should be done with a "far view" given that megaregions already extended the 1915 // clear what should be done with a "far view" given that megaregions already extended the
1892 // view to include everything in the megaregion 1916 // view to include everything in the megaregion
1893 if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1) 1917 if (m_regionCombinerModule == null || !m_regionCombinerModule.IsRootForMegaregion(Scene.RegionInfo.RegionID))
1894 { 1918 {
1895 int dd = avatar.DrawDistance < Constants.RegionSize ? (int)Constants.RegionSize : (int)avatar.DrawDistance; 1919 int dd = avatar.DrawDistance < Constants.RegionSize ? (int)Constants.RegionSize : (int)avatar.DrawDistance;
1896 1920
@@ -1908,27 +1932,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1908 } 1932 }
1909 else 1933 else
1910 { 1934 {
1911 Vector2 extent = Vector2.Zero; 1935 Vector2 swCorner, neCorner;
1912 for (int i = 0; i < eastBorders.Length; i++) 1936 GetMegaregionViewRange(out swCorner, out neCorner);
1913 {
1914 extent.X = (eastBorders[i].BorderLine.Z > extent.X) ? eastBorders[i].BorderLine.Z : extent.X;
1915 }
1916 for (int i = 0; i < northBorders.Length; i++)
1917 {
1918 extent.Y = (northBorders[i].BorderLine.Z > extent.Y) ? northBorders[i].BorderLine.Z : extent.Y;
1919 }
1920
1921 // Loss of fraction on purpose
1922 extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1;
1923 extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1;
1924
1925 int startX = (int)(pRegionLocX - 1) * (int)Constants.RegionSize;
1926 int startY = (int)(pRegionLocY - 1) * (int)Constants.RegionSize;
1927 1937
1928 int endX = ((int)pRegionLocX + (int)extent.X) * (int)Constants.RegionSize; 1938 List<GridRegion> neighbours
1929 int endY = ((int)pRegionLocY + (int)extent.Y) * (int)Constants.RegionSize; 1939 = pScene.GridService.GetRegionRange(
1940 m_regionInfo.ScopeID,
1941 (int)swCorner.X * (int)Constants.RegionSize,
1942 (int)neCorner.X * (int)Constants.RegionSize,
1943 (int)swCorner.Y * (int)Constants.RegionSize,
1944 (int)neCorner.Y * (int)Constants.RegionSize);
1930 1945
1931 List<GridRegion> neighbours = pScene.GridService.GetRegionRange(m_regionInfo.ScopeID, startX, endX, startY, endY);
1932 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; }); 1946 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
1933 1947
1934 return neighbours; 1948 return neighbours;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 9b78b3b..d372c0e 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -199,7 +199,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
199 199
200 public override void RemoveRegion(Scene scene) 200 public override void RemoveRegion(Scene scene)
201 { 201 {
202 base.AddRegion(scene); 202 base.RemoveRegion(scene);
203 203
204 if (m_Enabled) 204 if (m_Enabled)
205 scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this); 205 scene.UnregisterModuleInterface<IUserAgentVerificationModule>(this);