aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
diff options
context:
space:
mode:
authorDiva Canto2010-01-29 18:59:41 -0800
committerDiva Canto2010-01-29 18:59:41 -0800
commit5001f61c08fea2ebfcb2590be69073d04d129d70 (patch)
tree08a0470b0b566f814209bfb803fbcc0959333bcd /OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
parentWorks for grid login. (diff)
downloadopensim-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/EntityTransfer/HGEntityTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs28
1 files changed, 16 insertions, 12 deletions
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