1
0

Can use the 'restart' command again. cAuthenticator no longer asserts because it properly stops when the server is stopped.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@266 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth 2012-02-15 21:47:21 +00:00
parent 5958478c59
commit 7a26fbe471
3 changed files with 16 additions and 3 deletions

View File

@ -37,9 +37,7 @@ cAuthenticator::cAuthenticator(void) :
cAuthenticator::~cAuthenticator()
{
mShouldTerminate = true;
mQueueNonempty.Set();
Wait();
Stop();
}
@ -102,6 +100,17 @@ void cAuthenticator::Authenticate(const AString & iUserName, const AString & iSe
void cAuthenticator::Stop(void)
{
mShouldTerminate = true;
mQueueNonempty.Set();
Wait();
}
void cAuthenticator::Execute(void)
{
while (true)

View File

@ -41,6 +41,9 @@ public:
/// Queues a request for authenticating a user. If the auth fails, the user is kicked
void Authenticate(const AString & iUserName, const AString & iServerHash);
// Stops the authenticator thread
void Stop(void);
private:

View File

@ -139,6 +139,7 @@ void cRoot::Start()
// Deallocate stuffs
m_Server->Shutdown(); // This waits for threads to stop and d/c clients
m_Authenticator.Stop();
delete m_PluginManager; m_PluginManager = 0; // This should be first
delete m_MonsterConfig; m_MonsterConfig = 0;
if( m_WebAdmin ) { delete m_WebAdmin; m_WebAdmin = 0; }