diff --git a/vSMR/SMRPlugin.cpp b/vSMR/SMRPlugin.cpp index 79d9af56c..4779838b7 100644 --- a/vSMR/SMRPlugin.cpp +++ b/vSMR/SMRPlugin.cpp @@ -595,14 +595,6 @@ void CSMRPlugin::OnFunctionCall(int FunctionId, const char * sItemString, POINT } } -void CSMRPlugin::OnControllerDisconnect(CController Controller) { - Logger::info(string(__FUNCSIG__)); - if (Controller.GetFullName() == ControllerMyself().GetFullName() && HoppieConnected == true) { - HoppieConnected = false; - DisplayUserMessage("CPDLC", "Server", "Logged off!", true, true, false, true, false); - } -} - void CSMRPlugin::OnFlightPlanDisconnect(CFlightPlan FlightPlan) { Logger::info(string(__FUNCSIG__)); @@ -630,6 +622,11 @@ void CSMRPlugin::OnTimer(int Counter) FailedToConnectMessage = false; } + if (HoppieConnected && GetConnectionType() == CONNECTION_TYPE_NO) { + DisplayUserMessage("CPDLC", "Server", "Automatically logged off!", true, true, false, true, false); + HoppieConnected = false; + } + if (((clock() - timer) / CLOCKS_PER_SEC) > 10 && HoppieConnected) { _beginthread(pollMessages, 0, NULL); timer = clock(); diff --git a/vSMR/SMRPlugin.hpp b/vSMR/SMRPlugin.hpp index 168dd4e22..be81798c9 100644 --- a/vSMR/SMRPlugin.hpp +++ b/vSMR/SMRPlugin.hpp @@ -40,10 +40,6 @@ class CSMRPlugin : virtual void OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget RadarTarget, int ItemCode, int TagData, char sItemString[16], int * pColorCode, COLORREF * pRGB, double * pFontSize); - //---OnControllerDisconnect------------------------------------------ - - virtual void OnControllerDisconnect(CController Controller); - //---OnFlightPlanDisconnect------------------------------------------ virtual void OnFlightPlanDisconnect(CFlightPlan FlightPlan);