Skip to content

Commit

Permalink
new config file format implemented
Browse files Browse the repository at this point in the history
added update-available message
  • Loading branch information
kusterjs committed Jun 4, 2023
1 parent 8180b34 commit 3ee50d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
16 changes: 10 additions & 6 deletions CCAMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,17 +637,21 @@ void CCAMS::DoInitialLoad(future<string> & fmessage)
string DisplayMsg = "Update string downloaded: " + message;
DisplayUserMessage(MY_PLUGIN_NAME, "Debug", DisplayMsg.c_str(), true, false, false, false, false);
#endif
if (regex_match(message, match, regex("(\\d+)[:]([^:]+)[:]([A-Z,]+)", regex::icase)))
if (regex_match(message, match, regex("(\\d+)[:](\\d+)[:]([^:]+)[:]([A-Z,]+)", regex::icase)))
{
int new_v = stoi(match[1].str(), nullptr, 0);
if (new_v > MY_PLUGIN_VERSIONCODE)
int mnm_v = stoi(match[2].str(), nullptr, 0);
if (mnm_v > MY_PLUGIN_VERSIONCODE)
throw error{ "Your " + string { MY_PLUGIN_NAME } + " plugin (version " + MY_PLUGIN_VERSION + ") is outdated and the automatic code assignment therefore not available. Please change to the latest version.\n\nVisit https://github.com/kusterjs/CCAMS/releases" };
else
pluginVersionCheck = true;
#ifndef _DEBUG
ModeSAirports = regex(match[2].str(), regex::icase);

if (stoi(match[1].str()) > mnm_v)
{
DisplayUserMessage(MY_PLUGIN_NAME, "Update", "An update for the CCAMS plugin is available. Please visit https://github.com/kusterjs/CCAMS/releases and download the latest version.", true, true, false, true, false);
}

EquipmentCodesFAA = match[3].str();
#endif // _DEBUG
ModeSAirports = regex(match[4].str(), regex::icase);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions CCAMS.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ using namespace EuroScopePlugIn;

#define MY_PLUGIN_NAME "CCAMS"
#ifdef _DEBUG
#define MY_PLUGIN_VERSION "2.3.0 DEV"
#define MY_PLUGIN_VERSION "2.3.1 DEV"
#else
#define MY_PLUGIN_VERSION "2.3.0"
#define MY_PLUGIN_VERSION "2.3.1"
#endif
#define MY_PLUGIN_VERSIONCODE 13
#define MY_PLUGIN_UPDATE_URL "https://raw.githubusercontent.com/kusterjs/CCAMS/master/config.txt"
#define MY_PLUGIN_VERSIONCODE 12
#define MY_PLUGIN_UPDATE_URL "https://raw.githubusercontent.com/kusterjs/CCAMS/master/config2.txt"
//#define MY_PLUGIN_UPDATE_URL "https://raw.githubusercontent.com/kusterjs/CCAMS/1.8/config.txt"
#define MY_PLUGIN_DEVELOPER "Jonas Kuster, Pierre Ferran, Oliver Grützmann"
#define MY_PLUGIN_COPYRIGHT "GPL v3"
Expand Down

0 comments on commit 3ee50d1

Please sign in to comment.