diff --git a/docs/openttd.6 b/docs/openttd.6 index 0319f98cc8..9e8ff63b34 100644 --- a/docs/openttd.6 +++ b/docs/openttd.6 @@ -20,7 +20,6 @@ .Op Fl M Ar musicset .Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company .Op Fl p Ar password -.Op Fl P Ar password .Op Fl q Ar savegame .Op Fl r Ar width Ns x Ns Ar height .Op Fl s Ar driver @@ -100,10 +99,6 @@ play as. Password used to join server. Only useful with .Fl n . -.It Fl P Ar password -Password used to join company. -Only useful with -.Fl n . .It Fl q Ar savegame Write some information about the specified savegame and exit. .It Fl Q diff --git a/src/network/network.cpp b/src/network/network.cpp index 04e201ded2..adee472d6e 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -831,7 +831,7 @@ public: /** * Join a client to the server at with the given connection string. - * The default for the passwords is \c nullptr. When the server or company needs a + * The default for the passwords is \c nullptr. When the server needs a * password and none is given, the user is asked to enter the password in the GUI. * This function will return false whenever some information required to join is not * correct such as the company number or the client's name, or when there is not @@ -843,10 +843,9 @@ public: * @param connection_string The IP address, port and company number to join as. * @param default_company The company number to join as when none is given. * @param join_server_password The password for the server. - * @param join_company_password The password for the company. * @return Whether the join has started. */ -bool NetworkClientConnectGame(const std::string &connection_string, CompanyID default_company, const std::string &join_server_password, const std::string &join_company_password) +bool NetworkClientConnectGame(const std::string &connection_string, CompanyID default_company, const std::string &join_server_password) { Debug(net, 9, "NetworkClientConnectGame(): connection_string={}", connection_string); @@ -859,7 +858,6 @@ bool NetworkClientConnectGame(const std::string &connection_string, CompanyID de _network_join.connection_string = resolved_connection_string; _network_join.company = join_as; _network_join.server_password = join_server_password; - _network_join.company_password = join_company_password; if (_game_mode == GM_MENU) { /* From the menu we can immediately continue with the actual join. */ diff --git a/src/network/network_client.h b/src/network/network_client.h index 0c2dda37eb..47fb81b3cd 100644 --- a/src/network/network_client.h +++ b/src/network/network_client.h @@ -112,7 +112,6 @@ struct NetworkJoinInfo { std::string connection_string; ///< The address of the server to join. CompanyID company; ///< The company to join. std::string server_password; ///< The password of the server to join. - std::string company_password; ///< The password of the company to join. }; extern NetworkJoinInfo _network_join; diff --git a/src/network/network_func.h b/src/network/network_func.h index e4a43be710..485ecfcdb1 100644 --- a/src/network/network_func.h +++ b/src/network/network_func.h @@ -49,7 +49,7 @@ void NetworkPopulateCompanyStats(NetworkCompanyStats *stats); void NetworkUpdateClientInfo(ClientID client_id); void NetworkClientsToSpectators(CompanyID cid); -bool NetworkClientConnectGame(const std::string &connection_string, CompanyID default_company, const std::string &join_server_password = "", const std::string &join_company_password = ""); +bool NetworkClientConnectGame(const std::string &connection_string, CompanyID default_company, const std::string &join_server_password = ""); void NetworkClientJoinGame(); void NetworkClientRequestMove(CompanyID company, const std::string &pass = ""); void NetworkClientSendRcon(const std::string &password, const std::string &command); diff --git a/src/openttd.cpp b/src/openttd.cpp index 10f7e0727b..4d1c048922 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -168,7 +168,6 @@ static void ShowHelp() " -G seed = Set random seed\n" " -n host[:port][#company]= Join network game\n" " -p password = Password to join server\n" - " -P password = Password to join company\n" " -D [host][:port] = Start dedicated server\n" #if !defined(_WIN32) " -f = Fork into the background (dedicated only)\n" @@ -384,7 +383,6 @@ struct AfterNewGRFScan : NewGRFScanCallback { uint16_t dedicated_port = 0; ///< Port for the dedicated server. std::string connection_string; ///< Information about the server to connect to std::string join_server_password; ///< The password to join the server with. - std::string join_company_password; ///< The password to join the company with. bool save_config = true; ///< The save config setting. /** @@ -448,7 +446,7 @@ struct AfterNewGRFScan : NewGRFScanCallback { LoadIntroGame(); _switch_mode = SM_NONE; - NetworkClientConnectGame(connection_string, COMPANY_NEW_COMPANY, join_server_password, join_company_password); + NetworkClientConnectGame(connection_string, COMPANY_NEW_COMPANY, join_server_password); } /* After the scan we're not used anymore. */ @@ -485,7 +483,7 @@ static std::vector CreateOptions() { std::vector options; /* Options that require a parameter. */ - for (char c : "GIMPSbcmnpqrstv") options.push_back({ .type = ODF_HAS_VALUE, .id = c, .shortname = c }); + for (char c : "GIMSbcmnpqrstv") options.push_back({ .type = ODF_HAS_VALUE, .id = c, .shortname = c }); #if !defined(_WIN32) options.push_back({ .type = ODF_HAS_VALUE, .id = 'f', .shortname = 'f' }); #endif @@ -558,9 +556,6 @@ int openttd_main(std::span arguments) case 'p': scanner->join_server_password = mgo.opt; break; - case 'P': - scanner->join_company_password = mgo.opt; - break; case 'r': ParseResolution(&resolution, mgo.opt); break; case 't': scanner->startyear = atoi(mgo.opt); break; case 'd': {