mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Cleanup: remove command line option for company password
This commit is contained in:
parent
ca4bef1504
commit
16639939e9
@ -20,7 +20,6 @@
|
|||||||
.Op Fl M Ar musicset
|
.Op Fl M Ar musicset
|
||||||
.Op Fl n Ar host Ns Oo : Ns Ar port Oc Ns Op # Ns Ar company
|
.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 P Ar password
|
|
||||||
.Op Fl q Ar savegame
|
.Op Fl q Ar savegame
|
||||||
.Op Fl r Ar width Ns x Ns Ar height
|
.Op Fl r Ar width Ns x Ns Ar height
|
||||||
.Op Fl s Ar driver
|
.Op Fl s Ar driver
|
||||||
@ -100,10 +99,6 @@ play as.
|
|||||||
Password used to join server.
|
Password used to join server.
|
||||||
Only useful with
|
Only useful with
|
||||||
.Fl n .
|
.Fl n .
|
||||||
.It Fl P Ar password
|
|
||||||
Password used to join company.
|
|
||||||
Only useful with
|
|
||||||
.Fl n .
|
|
||||||
.It Fl q Ar savegame
|
.It Fl q Ar savegame
|
||||||
Write some information about the specified savegame and exit.
|
Write some information about the specified savegame and exit.
|
||||||
.It Fl Q
|
.It Fl Q
|
||||||
|
@ -831,7 +831,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Join a client to the server at with the given connection string.
|
* 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.
|
* 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
|
* 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
|
* 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 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 default_company The company number to join as when none is given.
|
||||||
* @param join_server_password The password for the server.
|
* @param join_server_password The password for the server.
|
||||||
* @param join_company_password The password for the company.
|
|
||||||
* @return Whether the join has started.
|
* @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);
|
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.connection_string = resolved_connection_string;
|
||||||
_network_join.company = join_as;
|
_network_join.company = join_as;
|
||||||
_network_join.server_password = join_server_password;
|
_network_join.server_password = join_server_password;
|
||||||
_network_join.company_password = join_company_password;
|
|
||||||
|
|
||||||
if (_game_mode == GM_MENU) {
|
if (_game_mode == GM_MENU) {
|
||||||
/* From the menu we can immediately continue with the actual join. */
|
/* From the menu we can immediately continue with the actual join. */
|
||||||
|
@ -112,7 +112,6 @@ struct NetworkJoinInfo {
|
|||||||
std::string connection_string; ///< The address of the server to join.
|
std::string connection_string; ///< The address of the server to join.
|
||||||
CompanyID company; ///< The company to join.
|
CompanyID company; ///< The company to join.
|
||||||
std::string server_password; ///< The password of the server 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;
|
extern NetworkJoinInfo _network_join;
|
||||||
|
@ -49,7 +49,7 @@ void NetworkPopulateCompanyStats(NetworkCompanyStats *stats);
|
|||||||
|
|
||||||
void NetworkUpdateClientInfo(ClientID client_id);
|
void NetworkUpdateClientInfo(ClientID client_id);
|
||||||
void NetworkClientsToSpectators(CompanyID cid);
|
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 NetworkClientJoinGame();
|
||||||
void NetworkClientRequestMove(CompanyID company, const std::string &pass = "");
|
void NetworkClientRequestMove(CompanyID company, const std::string &pass = "");
|
||||||
void NetworkClientSendRcon(const std::string &password, const std::string &command);
|
void NetworkClientSendRcon(const std::string &password, const std::string &command);
|
||||||
|
@ -168,7 +168,6 @@ static void ShowHelp()
|
|||||||
" -G seed = Set random seed\n"
|
" -G seed = Set random seed\n"
|
||||||
" -n host[:port][#company]= Join network game\n"
|
" -n host[:port][#company]= Join network game\n"
|
||||||
" -p password = Password to join server\n"
|
" -p password = Password to join server\n"
|
||||||
" -P password = Password to join company\n"
|
|
||||||
" -D [host][:port] = Start dedicated server\n"
|
" -D [host][:port] = Start dedicated server\n"
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
" -f = Fork into the background (dedicated only)\n"
|
" -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.
|
uint16_t dedicated_port = 0; ///< Port for the dedicated server.
|
||||||
std::string connection_string; ///< Information about the server to connect to
|
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_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.
|
bool save_config = true; ///< The save config setting.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -448,7 +446,7 @@ struct AfterNewGRFScan : NewGRFScanCallback {
|
|||||||
LoadIntroGame();
|
LoadIntroGame();
|
||||||
_switch_mode = SM_NONE;
|
_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. */
|
/* After the scan we're not used anymore. */
|
||||||
@ -485,7 +483,7 @@ static std::vector<OptionData> CreateOptions()
|
|||||||
{
|
{
|
||||||
std::vector<OptionData> options;
|
std::vector<OptionData> options;
|
||||||
/* Options that require a parameter. */
|
/* 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)
|
#if !defined(_WIN32)
|
||||||
options.push_back({ .type = ODF_HAS_VALUE, .id = 'f', .shortname = 'f' });
|
options.push_back({ .type = ODF_HAS_VALUE, .id = 'f', .shortname = 'f' });
|
||||||
#endif
|
#endif
|
||||||
@ -558,9 +556,6 @@ int openttd_main(std::span<char * const> arguments)
|
|||||||
case 'p':
|
case 'p':
|
||||||
scanner->join_server_password = mgo.opt;
|
scanner->join_server_password = mgo.opt;
|
||||||
break;
|
break;
|
||||||
case 'P':
|
|
||||||
scanner->join_company_password = mgo.opt;
|
|
||||||
break;
|
|
||||||
case 'r': ParseResolution(&resolution, mgo.opt); break;
|
case 'r': ParseResolution(&resolution, mgo.opt); break;
|
||||||
case 't': scanner->startyear = atoi(mgo.opt); break;
|
case 't': scanner->startyear = atoi(mgo.opt); break;
|
||||||
case 'd': {
|
case 'd': {
|
||||||
|
Loading…
Reference in New Issue
Block a user