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/ClientStack/Linden/UDP/LLUDPServer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 7db5f6b..4ab8fd0 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -897,12 +897,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP IClientAPI client = AddNewClient((UseCircuitCodePacket)packet, remoteEndPoint); // Send ack straight away to let the viewer know that the connection is active. + // The client will be null if it already exists (e.g. if on a region crossing the client sends a use + // circuit code to the existing child agent. This is not particularly obvious. SendAckImmediate(remoteEndPoint, packet.Header.Sequence); - // FIXME: Nasty - this is the only way we currently know if Scene.AddNewClient() failed to find a - // circuit and bombed out early. That check might be pointless since authorization is established - // up here. - if (client != null && client.SceneAgent != null) + // We only want to send initial data to new clients, not ones which are being converted from child to root. + if (client != null) client.SceneAgent.SendInitialDataToMe(); // m_log.DebugFormat( -- cgit v1.1