mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Agent gets there through the Gatekeeper, but still a few quirks to fix.
This commit is contained in:
@@ -239,12 +239,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
//avatar.Scene.RemoveCapsHandler(avatar.UUID);
|
||||
|
||||
string capsPath = String.Empty;
|
||||
|
||||
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
|
||||
AgentCircuitData agentCircuit = sp.ControllingClient.RequestClientInfo();
|
||||
agentCircuit.BaseFolder = UUID.Zero;
|
||||
agentCircuit.InventoryFolder = UUID.Zero;
|
||||
agentCircuit.startpos = position;
|
||||
agentCircuit.child = true;
|
||||
agentCircuit.Appearance = sp.Appearance;
|
||||
if (currentAgentCircuit != null)
|
||||
agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs;
|
||||
|
||||
if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
@@ -255,9 +257,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
string reason = String.Empty;
|
||||
|
||||
// Let's create an agent there if one doesn't exist yet.
|
||||
if (!m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason))
|
||||
if (!CreateAgent(reg, finalDestination, agentCircuit, teleportFlags, out reason))
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}",
|
||||
sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
|
||||
reason));
|
||||
return;
|
||||
}
|
||||
@@ -345,8 +347,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.CallbackURI = "http://" + sp.Scene.RegionInfo.ExternalHostName + ":" + sp.Scene.RegionInfo.HttpPort +
|
||||
"/agent/" + sp.UUID.ToString() + "/" + sp.Scene.RegionInfo.RegionID.ToString() + "/release/";
|
||||
|
||||
// Straight to the region. Safe.
|
||||
m_aScene.SimulationService.UpdateAgent(reg, agent);
|
||||
UpdateAgent(reg, finalDestination, agent);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID);
|
||||
@@ -444,6 +445,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
||||
{
|
||||
return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
|
||||
}
|
||||
|
||||
protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent)
|
||||
{
|
||||
return m_aScene.SimulationService.UpdateAgent(reg, agent);
|
||||
}
|
||||
|
||||
protected void KillEntity(Scene scene, uint localID)
|
||||
{
|
||||
scene.SendKillObject(localID);
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Connectors.Hypergrid;
|
||||
@@ -58,6 +59,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
}
|
||||
|
||||
private GatekeeperServiceConnector m_GatekeeperConnector;
|
||||
|
||||
#region ISharedRegionModule
|
||||
|
||||
public override string Name
|
||||
@@ -74,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (name == Name)
|
||||
{
|
||||
m_agentsInTransit = new List<UUID>();
|
||||
m_GatekeeperConnector = new GatekeeperServiceConnector();
|
||||
m_Enabled = true;
|
||||
m_log.InfoFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
|
||||
}
|
||||
@@ -131,6 +135,29 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool CreateAgent(GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
|
||||
{
|
||||
reason = string.Empty;
|
||||
if (reg.RegionLocX != finalDestination.RegionLocX && reg.RegionLocY != finalDestination.RegionLocY)
|
||||
{
|
||||
// this user is going to another grid
|
||||
reg.RegionName = finalDestination.RegionName;
|
||||
return m_GatekeeperConnector.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
|
||||
}
|
||||
|
||||
return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
|
||||
}
|
||||
|
||||
protected override bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent)
|
||||
{
|
||||
if (reg.RegionLocX != finalDestination.RegionLocX && reg.RegionLocY != finalDestination.RegionLocY)
|
||||
{
|
||||
// this user is going to another grid
|
||||
return m_GatekeeperConnector.UpdateAgent(reg, agent);
|
||||
}
|
||||
|
||||
return m_aScene.SimulationService.UpdateAgent(reg, agent);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user