Shutdown a bot's actions by making it check for disconnecting state rather than aborting the thread.
Aborting the thread appears to be causing shutdown issues.0.7.6-extended
parent
3a62f39044
commit
97c514daa5
|
@ -158,7 +158,7 @@ namespace pCampBot
|
||||||
//add additional steps and/or things the bot should do
|
//add additional steps and/or things the bot should do
|
||||||
private void Action()
|
private void Action()
|
||||||
{
|
{
|
||||||
while (true)
|
while (ConnectionState != ConnectionState.Disconnecting)
|
||||||
lock (Behaviours)
|
lock (Behaviours)
|
||||||
Behaviours.ForEach(
|
Behaviours.ForEach(
|
||||||
b =>
|
b =>
|
||||||
|
@ -178,8 +178,8 @@ namespace pCampBot
|
||||||
{
|
{
|
||||||
ConnectionState = ConnectionState.Disconnecting;
|
ConnectionState = ConnectionState.Disconnecting;
|
||||||
|
|
||||||
if (m_actionThread != null)
|
// if (m_actionThread != null)
|
||||||
m_actionThread.Abort();
|
// m_actionThread.Abort();
|
||||||
|
|
||||||
Client.Network.Logout();
|
Client.Network.Logout();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue