mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user