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

0.6.2-post-fixes
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

@ -527,6 +527,9 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
string Name { get; } string Name { get; }
/// <value>
/// Determines whether the client thread is doing anything or not.
/// </value>
bool IsActive { get; set; } bool IsActive { get; set; }
bool SendLogoutPacketWhenClosing { set; } bool SendLogoutPacketWhenClosing { set; }
@ -749,6 +752,23 @@ namespace OpenSim.Framework
event UserInfoRequest OnUserInfoRequest; event UserInfoRequest OnUserInfoRequest;
event UpdateUserInfo OnUpdateUserInfo; event UpdateUserInfo OnUpdateUserInfo;
/// <summary>
/// Set the debug level at which packet output should be printed to console.
/// </summary>
void SetDebugPacketLevel(int newDebug);
void InPacket(object NewPack);
void ProcessInPacket(Packet NewPack);
void Close(bool ShutdownCircuit);
void Kick(string message);
/// <summary>
/// Start processing for this client.
/// </summary>
void Start();
void Stop();
// void ActivateGesture(UUID assetId, UUID gestureId); // void ActivateGesture(UUID assetId, UUID gestureId);
@ -1034,16 +1054,6 @@ namespace OpenSim.Framework
byte[] GetThrottlesPacked(float multiplier); byte[] GetThrottlesPacked(float multiplier);
/// <summary>
/// Set the debug level at which packet output should be printed to console.
/// </summary>
void SetDebugPacketLevel(int newDebug);
void InPacket(object NewPack);
void ProcessInPacket(Packet NewPack);
void Close(bool ShutdownCircuit);
void Kick(string message);
void Stop();
event ViewerEffectEventHandler OnViewerEffect; event ViewerEffectEventHandler OnViewerEffect;
event Action<IClientAPI> OnLogout; event Action<IClientAPI> OnLogout;
event Action<IClientAPI> OnConnectionClosed; event Action<IClientAPI> OnConnectionClosed;

View File

@ -471,12 +471,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_PacketHandler.OnPacketStats += PopulateStats; m_PacketHandler.OnPacketStats += PopulateStats;
RegisterLocalPacketHandlers(); 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) public void SetDebugPacketLevel(int newDebugPacketLevel)
@ -813,11 +807,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
RefreshGroupMembership(); RefreshGroupMembership();
} }
/// <summary> public virtual void Start()
/// Start a user session. This method lies at the base of the entire client thread.
/// </summary>
protected 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) //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 //otherwise it will override this and use the system default
Culture.SetCurrentCulture(); Culture.SetCurrentCulture();

View File

@ -160,6 +160,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler; newuser.OnViewerEffect += m_scene.ClientManager.ViewerEffectHandler;
newuser.OnLogout += LogoutHandler; newuser.OnLogout += LogoutHandler;
newuser.OnConnectionClosed += CloseClient; newuser.OnConnectionClosed += CloseClient;
newuser.Start();
return true; return true;
} }

View File

@ -812,6 +812,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
{ {
} }
public void Start()
{
}
public void Stop() public void Stop()
{ {
} }

View File

@ -800,6 +800,10 @@ namespace OpenSim.Region.Examples.SimpleModule
{ {
} }
public void Start()
{
}
public void Stop() public void Stop()
{ {
} }

View File

@ -757,6 +757,10 @@ namespace OpenSim.Tests.Common.Mock
{ {
} }
public void Start()
{
}
public void Stop() public void Stop()
{ {
} }