diff options
Diffstat (limited to 'OpenSim')
5 files changed, 113 insertions, 72 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 1341533..d54216a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -50,6 +50,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
50 | { | 50 | { |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | /// <summary> | ||
54 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | ||
55 | /// </summary> | ||
56 | public int MaxTransferDistance { get; set; } | ||
57 | |||
53 | protected bool m_Enabled = false; | 58 | protected bool m_Enabled = false; |
54 | protected Scene m_aScene; | 59 | protected Scene m_aScene; |
55 | protected List<Scene> m_Scenes = new List<Scene>(); | 60 | protected List<Scene> m_Scenes = new List<Scene>(); |
@@ -78,13 +83,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
78 | string name = moduleConfig.GetString("EntityTransferModule", ""); | 83 | string name = moduleConfig.GetString("EntityTransferModule", ""); |
79 | if (name == Name) | 84 | if (name == Name) |
80 | { | 85 | { |
81 | m_agentsInTransit = new List<UUID>(); | 86 | InitialiseCommon(source); |
82 | m_Enabled = true; | 87 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: {0} enabled.", Name); |
83 | m_log.InfoFormat("[ENTITY TRANSFER MODULE]: {0} enabled.", Name); | ||
84 | } | 88 | } |
85 | } | 89 | } |
86 | } | 90 | } |
87 | 91 | ||
92 | /// <summary> | ||
93 | /// Initialize config common for this module and any descendents. | ||
94 | /// </summary> | ||
95 | /// <param name="source"></param> | ||
96 | protected virtual void InitialiseCommon(IConfigSource source) | ||
97 | { | ||
98 | IConfig transferConfig = source.Configs["EntityTransfer"]; | ||
99 | if (transferConfig != null) | ||
100 | MaxTransferDistance = transferConfig.GetInt("max_distance", 4095); | ||
101 | |||
102 | m_agentsInTransit = new List<UUID>(); | ||
103 | m_Enabled = true; | ||
104 | } | ||
105 | |||
88 | public virtual void PostInitialise() | 106 | public virtual void PostInitialise() |
89 | { | 107 | { |
90 | } | 108 | } |
@@ -114,7 +132,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
114 | return; | 132 | return; |
115 | } | 133 | } |
116 | 134 | ||
117 | |||
118 | public virtual void RemoveRegion(Scene scene) | 135 | public virtual void RemoveRegion(Scene scene) |
119 | { | 136 | { |
120 | if (!m_Enabled) | 137 | if (!m_Enabled) |
@@ -129,7 +146,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
129 | { | 146 | { |
130 | if (!m_Enabled) | 147 | if (!m_Enabled) |
131 | return; | 148 | return; |
132 | |||
133 | } | 149 | } |
134 | 150 | ||
135 | #endregion | 151 | #endregion |
@@ -204,8 +220,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
204 | sp.ControllingClient.SendTeleportFailed("Problem at destination"); | 220 | sp.ControllingClient.SendTeleportFailed("Problem at destination"); |
205 | return; | 221 | return; |
206 | } | 222 | } |
207 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} {2}@{3}", | 223 | |
208 | finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID, finalDestination.ServerURI); | 224 | uint curX = 0, curY = 0; |
225 | Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY); | ||
226 | int curCellX = (int)(curX / Constants.RegionSize); | ||
227 | int curCellY = (int)(curY / Constants.RegionSize); | ||
228 | int destCellX = (int)(finalDestination.RegionLocX / Constants.RegionSize); | ||
229 | int destCellY = (int)(finalDestination.RegionLocY / Constants.RegionSize); | ||
230 | |||
231 | // m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Source co-ords are x={0} y={1}", curRegionX, curRegionY); | ||
232 | // | ||
233 | // m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final dest is x={0} y={1} {2}@{3}", | ||
234 | // destRegionX, destRegionY, finalDestination.RegionID, finalDestination.ServerURI); | ||
209 | 235 | ||
210 | // Check that these are not the same coordinates | 236 | // Check that these are not the same coordinates |
211 | if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && | 237 | if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && |
@@ -216,6 +242,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
216 | return; | 242 | return; |
217 | } | 243 | } |
218 | 244 | ||
245 | if (Math.Abs(curCellX - destCellX) > MaxTransferDistance || Math.Abs(curCellY - destCellY) > MaxTransferDistance) | ||
246 | { | ||
247 | sp.ControllingClient.SendTeleportFailed( | ||
248 | string.Format( | ||
249 | "Can't teleport to {0} ({1},{2}) from {3} ({4},{5}), destination is more than {6} regions way", | ||
250 | finalDestination.RegionName, destCellX, destCellY, | ||
251 | sp.Scene.RegionInfo.RegionName, curCellX, curCellY, | ||
252 | MaxTransferDistance)); | ||
253 | |||
254 | return; | ||
255 | } | ||
256 | |||
219 | // | 257 | // |
220 | // This is it | 258 | // This is it |
221 | // | 259 | // |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 4d77ef4..a87279a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -67,10 +67,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
67 | string name = moduleConfig.GetString("EntityTransferModule", ""); | 67 | string name = moduleConfig.GetString("EntityTransferModule", ""); |
68 | if (name == Name) | 68 | if (name == Name) |
69 | { | 69 | { |
70 | m_agentsInTransit = new List<UUID>(); | 70 | InitialiseCommon(source); |
71 | 71 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); | |
72 | m_Enabled = true; | ||
73 | m_log.InfoFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name); | ||
74 | } | 72 | } |
75 | } | 73 | } |
76 | } | 74 | } |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 00959b0..2e3b21f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |||
@@ -91,6 +91,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
91 | remoteClient.SendAlertMessage("Use a search string with at least 3 characters"); | 91 | remoteClient.SendAlertMessage("Use a search string with at least 3 characters"); |
92 | return; | 92 | return; |
93 | } | 93 | } |
94 | |||
95 | m_log.DebugFormat("MAP NAME=({0})", mapName); | ||
94 | 96 | ||
95 | // try to fetch from GridServer | 97 | // try to fetch from GridServer |
96 | List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); | 98 | List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20); |
@@ -103,7 +105,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
103 | if (info != null) | 105 | if (info != null) |
104 | regionInfos.Add(info); | 106 | regionInfos.Add(info); |
105 | } | 107 | } |
106 | else if (regionInfos.Count == 0 && mapName.StartsWith("http://")) | 108 | else if (regionInfos.Count == 0) |
107 | remoteClient.SendAlertMessage("Hyperlink could not be established."); | 109 | remoteClient.SendAlertMessage("Hyperlink could not be established."); |
108 | 110 | ||
109 | m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags); | 111 | m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 42efd67..a5bba4f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -417,9 +417,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
417 | public string ParcelVoiceInfoRequest(Scene scene, string request, string path, string param, | 417 | public string ParcelVoiceInfoRequest(Scene scene, string request, string path, string param, |
418 | UUID agentID, Caps caps) | 418 | UUID agentID, Caps caps) |
419 | { | 419 | { |
420 | // m_log.DebugFormat( | 420 | m_log.DebugFormat( |
421 | // "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", | 421 | "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", |
422 | // scene.RegionInfo.RegionName, agentID); | 422 | scene.RegionInfo.RegionName, agentID); |
423 | 423 | ||
424 | ScenePresence avatar = scene.GetScenePresence(agentID); | 424 | ScenePresence avatar = scene.GetScenePresence(agentID); |
425 | string avatarName = avatar.Name; | 425 | string avatarName = avatar.Name; |
@@ -885,4 +885,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
885 | 885 | ||
886 | #endregion | 886 | #endregion |
887 | } | 887 | } |
888 | } \ No newline at end of file | 888 | } |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 5262598..83ec122 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Services.GridService | |||
63 | protected GatekeeperServiceConnector m_GatekeeperConnector; | 63 | protected GatekeeperServiceConnector m_GatekeeperConnector; |
64 | 64 | ||
65 | protected UUID m_ScopeID = UUID.Zero; | 65 | protected UUID m_ScopeID = UUID.Zero; |
66 | protected bool m_Check4096 = true; | 66 | // protected bool m_Check4096 = true; |
67 | protected string m_MapTileDirectory = string.Empty; | 67 | protected string m_MapTileDirectory = string.Empty; |
68 | protected string m_ThisGatekeeper = string.Empty; | 68 | protected string m_ThisGatekeeper = string.Empty; |
69 | protected Uri m_ThisGatekeeperURI = null; | 69 | protected Uri m_ThisGatekeeperURI = null; |
@@ -121,7 +121,7 @@ namespace OpenSim.Services.GridService | |||
121 | if (scope != string.Empty) | 121 | if (scope != string.Empty) |
122 | UUID.TryParse(scope, out m_ScopeID); | 122 | UUID.TryParse(scope, out m_ScopeID); |
123 | 123 | ||
124 | m_Check4096 = gridConfig.GetBoolean("Check4096", true); | 124 | // m_Check4096 = gridConfig.GetBoolean("Check4096", true); |
125 | 125 | ||
126 | m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); | 126 | m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles"); |
127 | 127 | ||
@@ -347,14 +347,18 @@ namespace OpenSim.Services.GridService | |||
347 | return true; | 347 | return true; |
348 | } | 348 | } |
349 | 349 | ||
350 | uint x, y; | 350 | // We are now performing this check for each individual teleport in the EntityTransferModule instead. This |
351 | if (m_Check4096 && !Check4096(handle, out x, out y)) | 351 | // allows us to give better feedback when teleports fail because of the distance reason (which can't be |
352 | { | 352 | // done here) and it also hypergrid teleports that are within range (possibly because the source grid |
353 | RemoveHyperlinkRegion(regInfo.RegionID); | 353 | // itself has regions that are very far apart). |
354 | reason = "Region is too far (" + x + ", " + y + ")"; | 354 | // uint x, y; |
355 | m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); | 355 | // if (m_Check4096 && !Check4096(handle, out x, out y)) |
356 | return false; | 356 | // { |
357 | } | 357 | // //RemoveHyperlinkRegion(regInfo.RegionID); |
358 | // reason = "Region is too far (" + x + ", " + y + ")"; | ||
359 | // m_log.Info("[HYPERGRID LINKER]: Unable to link, region is too far (" + x + ", " + y + ")"); | ||
360 | // //return false; | ||
361 | // } | ||
358 | 362 | ||
359 | regInfo.RegionID = regionID; | 363 | regInfo.RegionID = regionID; |
360 | 364 | ||
@@ -405,60 +409,59 @@ namespace OpenSim.Services.GridService | |||
405 | } | 409 | } |
406 | } | 410 | } |
407 | 411 | ||
408 | /// <summary> | 412 | // Not currently used |
409 | /// Cope with this viewer limitation. | 413 | // /// <summary> |
410 | /// </summary> | 414 | // /// Cope with this viewer limitation. |
411 | /// <param name="regInfo"></param> | 415 | // /// </summary> |
412 | /// <returns></returns> | 416 | // /// <param name="regInfo"></param> |
413 | public bool Check4096(ulong realHandle, out uint x, out uint y) | 417 | // /// <returns></returns> |
414 | { | 418 | // public bool Check4096(ulong realHandle, out uint x, out uint y) |
415 | uint ux = 0, uy = 0; | 419 | // { |
416 | Utils.LongToUInts(realHandle, out ux, out uy); | 420 | // uint ux = 0, uy = 0; |
417 | x = ux / Constants.RegionSize; | 421 | // Utils.LongToUInts(realHandle, out ux, out uy); |
418 | y = uy / Constants.RegionSize; | 422 | // x = ux / Constants.RegionSize; |
419 | 423 | // y = uy / Constants.RegionSize; | |
420 | const uint limit = (4096 - 1) * Constants.RegionSize; | 424 | // |
421 | uint xmin = ux - limit; | 425 | // const uint limit = (4096 - 1) * Constants.RegionSize; |
422 | uint xmax = ux + limit; | 426 | // uint xmin = ux - limit; |
423 | uint ymin = uy - limit; | 427 | // uint xmax = ux + limit; |
424 | uint ymax = uy + limit; | 428 | // uint ymin = uy - limit; |
425 | // World map boundary checks | 429 | // uint ymax = uy + limit; |
426 | if (xmin < 0 || xmin > ux) | 430 | // // World map boundary checks |
427 | xmin = 0; | 431 | // if (xmin < 0 || xmin > ux) |
428 | if (xmax > int.MaxValue || xmax < ux) | 432 | // xmin = 0; |
429 | xmax = int.MaxValue; | 433 | // if (xmax > int.MaxValue || xmax < ux) |
430 | if (ymin < 0 || ymin > uy) | 434 | // xmax = int.MaxValue; |
431 | ymin = 0; | 435 | // if (ymin < 0 || ymin > uy) |
432 | if (ymax > int.MaxValue || ymax < uy) | 436 | // ymin = 0; |
433 | ymax = int.MaxValue; | 437 | // if (ymax > int.MaxValue || ymax < uy) |
434 | 438 | // ymax = int.MaxValue; | |
435 | // Check for any regions that are within the possible teleport range to the linked region | 439 | // |
436 | List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); | 440 | // // Check for any regions that are within the possible teleport range to the linked region |
437 | if (regions.Count == 0) | 441 | // List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); |
438 | { | 442 | // if (regions.Count == 0) |
439 | return false; | 443 | // { |
440 | } | 444 | // return false; |
441 | else | 445 | // } |
442 | { | 446 | // else |
443 | // Check for regions which are not linked regions | 447 | // { |
444 | List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); | 448 | // // Check for regions which are not linked regions |
445 | IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); | 449 | // List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); |
446 | if (availableRegions.Count() == 0) | 450 | // IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks); |
447 | return false; | 451 | // if (availableRegions.Count() == 0) |
448 | } | 452 | // return false; |
449 | 453 | // } | |
450 | return true; | 454 | // |
451 | } | 455 | // return true; |
456 | // } | ||
452 | 457 | ||
453 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) | 458 | private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) |
454 | { | 459 | { |
455 | |||
456 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); | 460 | RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); |
457 | int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline; | 461 | int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline; |
458 | rdata.Data["flags"] = flags.ToString(); | 462 | rdata.Data["flags"] = flags.ToString(); |
459 | 463 | ||
460 | m_Database.Store(rdata); | 464 | m_Database.Store(rdata); |
461 | |||
462 | } | 465 | } |
463 | 466 | ||
464 | private void RemoveHyperlinkRegion(UUID regionID) | 467 | private void RemoveHyperlinkRegion(UUID regionID) |