diff options
author | Diva Canto | 2010-01-29 18:59:41 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-29 18:59:41 -0800 |
commit | 5001f61c08fea2ebfcb2590be69073d04d129d70 (patch) | |
tree | 08a0470b0b566f814209bfb803fbcc0959333bcd /OpenSim/Region/CoreModules/Framework | |
parent | Works for grid login. (diff) | |
download | opensim-SC_OLD-5001f61c08fea2ebfcb2590be69073d04d129d70.zip opensim-SC_OLD-5001f61c08fea2ebfcb2590be69073d04d129d70.tar.gz opensim-SC_OLD-5001f61c08fea2ebfcb2590be69073d04d129d70.tar.bz2 opensim-SC_OLD-5001f61c08fea2ebfcb2590be69073d04d129d70.tar.xz |
* HGGridConnector is no longer necessary.
* Handle logout properly. This needed an addition to IClientAPI, because of how the logout packet is currently being handled -- the agent is being removed from the scene before the different event handlers are executed, which is broken.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | 28 |
2 files changed, 20 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ee6cb04..53de269 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -268,7 +268,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
268 | if (sp.ParentID != (uint)0) | 268 | if (sp.ParentID != (uint)0) |
269 | sp.StandUp(); | 269 | sp.StandUp(); |
270 | 270 | ||
271 | m_log.Debug("XXX HERE 1"); | ||
272 | if (!sp.ValidateAttachments()) | 271 | if (!sp.ValidateAttachments()) |
273 | { | 272 | { |
274 | sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); | 273 | sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); |
@@ -351,7 +350,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
351 | // ES makes the client send a UseCircuitCode message to the destination, | 350 | // ES makes the client send a UseCircuitCode message to the destination, |
352 | // which triggers a bunch of things there. | 351 | // which triggers a bunch of things there. |
353 | // So let's wait | 352 | // So let's wait |
354 | Thread.Sleep(2000); | 353 | Thread.Sleep(200); |
355 | 354 | ||
356 | eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); | 355 | eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); |
357 | 356 | ||
@@ -428,13 +427,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
428 | return; | 427 | return; |
429 | } | 428 | } |
430 | 429 | ||
431 | KillEntity(sp.Scene, sp.LocalId); | ||
432 | |||
433 | sp.MakeChildAgent(); | ||
434 | 430 | ||
435 | // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it | 431 | // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it |
436 | CrossAttachmentsIntoNewRegion(finalDestination, sp, true); | 432 | CrossAttachmentsIntoNewRegion(finalDestination, sp, true); |
437 | 433 | ||
434 | KillEntity(sp.Scene, sp.LocalId); | ||
435 | |||
436 | sp.MakeChildAgent(); | ||
438 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 437 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
439 | 438 | ||
440 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 439 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index fbf8be9..28593fc 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -81,16 +81,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
81 | if (m_Enabled) | 81 | if (m_Enabled) |
82 | { | 82 | { |
83 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); | 83 | scene.RegisterModuleInterface<IUserAgentVerificationModule>(this); |
84 | scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(OnNewClient); | ||
85 | } | 84 | } |
86 | } | 85 | } |
87 | 86 | ||
88 | protected override void OnNewClient(IClientAPI client) | 87 | protected override void OnNewClient(IClientAPI client) |
89 | { | 88 | { |
90 | base.OnNewClient(client); | 89 | client.OnTeleportHomeRequest += TeleportHome; |
91 | client.OnLogout += new Action<IClientAPI>(OnLogout); | 90 | client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed); |
92 | } | 91 | } |
93 | 92 | ||
93 | |||
94 | public override void RegionLoaded(Scene scene) | 94 | public override void RegionLoaded(Scene scene) |
95 | { | 95 | { |
96 | base.RegionLoaded(scene); | 96 | base.RegionLoaded(scene); |
@@ -234,18 +234,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
234 | return false; | 234 | return false; |
235 | } | 235 | } |
236 | 236 | ||
237 | void OnLogout(IClientAPI obj) | 237 | void OnConnectionClosed(IClientAPI obj) |
238 | { | 238 | { |
239 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: client {0} logged out in {1}", obj.AgentId, obj.Scene.RegionInfo.RegionName); | 239 | if (obj.IsLoggingOut) |
240 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); | ||
241 | |||
242 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | ||
243 | { | 240 | { |
244 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | 241 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); |
245 | IUserAgentService security = new UserAgentServiceConnector(url); | ||
246 | security.LogoutAgent(obj.AgentId, obj.SessionId); | ||
247 | } | ||
248 | 242 | ||
243 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | ||
244 | { | ||
245 | string url = aCircuit.ServiceURLs["HomeURI"].ToString(); | ||
246 | IUserAgentService security = new UserAgentServiceConnector(url); | ||
247 | security.LogoutAgent(obj.AgentId, obj.SessionId); | ||
248 | //m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Sent logout call to UserAgentService @ {0}", url); | ||
249 | } | ||
250 | else | ||
251 | m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: HomeURI not found for agent {0} logout", obj.AgentId); | ||
252 | } | ||
249 | } | 253 | } |
250 | 254 | ||
251 | #endregion | 255 | #endregion |