From 0e265889dd909d23b45175ec0e6f2d52725c008c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 8 Dec 2011 19:25:24 +0000 Subject: 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 --- OpenSim/Region/Framework/Scenes/Scene.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d47536a..11505cc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2486,21 +2486,14 @@ namespace OpenSim.Region.Framework.Scenes #region Add/Remove Avatar Methods - /// - /// Add a new client and create a child scene presence for it. - /// - /// - /// The type of agent to add. 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(); -- cgit v1.1