Skip to content

Commit

Permalink
Merge pull request #104 from goulven04/cpdlc_autologoff
Browse files Browse the repository at this point in the history
CPDLC Auto-Logoff
  • Loading branch information
pierr3 authored Dec 11, 2022
2 parents 8c4ebe1 + d53ab9c commit e696e09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 5 additions & 8 deletions vSMR/SMRPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__));
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 0 additions & 4 deletions vSMR/SMRPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e696e09

Please sign in to comment.