mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Merge branch 'master' into careminster
This commit is contained in:
@@ -37,7 +37,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
#region Agents
|
||||
|
||||
bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason);
|
||||
bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, uint teleportFlags, out string reason);
|
||||
|
||||
/// <summary>
|
||||
/// Full child agent update.
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||
string reason = String.Empty;
|
||||
|
||||
//if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
|
||||
if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, out reason))
|
||||
if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, teleportFlags, out reason))
|
||||
{
|
||||
avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}",
|
||||
reason));
|
||||
|
||||
@@ -3343,12 +3343,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// Use NewUserConnection() directly if possible so the return type can refuse connections.
|
||||
/// At the moment nothing actually seems to use this event,
|
||||
/// as everything is switching to calling the NewUserConnection method directly.
|
||||
///
|
||||
/// Now obsoleting this because it doesn't handle teleportFlags propertly
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="agent"></param>
|
||||
[Obsolete("Please call NewUserConnection directly.")]
|
||||
public void HandleNewUserConnection(AgentCircuitData agent)
|
||||
{
|
||||
string reason;
|
||||
NewUserConnection(agent, out reason);
|
||||
NewUserConnection(agent, 0, out reason);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3361,8 +3365,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="reason">Outputs the reason for the false response on this string</param>
|
||||
/// <returns>True if the region accepts this agent. False if it does not. False will
|
||||
/// also return a reason.</returns>
|
||||
public bool NewUserConnection(AgentCircuitData agent, out string reason)
|
||||
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
|
||||
{
|
||||
//Teleport flags:
|
||||
//
|
||||
// TeleportFlags.ViaGodlikeLure - Border Crossing
|
||||
// TeleportFlags.ViaLogin - Login
|
||||
// TeleportFlags.TeleportFlags.ViaLure - Teleport request sent by another user
|
||||
// TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport
|
||||
|
||||
|
||||
if (loginsdisabled)
|
||||
{
|
||||
reason = "Logins Disabled";
|
||||
@@ -3370,9 +3382,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
// Don't disable this log message - it's too helpful
|
||||
m_log.InfoFormat(
|
||||
"[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5})",
|
||||
"[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode);
|
||||
agent.AgentID, agent.circuitcode, teleportFlags);
|
||||
|
||||
reason = String.Empty;
|
||||
if (!AuthenticateUser(agent, out reason))
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
string reason = String.Empty;
|
||||
|
||||
|
||||
bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason);
|
||||
bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, 0, out reason);
|
||||
|
||||
if (regionAccepted && newAgent)
|
||||
{
|
||||
@@ -835,7 +835,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Let's create an agent there if one doesn't exist yet.
|
||||
//if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
|
||||
if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, out reason))
|
||||
if (!m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, agentCircuit, teleportFlags, out reason))
|
||||
{
|
||||
avatar.ControllingClient.SendTeleportFailed(String.Format("Destination is not accepting teleports: {0}",
|
||||
reason));
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
agent.child = true;
|
||||
|
||||
string reason;
|
||||
scene.NewUserConnection(agent, out reason);
|
||||
scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason);
|
||||
testclient = new TestClient(agent, scene);
|
||||
scene.AddNewClient(testclient);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
if (acd1 == null)
|
||||
fixNullPresence();
|
||||
|
||||
scene.NewUserConnection(acd1, out reason);
|
||||
scene.NewUserConnection(acd1, 0, out reason);
|
||||
if (testclient == null)
|
||||
testclient = new TestClient(acd1, scene);
|
||||
scene.AddNewClient(testclient);
|
||||
@@ -242,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
|
||||
// Adding child agent to region 1001
|
||||
string reason;
|
||||
scene2.NewUserConnection(acd1, out reason);
|
||||
scene2.NewUserConnection(acd1,0, out reason);
|
||||
scene2.AddNewClient(testclient);
|
||||
|
||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
||||
|
||||
Reference in New Issue
Block a user