* Separate starting a client thread into a separate Start() method (which matches the existing Stop() and Restart() methods)

This commit is contained in:
Justin Clarke Casey
2009-01-12 19:37:56 +00:00
parent 2cfd18b6a2
commit ade107f04f
6 changed files with 47 additions and 20 deletions

View File

@@ -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();
}
/// <summary>
/// Start a user session. This method lies at the base of the entire client thread.
/// </summary>
protected virtual void Start()
public virtual void Start()
{
m_clientThread = new Thread(RunUserSession);
m_clientThread.Name = "ClientThread";
m_clientThread.IsBackground = true;
m_clientThread.Start();
ThreadTracker.Add(m_clientThread);
}
/// <summary>
/// Run a user session. This method lies at the base of the entire client thread.
/// </summary>
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();

View File

@@ -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;
}