From 0f78e63f0213a0d2c98791a0fed02d98f3d5b12e Mon Sep 17 00:00:00 2001 From: Lukas Werling Date: Sun, 28 Jan 2018 17:34:45 +0100 Subject: [PATCH] Add warning for broken runtime join (#1109) This also fixes the "no runtime join" error appearing for pre-lobby games, where joining usually works anyways. --- planet/System.ocg/LanguageDE.txt | 1 + planet/System.ocg/LanguageUS.txt | 1 + src/gui/C4StartupNetDlg.cpp | 30 ++++++++++++++++++++++-------- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/planet/System.ocg/LanguageDE.txt b/planet/System.ocg/LanguageDE.txt index 7d8220e7e..136725ed8 100644 --- a/planet/System.ocg/LanguageDE.txt +++ b/planet/System.ocg/LanguageDE.txt @@ -836,6 +836,7 @@ IDS_NET_NOJOIN_BADREF=Beitritt in ausgewähltes Spiel gescheitert: %s! IDS_NET_NOJOIN_BADVER=Falsche Engine-Version: Spiel nutzt %s - vorhanden ist %s. IDS_NET_NOJOIN_NOREF=Keine Spielreferenz ausgewählt. Aus der Liste wählen oder Adresse für Direktbeitritt unten angeben! IDS_NET_NOJOIN_NORUNTIME=Das Spiel läuft schon und Laufzeitbeitritt ist deaktiviert. Soll trotzdem versucht werden beizutreten? +IDS_NET_NOJOIN_RUNTIMEBROKEN=Das Spiel läuft schon. Leider funktioniert Laufzeitbeitritt in dieser Version nicht zuverlässig. Soll trotzdem versucht werden beizutreten? IDS_NET_NONET=Netzwerk nicht aktiv IDS_NET_NONETGAME=Übertragenes Szenario enthält keine Netzwerkspieldaten. IDS_NET_NOOFFICIALLEAGUE=Achtung: bei der Verwendung eines inoffiziellen Internetservers sollte auf gar keinen Fall ein Passwort, welches auch auf offiziellen Servern verwendet wird, eingegeben werden! diff --git a/planet/System.ocg/LanguageUS.txt b/planet/System.ocg/LanguageUS.txt index 8b8ce642b..4c6ef98e3 100644 --- a/planet/System.ocg/LanguageUS.txt +++ b/planet/System.ocg/LanguageUS.txt @@ -836,6 +836,7 @@ IDS_NET_NOJOIN_BADREF=Cannot join selected game: %s IDS_NET_NOJOIN_BADVER=Engine version mismatch: the game runs with %s - you have %s. IDS_NET_NOJOIN_NOREF=No reference selected. Select a game from the list or enter a direct join address below! IDS_NET_NOJOIN_NORUNTIME=The game has started already and runtime join is not allowed! Try joining anyway? +IDS_NET_NOJOIN_RUNTIMEBROKEN=The game has started already. Unfortunately, runtime join is unstable in this release and will likely not work. Try joining anyway? IDS_NET_NONET=Network not active IDS_NET_NONETGAME=Transferred scenario does not contain network game data. IDS_NET_NOOFFICIALLEAGUE=Warning: when connecting to an unofficial internet server, you should NEVER use your password which you might use on official servers! diff --git a/src/gui/C4StartupNetDlg.cpp b/src/gui/C4StartupNetDlg.cpp index 1473a0305..162800990 100644 --- a/src/gui/C4StartupNetDlg.cpp +++ b/src/gui/C4StartupNetDlg.cpp @@ -1098,16 +1098,30 @@ bool C4StartupNetDlg::DoOK() C4GUI::Ico_Error); return true; } - // no runtime join - if (!pRef->isJoinAllowed()) + if (pRef->getGameStatus().isPastLobby()) { - if (!::pGUI->ShowMessageModal( - LoadResStr("IDS_NET_NOJOIN_NORUNTIME"), - strNoJoin.getData(), - C4GUI::MessageDialog::btnYes | C4GUI::MessageDialog::btnNo, - C4GUI::Ico_Error)) + // no runtime join + if (!pRef->isJoinAllowed()) { - return true; + if (!::pGUI->ShowMessageModal( + LoadResStr("IDS_NET_NOJOIN_NORUNTIME"), + strNoJoin.getData(), + C4GUI::MessageDialog::btnYes | C4GUI::MessageDialog::btnNo, + C4GUI::Ico_Error)) + { + return true; + } + } + else + { + if (!::pGUI->ShowMessageModal( + LoadResStr("IDS_NET_NOJOIN_RUNTIMEBROKEN"), + strNoJoin.getData(), + C4GUI::MessageDialog::btnYes | C4GUI::MessageDialog::btnNo, + C4GUI::Ico_Error)) + { + return true; + } } } }