From ade107f04f42f448d0a7b34ae552cf54c3bf4f7e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 12 Jan 2009 19:37:56 +0000 Subject: * Separate starting a client thread into a separate Start() method (which matches the existing Stop() and Restart() methods) --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 21 ++++++++++++--------- .../Region/ClientStack/LindenUDP/LLPacketServer.cs | 2 ++ .../Environment/Modules/World/NPC/NPCAvatar.cs | 4 ++++ .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 4 ++++ 4 files changed, 22 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3243c2f..ebbecb7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -471,12 +471,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_PacketHandler.OnPacketStats += PopulateStats; RegisterLocalPacketHandlers(); - - m_clientThread = new Thread(Start); - m_clientThread.Name = "ClientThread"; - m_clientThread.IsBackground = true; - m_clientThread.Start(); - ThreadTracker.Add(m_clientThread); } public void SetDebugPacketLevel(int newDebugPacketLevel) @@ -813,11 +807,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP RefreshGroupMembership(); } + public virtual void Start() + { + m_clientThread = new Thread(RunUserSession); + m_clientThread.Name = "ClientThread"; + m_clientThread.IsBackground = true; + m_clientThread.Start(); + ThreadTracker.Add(m_clientThread); + } + /// - /// Start a user session. This method lies at the base of the entire client thread. + /// Run a user session. This method lies at the base of the entire client thread. /// - protected virtual void Start() - { + protected virtual void RunUserSession() + { //tell this thread we are using the culture set up for the sim (currently hardcoded to en_US) //otherwise it will override this and use the system default Culture.SetCurrentCulture(); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs index 9f8383c..2b52220 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketServer.cs @@ -160,6 +160,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler; newuser.OnLogout += LogoutHandler; newuser.OnConnectionClosed += CloseClient; + + newuser.Start(); return true; } diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index d06f35a..f0d5de2 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -812,6 +812,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { } + public void Start() + { + } + public void Stop() { } diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 5a7d42c..3710f2c 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -800,6 +800,10 @@ namespace OpenSim.Region.Examples.SimpleModule { } + public void Start() + { + } + public void Stop() { } -- cgit v1.1