Skip to content

Commit

Permalink
Add warning for broken runtime join (#1109)
Browse files Browse the repository at this point in the history
This also fixes the "no runtime join" error appearing for pre-lobby
games, where joining usually works anyways.
  • Loading branch information
lluchs committed Jan 28, 2018
1 parent 223ab6f commit 0f78e63
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions planet/System.ocg/LanguageDE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
1 change: 1 addition & 0 deletions planet/System.ocg/LanguageUS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
30 changes: 22 additions & 8 deletions src/gui/C4StartupNetDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit 0f78e63

Please sign in to comment.