Merge branch 'master' into careminster-presence-refactor
commit
5e4bee0f34
|
@ -1132,7 +1132,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
string reason = String.Empty;
|
string reason = String.Empty;
|
||||||
|
|
||||||
|
|
||||||
bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, 0, out reason); // m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, 0, out reason);
|
bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
|
||||||
|
|
||||||
if (regionAccepted && newAgent)
|
if (regionAccepted && newAgent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2508,7 +2508,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when objects or attachments cross the border between regions.
|
/// Called when objects or attachments cross the border, or teleport, between regions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sog"></param>
|
/// <param name="sog"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
@ -2538,6 +2538,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// Do this as late as possible so that listeners have full access to the incoming object
|
// Do this as late as possible so that listeners have full access to the incoming object
|
||||||
EventManager.TriggerOnIncomingSceneObject(newObject);
|
EventManager.TriggerOnIncomingSceneObject(newObject);
|
||||||
|
|
||||||
|
TriggerChangedTeleport(newObject);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2605,22 +2607,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Fix up attachment Parent Local ID
|
// Fix up attachment Parent Local ID
|
||||||
ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
|
ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
|
||||||
|
|
||||||
//uint parentLocalID = 0;
|
|
||||||
if (sp != null)
|
if (sp != null)
|
||||||
{
|
{
|
||||||
//parentLocalID = sp.LocalId;
|
|
||||||
|
|
||||||
//sceneObject.RootPart.IsAttachment = true;
|
|
||||||
//sceneObject.RootPart.SetParentLocalId(parentLocalID);
|
|
||||||
|
|
||||||
SceneObjectGroup grp = sceneObject;
|
SceneObjectGroup grp = sceneObject;
|
||||||
|
|
||||||
//RootPrim.SetParentLocalId(parentLocalID);
|
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID);
|
"[ATTACHMENT]: Received attachment {0}, inworld asset id {1}", grp.GetFromItemID(), grp.UUID);
|
||||||
|
|
||||||
//grp.SetFromAssetID(grp.RootPart.LastOwnerID);
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
|
"[ATTACHMENT]: Attach to avatar {0} at position {1}", sp.UUID, grp.AbsolutePosition);
|
||||||
|
|
||||||
|
@ -2630,7 +2623,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
AttachmentsModule.AttachObject(
|
AttachmentsModule.AttachObject(
|
||||||
sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
|
sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false);
|
||||||
|
|
||||||
//grp.SendGroupFullUpdate();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2658,6 +2650,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TriggerChangedTeleport(SceneObjectGroup sog)
|
||||||
|
{
|
||||||
|
ScenePresence sp = GetScenePresence(sog.OwnerID);
|
||||||
|
|
||||||
|
if (sp != null)
|
||||||
|
{
|
||||||
|
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(sp.UUID);
|
||||||
|
|
||||||
|
if (aCircuit != null && (aCircuit.teleportFlags != (uint)TeleportFlags.Default))
|
||||||
|
{
|
||||||
|
// This will get your attention
|
||||||
|
//m_log.Error("[XXX] Triggering ");
|
||||||
|
|
||||||
|
// Trigger CHANGED_TELEPORT
|
||||||
|
sp.Scene.EventManager.TriggerOnScriptChangedEvent(sog.LocalId, (uint)Changed.TELEPORT);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add/Remove Avatar Methods
|
#region Add/Remove Avatar Methods
|
||||||
|
@ -3465,6 +3478,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
|
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
|
||||||
{
|
{
|
||||||
TeleportFlags tp = (TeleportFlags)teleportFlags;
|
TeleportFlags tp = (TeleportFlags)teleportFlags;
|
||||||
|
reason = String.Empty;
|
||||||
|
|
||||||
//Teleport flags:
|
//Teleport flags:
|
||||||
//
|
//
|
||||||
// TeleportFlags.ViaGodlikeLure - Border Crossing
|
// TeleportFlags.ViaGodlikeLure - Border Crossing
|
||||||
|
@ -3472,52 +3487,34 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// TeleportFlags.TeleportFlags.ViaLure - Teleport request sent by another user
|
// TeleportFlags.TeleportFlags.ViaLure - Teleport request sent by another user
|
||||||
// TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport
|
// TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport
|
||||||
|
|
||||||
|
|
||||||
if (LoginsDisabled)
|
|
||||||
{
|
|
||||||
reason = "Logins Disabled";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Don't disable this log message - it's too helpful
|
// Don't disable this log message - it's too helpful
|
||||||
m_log.InfoFormat(
|
m_log.InfoFormat(
|
||||||
"[CONNECTION BEGIN]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6})",
|
"[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,
|
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
||||||
agent.AgentID, agent.circuitcode, teleportFlags);
|
agent.AgentID, agent.circuitcode, teleportFlags);
|
||||||
|
|
||||||
reason = String.Empty;
|
if (LoginsDisabled)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (!VerifyUserPresence(agent, out reason))
|
reason = "Logins Disabled";
|
||||||
return false;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
ScenePresence sp = GetScenePresence(agent.AgentID);
|
||||||
{
|
|
||||||
if (!AuthorizeUser(agent, out reason))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.InfoFormat(
|
if (sp != null && !sp.IsChildAgent)
|
||||||
"[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})",
|
{
|
||||||
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
// We have a zombie from a crashed session.
|
||||||
agent.AgentID, agent.circuitcode);
|
// Or the same user is trying to be root twice here, won't work.
|
||||||
|
// Kill it.
|
||||||
CapsModule.NewUserConnection(agent);
|
m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName);
|
||||||
|
sp.ControllingClient.Close();
|
||||||
|
sp = null;
|
||||||
|
}
|
||||||
|
|
||||||
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
||||||
|
|
||||||
//On login or border crossing test land permisions
|
//On login test land permisions
|
||||||
if (tp != TeleportFlags.Default)
|
if (tp == TeleportFlags.ViaLogin)
|
||||||
{
|
{
|
||||||
if (land != null && !TestLandRestrictions(agent, land, out reason))
|
if (land != null && !TestLandRestrictions(agent, land, out reason))
|
||||||
{
|
{
|
||||||
|
@ -3525,8 +3522,40 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScenePresence sp = GetScenePresence(agent.AgentID);
|
if (sp == null) // We don't have an [child] agent here already
|
||||||
if (sp != null)
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!VerifyUserPresence(agent, out reason))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!AuthorizeUser(agent, out reason))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_log.InfoFormat(
|
||||||
|
"[CONNECTION BEGIN]: Region {0} authenticated and authorized incoming {1} agent {2} {3} {4} (circuit code {5})",
|
||||||
|
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
||||||
|
agent.AgentID, agent.circuitcode);
|
||||||
|
|
||||||
|
CapsModule.NewUserConnection(agent);
|
||||||
|
CapsModule.AddCapsHandler(agent.AgentID);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (sp.IsChildAgent)
|
if (sp.IsChildAgent)
|
||||||
{
|
{
|
||||||
|
@ -3535,25 +3564,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
agent.AgentID, RegionInfo.RegionName);
|
agent.AgentID, RegionInfo.RegionName);
|
||||||
|
|
||||||
sp.AdjustKnownSeeds();
|
sp.AdjustKnownSeeds();
|
||||||
|
CapsModule.NewUserConnection(agent);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// We have a zombie from a crashed session. Kill it.
|
|
||||||
m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName);
|
|
||||||
sp.ControllingClient.Close(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CapsModule.AddCapsHandler(agent.AgentID);
|
|
||||||
|
|
||||||
if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0)
|
// In all cases, add or update the circuit data with the new agent circuit data and teleport flags
|
||||||
System.Threading.Thread.Sleep(2000);
|
agent.teleportFlags = teleportFlags;
|
||||||
|
m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
|
||||||
|
|
||||||
if (!agent.child)
|
if (tp == TeleportFlags.ViaLogin)
|
||||||
{
|
{
|
||||||
if (TestBorderCross(agent.startpos,Cardinals.E))
|
if (TestBorderCross(agent.startpos, Cardinals.E))
|
||||||
{
|
{
|
||||||
Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
|
Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
|
||||||
agent.startpos.X = crossedBorder.BorderLine.Z - 1;
|
agent.startpos.X = crossedBorder.BorderLine.Z - 1;
|
||||||
|
@ -3621,9 +3643,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
agent.teleportFlags = teleportFlags;
|
|
||||||
m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue