From ebdede9c2364897f109820e070f6f70e3d57e897 Mon Sep 17 00:00:00 2001 From: Robosturm Date: Tue, 3 Oct 2023 11:23:06 +0200 Subject: [PATCH] #1698 --- .vscode/settings.json | 4 +- coreengine/gameconsole.cpp | 2 +- coreengine/mainapp.h | 2 +- game/gamerules.cpp | 11 +++- general.qrc | 3 +- menue/mainwindow.cpp | 2 +- network/automatchmaker.cpp | 27 ++++++++- network/automatchmaker.h | 3 +- .../matchMaking/automatchmaker.js | 55 +++++++++++++++++++ .../matchMaking/automatchmaker.json | 11 ++++ templates/serverscript/matchMaking/tournee.js | 3 - 11 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 templates/serverscript/matchMaking/automatchmaker.js create mode 100644 templates/serverscript/matchMaking/automatchmaker.json delete mode 100644 templates/serverscript/matchMaking/tournee.js diff --git a/.vscode/settings.json b/.vscode/settings.json index 9975af2b7..5673475c3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -84,6 +84,8 @@ "typeinfo": "cpp", "qnetworkinterface": "cpp", "qsslsocket": "cpp", - "qvector": "cpp" + "qvector": "cpp", + "qjsonobject": "cpp", + "qjsonvalueref": "cpp" }, } \ No newline at end of file diff --git a/coreengine/gameconsole.cpp b/coreengine/gameconsole.cpp index 3b25de5e0..abbe2b2fc 100644 --- a/coreengine/gameconsole.cpp +++ b/coreengine/gameconsole.cpp @@ -426,7 +426,7 @@ void GameConsole::logActions(bool log) void GameConsole::extractResources() { - QString targetDir = "extractedResources/"; + QString targetDir = QString("extractedResources_Version_") + Mainapp::getGameVersion().replace(".", "_") + "/"; QDir target(targetDir); if (target.exists()) { diff --git a/coreengine/mainapp.h b/coreengine/mainapp.h index 8a860f5a1..01c03d58f 100644 --- a/coreengine/mainapp.h +++ b/coreengine/mainapp.h @@ -249,7 +249,7 @@ public slots: */ static QString getGameVersion() { - return "Version: " + QString::number(VERSION_MAJOR) + "." + QString::number(VERSION_MINOR) + "." + QString::number(VERSION_REVISION)+ "-" + QString(VERSION_SUFFIX); + return QString::number(VERSION_MAJOR) + "." + QString::number(VERSION_MINOR) + "." + QString::number(VERSION_REVISION)+ "-" + QString(VERSION_SUFFIX); } /** * @brief showCrashReport diff --git a/game/gamerules.cpp b/game/gamerules.cpp index 6015e93b1..ac8bd6b0d 100644 --- a/game/gamerules.cpp +++ b/game/gamerules.cpp @@ -1622,7 +1622,16 @@ void GameRules::serializeObject(QDataStream& pStream, bool forHash) const { pStream << m_multiplayerObserver; pStream << m_maxPerkCount; - pStream << m_matchType; + if (Mainapp::getSlave()) + { + pStream << m_matchType; + } + else + { + // don't save match type on clients + QString dummy; + pStream << dummy; + } pStream << m_mapPalette; } pStream << static_cast(m_damageFormula); diff --git a/general.qrc b/general.qrc index 5091fe133..520a8dee4 100644 --- a/general.qrc +++ b/general.qrc @@ -2065,7 +2065,8 @@ ai/training/heavyai_training.js ai/training/normalai_training.js ai/training/situation_training.js - templates/serverscript/matchMaking/tournee.js + templates/serverscript/matchMaking/automatchmaker.js + templates/serverscript/matchMaking/automatchmaker.json resources/scripts/building/field_base.js resources/scripts/actions/ACTION_FOCUSMAP.js diff --git a/menue/mainwindow.cpp b/menue/mainwindow.cpp index a52f8e571..12a32e05c 100644 --- a/menue/mainwindow.cpp +++ b/menue/mainwindow.cpp @@ -93,7 +93,7 @@ Mainwindow::Mainwindow(const QString & initialView) style.color = Qt::black; spLabel pTextfield = MemoryManagement::create