summaryrefslogtreecommitdiff
path: root/src/network/network_client.h
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-01 14:41:25 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-01 18:30:08 +0200
commit05394d5216f89c9a7e14487b571515e510828657 (patch)
tree5b776de934917aeb88b09486fc1309a22467a6bf /src/network/network_client.h
parent83985fe26f1ad87df709f122f74e5d50485095fa (diff)
downloadopenttd-05394d5216f89c9a7e14487b571515e510828657.tar.xz
Fix #6598: Prevent invalid memory accesses when abandoning a join from within a network game
One could join a network game from within an already running network game. This would call a NetworkDisconnect, but keeps the UI alive. If, during that process the join is aborted, e.g. by cancelling on a password dialog, you would still be in your network game but also get shown the server list. Solve all the underlying problems by falling back to the main UI when (re)connecting to a(nother) server.
Diffstat (limited to 'src/network/network_client.h')
-rw-r--r--src/network/network_client.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/network/network_client.h b/src/network/network_client.h
index 28d2d0021..81d5b720c 100644
--- a/src/network/network_client.h
+++ b/src/network/network_client.h
@@ -115,6 +115,7 @@ void NetworkClientSetCompanyPassword(const char *password);
/** Information required to join a server. */
struct NetworkJoinInfo {
NetworkJoinInfo() : company(COMPANY_SPECTATOR), server_password(nullptr), company_password(nullptr) {}
+ NetworkAddress address; ///< The address of the server to join.
CompanyID company; ///< The company to join.
const char *server_password; ///< The password of the server to join.
const char *company_password; ///< The password of the company to join.