summaryrefslogtreecommitdiffhomepage
path: root/proto-simconnect/ftnoir_protocol_sc.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-12-28 03:20:23 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-01-16 07:48:18 +0100
commitb21b6371e3d09551e1cc4d81a0021942dfc064e9 (patch)
treeb153ac24f84c51c5d0393f9ee80a6b16e00ed8c4 /proto-simconnect/ftnoir_protocol_sc.cpp
parent70048a925a7e34e1307c7ca501671f0bd75ec817 (diff)
proto/simconnect: crap
Diffstat (limited to 'proto-simconnect/ftnoir_protocol_sc.cpp')
-rw-r--r--proto-simconnect/ftnoir_protocol_sc.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/proto-simconnect/ftnoir_protocol_sc.cpp b/proto-simconnect/ftnoir_protocol_sc.cpp
index bd7f0960..580dc257 100644
--- a/proto-simconnect/ftnoir_protocol_sc.cpp
+++ b/proto-simconnect/ftnoir_protocol_sc.cpp
@@ -42,12 +42,12 @@ void simconnect::run()
}
Timer tm;
- should_reconnect = false;
+ reconnect = false;
if (SUCCEEDED(hr))
while (!isInterruptionRequested())
{
- if (should_reconnect)
+ if (reconnect)
break;
if (WaitForSingleObject(event, 100) == WAIT_OBJECT_0)
@@ -60,17 +60,17 @@ void simconnect::run()
break;
}
}
+
+ if (reconnect)
+ break;
+
else
{
- const int idle_seconds = tm.elapsed_seconds();
-
+ const int idle_seconds = (int)tm.elapsed_seconds();
constexpr int max_idle_seconds = 2;
if (idle_seconds >= max_idle_seconds)
- {
- qDebug() << "simconnect: reconnect";
break;
- }
}
}
@@ -203,11 +203,11 @@ void CALLBACK simconnect::processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWO
break;
case SIMCONNECT_RECV_ID_EXCEPTION:
qDebug() << "simconnect: got exception";
- //self.should_reconnect = true;
+ //self.reconnect = true;
break;
case SIMCONNECT_RECV_ID_QUIT:
qDebug() << "simconnect: got quit event";
- self.should_reconnect = true;
+ self.reconnect = true;
break;
case SIMCONNECT_RECV_ID_EVENT_FRAME:
self.handle();