diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-01 19:49:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-01 19:49:10 +0300 |
commit | f3a176b24ba76c23df7625e81639342385628066 (patch) | |
tree | 3105fe868332b44bdf42ad7d6e3794881112fe98 /src/gui/updaterwindow.cpp | |
parent | f802f802a4cdedb753848a1ac5a550c8e27d3d4a (diff) | |
download | plus-f3a176b24ba76c23df7625e81639342385628066.tar.gz plus-f3a176b24ba76c23df7625e81639342385628066.tar.bz2 plus-f3a176b24ba76c23df7625e81639342385628066.tar.xz plus-f3a176b24ba76c23df7625e81639342385628066.zip |
Replace client version in update news to latest manaplus version.
Only for old servers.
Diffstat (limited to 'src/gui/updaterwindow.cpp')
-rw-r--r-- | src/gui/updaterwindow.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index fe26d42eb..9bac5e311 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -298,9 +298,26 @@ void UpdaterWindow::loadNews() // Tokenize and add each line separately char *line = strtok(mMemoryBuffer, "\n"); + bool firstLine(true); while (line) { - mBrowserBox->addRow(line); + if (firstLine) + { + firstLine = false; + std::string str = line; + unsigned i = str.find("##9 Latest client version: ##6"); + if (!i) + { + line = strtok(nullptr, "\n"); + continue; + } + + mBrowserBox->addRow(str); + } + else + { + mBrowserBox->addRow(line); + } line = strtok(nullptr, "\n"); } @@ -332,6 +349,15 @@ void UpdaterWindow::loadPatch() if (line) { version = line; + if (serverVersion < 1) + { + line = strtok(nullptr, "\n"); + if (line) + { + mBrowserBox->addRow("##9 Latest client version: ##6ManaPlus " + + std::string(line), true); + } + } if (version > CHECK_VERSION) { mBrowserBox->addRow("", true); |