diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Hypergrid')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index d4f66c7..0ee0869 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Net; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using System.Threading; | 33 | using System.Threading; |
33 | 34 | ||
@@ -148,6 +149,16 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
148 | destRegionUp = true; | 149 | destRegionUp = true; |
149 | } | 150 | } |
150 | 151 | ||
152 | // Let's do DNS resolution only once in this process, please! | ||
153 | // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, | ||
154 | // it's actually doing a lot of work. | ||
155 | IPEndPoint endPoint = reg.ExternalEndPoint; | ||
156 | if (endPoint.Address == null) | ||
157 | { | ||
158 | // Couldn't resolve the name. Can't TP, because the viewer wants IP addresses. | ||
159 | destRegionUp = false; | ||
160 | } | ||
161 | |||
151 | if (destRegionUp) | 162 | if (destRegionUp) |
152 | { | 163 | { |
153 | 164 | ||
@@ -206,15 +217,15 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
206 | 217 | ||
207 | if (eq != null) | 218 | if (eq != null) |
208 | { | 219 | { |
209 | OSD Item = EventQueueHelper.EnableSimulator(realHandle, reg.ExternalEndPoint); | 220 | OSD Item = EventQueueHelper.EnableSimulator(realHandle, endPoint); |
210 | eq.Enqueue(Item, avatar.UUID); | 221 | eq.Enqueue(Item, avatar.UUID); |
211 | 222 | ||
212 | Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, reg.ExternalEndPoint.ToString(), capsPath); | 223 | Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, endPoint.ToString(), capsPath); |
213 | eq.Enqueue(Item, avatar.UUID); | 224 | eq.Enqueue(Item, avatar.UUID); |
214 | } | 225 | } |
215 | else | 226 | else |
216 | { | 227 | { |
217 | avatar.ControllingClient.InformClientOfNeighbour(realHandle, reg.ExternalEndPoint); | 228 | avatar.ControllingClient.InformClientOfNeighbour(realHandle, endPoint); |
218 | // TODO: make Event Queue disablable! | 229 | // TODO: make Event Queue disablable! |
219 | } | 230 | } |
220 | } | 231 | } |
@@ -252,13 +263,13 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
252 | /// | 263 | /// |
253 | if (eq != null) | 264 | if (eq != null) |
254 | { | 265 | { |
255 | OSD Item = EventQueueHelper.TeleportFinishEvent(realHandle, 13, reg.ExternalEndPoint, | 266 | OSD Item = EventQueueHelper.TeleportFinishEvent(realHandle, 13, endPoint, |
256 | 4, teleportFlags, capsPath, avatar.UUID); | 267 | 4, teleportFlags, capsPath, avatar.UUID); |
257 | eq.Enqueue(Item, avatar.UUID); | 268 | eq.Enqueue(Item, avatar.UUID); |
258 | } | 269 | } |
259 | else | 270 | else |
260 | { | 271 | { |
261 | avatar.ControllingClient.SendRegionTeleport(realHandle, 13, reg.ExternalEndPoint, 4, | 272 | avatar.ControllingClient.SendRegionTeleport(realHandle, 13, endPoint, 4, |
262 | teleportFlags, capsPath); | 273 | teleportFlags, capsPath); |
263 | } | 274 | } |
264 | /// | 275 | /// |