Closed Wotuu closed 11 years ago
Hmm maybe I should start using versions to track issues. ^^
Did you try it with the latest code? It shouldn't happen anymore though. When you call Disconnect() it sets _keepRunning to false which is then checked. It should only fire once.
if (!_socket.Connected)
{
if (_reconnectOnPacketLoss && _keepRunning)
{
Connect();
}
else if (!_keepRunning)
{
//let the thread finish without further action
}
else
{
OnDisconnect(_loginCredentials, _disconnectionType);
}
}
No I didn't update the code because I'm afraid it'll break stuff and I can't be arsed to fix it :p. Hence the "Not sure if this is still around in the current version" comment in my original post.
But I guess I should update and fix the errors that may pop up. I have another issue that Ill post about when I see it isn't fixed / added in the latest version.
I've (hopefully) made sure to keep possible breaking to a minimum. All you have to do to get it working again is changing
IBattleNET b = new BattlEyeClient(loginCredentials);
to
BattlEyeClient b = new BattlEyeClient(loginCredentials);
Too much effort!
J/k, sweet, I'll update it later today when I get home from work then!
Might have found the cause, have you set ReconnectOnPacketLoss to false?
I already told you what the cause was and how to solve it? :o
ReConnectOnPacketLoss is true. I have already manually fixed the issue by what was stated above.
Oh my bad, sorry. I was talking about the latest code. Your specific bug shouldn't happen in latest code anyway. I guess I was talking about a different case.
Still waiting for confirmation though. :)
I didn't get around to updating the lib yet (was too busy with writing my own code; read: I forgot). I will report back if I updated it and it happens still!
Edit: I did get around to creating some nice stuff up till now, so I can't thank you enough for the lib!
I'm assuming this is fixed?
Yes sorry, it is fixed!
Awesome. :)
The issue lies in the fact that the function itself raises the OnDisconnect() event, and the event is raised when the main loop dies as well (DoWork() function).
Simple solution would be to remove the OnDisconnect() event from the BattlEyeClient.Disconnect() function, and let the DoWork() function handle the event.