From 23a334b9f54a1ef5df3b503c165e7b76b746a2b1 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 13 Oct 2009 14:50:03 -0700 Subject: * Rewrote ClientManager to remove Lindenisms from OpenSim core, improve performance by removing locks, and replace LLUDPClientCollection * Removed the confusing (and LL-specific) shutdowncircuit parameter from IClientAPI.Close() * Updated the LLUDP code to only use ClientManager instead of trying to synchronize ClientManager and m_clients * Remove clients asynchronously since it is a very slow operation (including a 2000ms sleep) --- OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 14 ++++++++++++-- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index ac8b98c..f7c63ac 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -825,7 +825,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public void Close(bool ShutdownCircuit) + public void Close() { } @@ -838,11 +838,21 @@ namespace OpenSim.Region.OptionalModules.World.NPC } private uint m_circuitCode; + private IPEndPoint m_remoteEndPoint; public uint CircuitCode { get { return m_circuitCode; } - set { m_circuitCode = value; } + set + { + m_circuitCode = value; + m_remoteEndPoint = new IPEndPoint(IPAddress.Loopback, (ushort)m_circuitCode); + } + } + + public IPEndPoint RemoteEndPoint + { + get { return m_remoteEndPoint; } } public void SendBlueBoxMessage(UUID FromAvatarID, String FromAvatarName, String Message) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 30a2675..eb7b0d7 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -155,7 +155,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC NPCAvatar npcAvatar = new NPCAvatar(p_firstname, p_lastname, p_position, p_scene); npcAvatar.CircuitCode = (uint) Util.RandomClass.Next(0, int.MaxValue); - p_scene.ClientManager.Add(npcAvatar.CircuitCode, npcAvatar); + p_scene.ClientManager.Add(npcAvatar.AgentId, npcAvatar.RemoteEndPoint, npcAvatar); p_scene.AddNewClient(npcAvatar); ScenePresence sp; -- cgit v1.1