private void Disconnect(BattlEyeDisconnectionType? disconnectionType)
{
if (disconnectionType == BattlEyeDisconnectionType.ConnectionLost)
this.disconnectionType = BattlEyeDisconnectionType.ConnectionLost;
keepRunning = false;
if (socket.Connected)
{
socket.Shutdown(SocketShutdown.Both);
socket.Close();
}
if (disconnectionType != null)
OnDisconnect(loginCredentials, disconnectionType);
}