aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Hypergrid
diff options
context:
space:
mode:
authordiva2008-12-22 07:06:01 +0000
committerdiva2008-12-22 07:06:01 +0000
commit339fd602db4a0182777c9acc0b7486d91e9f904d (patch)
tree8291d3d4e847d1cee8f51c255512360448058bdd /OpenSim/Region/Environment/Scenes/Hypergrid
parentRemoving the region where the agent is in from the list of regions to close c... (diff)
downloadopensim-SC_OLD-339fd602db4a0182777c9acc0b7486d91e9f904d.zip
opensim-SC_OLD-339fd602db4a0182777c9acc0b7486d91e9f904d.tar.gz
opensim-SC_OLD-339fd602db4a0182777c9acc0b7486d91e9f904d.tar.bz2
opensim-SC_OLD-339fd602db4a0182777c9acc0b7486d91e9f904d.tar.xz
This commit is a major change on the TP process. Several things were wrong and/or broken. (a) ExpectAvatarCrossing is redundant (and bad) because the client triggers the same method on the receiving region after it receives TeleportFinish. (b) At least two of the *Async methods in SceneCommunicationService weren't asynchronous at all; I made them be asynchronous. Crossing fingers...
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Hypergrid')
-rw-r--r--OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs42
1 files changed, 25 insertions, 17 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
index ced5b86..78d5725 100644
--- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -196,20 +196,20 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
196 agent.InventoryFolder = UUID.Zero; 196 agent.InventoryFolder = UUID.Zero;
197 agent.startpos = position; 197 agent.startpos = position;
198 agent.child = true; 198 agent.child = true;
199 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) 199 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
200 { 200 {
201 Thread.Sleep(2000); 201 // brand new agent, let's create a new caps seed
202
203 // brand new agent
204 agent.CapsPath = Util.GetRandomCapsPath(); 202 agent.CapsPath = Util.GetRandomCapsPath();
205 if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent)) 203 }
206 {
207 avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports.");
208 return;
209 }
210 204
211 Thread.Sleep(3000); 205 if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent))
206 {
207 avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports.");
208 return;
209 }
212 210
211 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink)
212 {
213 // TODO Should construct this behind a method 213 // TODO Should construct this behind a method
214 capsPath = 214 capsPath =
215 "http://" + reg.ExternalHostName + ":" + reg.HttpPort 215 "http://" + reg.ExternalHostName + ":" + reg.HttpPort
@@ -220,6 +220,11 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
220 OSD Item = EventQueueHelper.EnableSimulator(realHandle, endPoint); 220 OSD Item = EventQueueHelper.EnableSimulator(realHandle, endPoint);
221 eq.Enqueue(Item, avatar.UUID); 221 eq.Enqueue(Item, avatar.UUID);
222 222
223 // ES makes the client send a UseCircuitCode message to the destination,
224 // which triggers a bunch of things there.
225 // So let's wait
226 Thread.Sleep(2000);
227
223 Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, endPoint.ToString(), capsPath); 228 Item = EventQueueHelper.EstablishAgentCommunication(avatar.UUID, endPoint.ToString(), capsPath);
224 eq.Enqueue(Item, avatar.UUID); 229 eq.Enqueue(Item, avatar.UUID);
225 } 230 }
@@ -237,8 +242,8 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
237 + "/CAPS/" + agent.CapsPath + "0000/"; 242 + "/CAPS/" + agent.CapsPath + "0000/";
238 } 243 }
239 244
240 m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, 245 //m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
241 position, false); 246 // position, false);
242 247
243 //if (!m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, 248 //if (!m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
244 // position, false)) 249 // position, false))
@@ -251,7 +256,9 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
251 // return; 256 // return;
252 //} 257 //}
253 258
254 Thread.Sleep(7000); 259 avatar.MakeChildAgent();
260 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
261 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true);
255 262
256 m_log.DebugFormat( 263 m_log.DebugFormat(
257 "[CAPS]: Sending new CAPS seed url {0} to client {1}", agent.CapsPath, avatar.UUID); 264 "[CAPS]: Sending new CAPS seed url {0} to client {1}", agent.CapsPath, avatar.UUID);
@@ -276,9 +283,6 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
276 /// Hypergrid mod stop 283 /// Hypergrid mod stop
277 /// 284 ///
278 285
279 avatar.MakeChildAgent();
280 Thread.Sleep(3000);
281 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true);
282 if (KiPrimitive != null) 286 if (KiPrimitive != null)
283 { 287 {
284 KiPrimitive(avatar.LocalId); 288 KiPrimitive(avatar.LocalId);
@@ -293,7 +297,11 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
293 /// 297 ///
294 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) 298 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink)
295 { 299 {
296 Thread.Sleep(5000); 300 // FinishTeleport makes the client send CompleteMovementIntoRegion (at the destination), which
301 // trigers a whole shebang of things there. So let's wait plenty before we disconnect.
302 // The user is already there anyway.
303 Thread.Sleep(8000);
304 avatar.Close();
297 CloseConnection(avatar.UUID); 305 CloseConnection(avatar.UUID);
298 } 306 }
299 // if (teleport success) // seems to be always success here 307 // if (teleport success) // seems to be always success here