From 3c2aaefc8504efe5bd135b5addadb2adbc417d6e Mon Sep 17 00:00:00 2001 From: Robert Lewicki Date: Thu, 21 Dec 2017 21:23:01 +0100 Subject: [PATCH] Fix #6851: Passing password as argument does not work * Using password from command line arguments to connect to server * Replaced tabs with spaces * Added myself to contributors --- contributors.md | 1 + src/openrct2/network/Network.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/contributors.md b/contributors.md index de17452c45..8ec9672961 100644 --- a/contributors.md +++ b/contributors.md @@ -95,6 +95,7 @@ The following people are not part of the project team, but have been contributin * Robbin Voortman (rvoortman) * (telk5093) * Ethan Smith (ethanhs) - Refactoring. +* Robert Lewicki (rlewicki) ## Toolchain * (Balletie) - macOS diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index cad83c919b..26bf788d89 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -1672,7 +1672,12 @@ void Network::Client_Handle_TOKEN(NetworkConnection& connection, NetworkPacket& // Don't keep private key in memory. There's no need and it may get leaked // when process dump gets collected at some point in future. _key.Unload(); - Client_Send_AUTH(gConfigNetwork.player_name, "", pubkey.c_str(), signature, sigsize); + + const char* password = String::IsNullOrEmpty(gCustomPassword) ? + "" : + gCustomPassword; + Client_Send_AUTH(gConfigNetwork.player_name, password, pubkey.c_str(), signature, sigsize); + delete [] signature; }