Remove unnecessary AgentCircuitData null check from Scene.AddNewClient().

The only caller is the LLUDP stack and this has to validate the UDP circuit itself, so we know that it exists.
This allows us to eliminate another null check elsewhere and simplifies the method contract
This commit is contained in:
Justin Clark-Casey (justincc)
2011-12-08 19:25:24 +00:00
parent 55de189752
commit 0e265889dd
4 changed files with 10 additions and 19 deletions

View File

@@ -2486,21 +2486,14 @@ namespace OpenSim.Region.Framework.Scenes
#region Add/Remove Avatar Methods
/// <summary>
/// Add a new client and create a child scene presence for it.
/// </summary>
/// <param name="client"></param>
/// <param name="type">The type of agent to add.</param>
public override ISceneAgent AddNewClient(IClientAPI client, PresenceType type)
{
// Validation occurs in LLUDPServer
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
bool vialogin = false;
if (aCircuit == null) // no good, didn't pass NewUserConnection successfully
return null;
vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 ||
(aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
bool vialogin
= (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0
|| (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
CheckHeartbeat();

View File

@@ -2548,7 +2548,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// This agent just became root. We are going to tell everyone about it. The process of
// getting other avatars information was initiated in the constructor... don't do it
// getting other avatars information was initiated elsewhere immediately after the child circuit connected... don't do it
// again here... this comes after the cached appearance check because the avatars
// appearance goes into the avatar update packet
SendAvatarDataToAllAgents();