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:
parent
5958478c59
commit
7a26fbe471
@ -37,9 +37,7 @@ cAuthenticator::cAuthenticator(void) :
|
|||||||
|
|
||||||
cAuthenticator::~cAuthenticator()
|
cAuthenticator::~cAuthenticator()
|
||||||
{
|
{
|
||||||
mShouldTerminate = true;
|
Stop();
|
||||||
mQueueNonempty.Set();
|
|
||||||
Wait();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -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)
|
void cAuthenticator::Execute(void)
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
|
@ -42,6 +42,9 @@ public:
|
|||||||
/// Queues a request for authenticating a user. If the auth fails, the user is kicked
|
/// Queues a request for authenticating a user. If the auth fails, the user is kicked
|
||||||
void Authenticate(const AString & iUserName, const AString & iServerHash);
|
void Authenticate(const AString & iUserName, const AString & iServerHash);
|
||||||
|
|
||||||
|
// Stops the authenticator thread
|
||||||
|
void Stop(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
class cUser
|
class cUser
|
||||||
|
@ -139,6 +139,7 @@ void cRoot::Start()
|
|||||||
|
|
||||||
// Deallocate stuffs
|
// Deallocate stuffs
|
||||||
m_Server->Shutdown(); // This waits for threads to stop and d/c clients
|
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_PluginManager; m_PluginManager = 0; // This should be first
|
||||||
delete m_MonsterConfig; m_MonsterConfig = 0;
|
delete m_MonsterConfig; m_MonsterConfig = 0;
|
||||||
if( m_WebAdmin ) { delete m_WebAdmin; m_WebAdmin = 0; }
|
if( m_WebAdmin ) { delete m_WebAdmin; m_WebAdmin = 0; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user