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
This commit is contained in:
Robert Lewicki 2017-12-21 21:23:01 +01:00 committed by Michał Janiszewski
parent 4678829e03
commit 3c2aaefc85
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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;
}