mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
* 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.
This commit is contained in:
@@ -268,7 +268,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (sp.ParentID != (uint)0)
|
||||
sp.StandUp();
|
||||
|
||||
m_log.Debug("XXX HERE 1");
|
||||
if (!sp.ValidateAttachments())
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state");
|
||||
@@ -351,7 +350,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// ES makes the client send a UseCircuitCode message to the destination,
|
||||
// which triggers a bunch of things there.
|
||||
// So let's wait
|
||||
Thread.Sleep(2000);
|
||||
Thread.Sleep(200);
|
||||
|
||||
eq.EstablishAgentCommunication(sp.UUID, endPoint, capsPath);
|
||||
|
||||
@@ -428,13 +427,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
KillEntity(sp.Scene, sp.LocalId);
|
||||
|
||||
sp.MakeChildAgent();
|
||||
|
||||
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
|
||||
CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
|
||||
|
||||
KillEntity(sp.Scene, sp.LocalId);
|
||||
|
||||
sp.MakeChildAgent();
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
|
||||
if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
|
||||
@@ -81,16 +81,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (m_Enabled)
|
||||
{
|
||||
scene.RegisterModuleInterface<IUserAgentVerificationModule>(this);
|
||||
scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(OnNewClient);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnNewClient(IClientAPI client)
|
||||
{
|
||||
base.OnNewClient(client);
|
||||
client.OnLogout += new Action<IClientAPI>(OnLogout);
|
||||
client.OnTeleportHomeRequest += TeleportHome;
|
||||
client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed);
|
||||
}
|
||||
|
||||
|
||||
public override void RegionLoaded(Scene scene)
|
||||
{
|
||||
base.RegionLoaded(scene);
|
||||
@@ -234,18 +234,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnLogout(IClientAPI obj)
|
||||
void OnConnectionClosed(IClientAPI obj)
|
||||
{
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: client {0} logged out in {1}", obj.AgentId, obj.Scene.RegionInfo.RegionName);
|
||||
AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode);
|
||||
|
||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||
if (obj.IsLoggingOut)
|
||||
{
|
||||
string url = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||
IUserAgentService security = new UserAgentServiceConnector(url);
|
||||
security.LogoutAgent(obj.AgentId, obj.SessionId);
|
||||
}
|
||||
AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode);
|
||||
|
||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||
{
|
||||
string url = aCircuit.ServiceURLs["HomeURI"].ToString();
|
||||
IUserAgentService security = new UserAgentServiceConnector(url);
|
||||
security.LogoutAgent(obj.AgentId, obj.SessionId);
|
||||
//m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Sent logout call to UserAgentService @ {0}", url);
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: HomeURI not found for agent {0} logout", obj.AgentId);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user