Cleanup: remove UI for asking user for company password

This commit is contained in:
Rubidium 2024-03-23 19:43:08 +01:00 committed by rubidium42
parent 457d51fc49
commit 849d1fa1b3
5 changed files with 4 additions and 17 deletions

View File

@ -2460,7 +2460,6 @@ STR_NETWORK_CONNECTING_SPECIAL_2 :{BLACK}Fetching
STR_NETWORK_CONNECTION_DISCONNECT :{BLACK}Disconnect STR_NETWORK_CONNECTION_DISCONNECT :{BLACK}Disconnect
STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Server is protected. Enter password STR_NETWORK_NEED_GAME_PASSWORD_CAPTION :{WHITE}Server is protected. Enter password
STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION :{WHITE}Company is protected. Enter password
# Network company list added strings # Network company list added strings
STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Online players STR_NETWORK_COMPANY_LIST_CLIENT_LIST :Online players

View File

@ -709,7 +709,7 @@ class ClientGamePasswordRequestHandler : public NetworkAuthenticationPasswordReq
if (!_network_join.server_password.empty()) { if (!_network_join.server_password.empty()) {
request->Reply(_network_join.server_password); request->Reply(_network_join.server_password);
} else { } else {
ShowNetworkNeedPassword(NETWORK_GAME_PASSWORD, request); ShowNetworkNeedPassword(request);
} }
} }
}; };

View File

@ -2208,19 +2208,13 @@ void ShowJoinStatusWindow()
new NetworkJoinStatusWindow(&_network_join_status_window_desc); new NetworkJoinStatusWindow(&_network_join_status_window_desc);
} }
void ShowNetworkNeedPassword(NetworkPasswordType npt, std::shared_ptr<NetworkAuthenticationPasswordRequest> request) void ShowNetworkNeedPassword(std::shared_ptr<NetworkAuthenticationPasswordRequest> request)
{ {
NetworkJoinStatusWindow *w = dynamic_cast<NetworkJoinStatusWindow *>(FindWindowById(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_JOIN)); NetworkJoinStatusWindow *w = dynamic_cast<NetworkJoinStatusWindow *>(FindWindowById(WC_NETWORK_STATUS_WINDOW, WN_NETWORK_STATUS_WINDOW_JOIN));
if (w == nullptr) return; if (w == nullptr) return;
w->request = request; w->request = request;
StringID caption; ShowQueryString(STR_EMPTY, STR_NETWORK_NEED_GAME_PASSWORD_CAPTION, NETWORK_PASSWORD_LENGTH, w, CS_ALPHANUMERAL, QSF_NONE);
switch (npt) {
default: NOT_REACHED();
case NETWORK_GAME_PASSWORD: caption = STR_NETWORK_NEED_GAME_PASSWORD_CAPTION; break;
case NETWORK_COMPANY_PASSWORD: caption = STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION; break;
}
ShowQueryString(STR_EMPTY, caption, NETWORK_PASSWORD_LENGTH, w, CS_ALPHANUMERAL, QSF_PASSWORD);
} }
/** /**

View File

@ -17,7 +17,7 @@
#include "network_type.h" #include "network_type.h"
#include "network_gamelist.h" #include "network_gamelist.h"
void ShowNetworkNeedPassword(NetworkPasswordType npt, std::shared_ptr<class NetworkAuthenticationPasswordRequest> request); void ShowNetworkNeedPassword(std::shared_ptr<class NetworkAuthenticationPasswordRequest> request);
void ShowNetworkChatQueryWindow(DestType type, int dest); void ShowNetworkChatQueryWindow(DestType type, int dest);
void ShowJoinStatusWindow(); void ShowJoinStatusWindow();
void ShowNetworkGameWindow(); void ShowNetworkGameWindow();

View File

@ -72,12 +72,6 @@ struct NetworkCompanyStats {
struct NetworkClientInfo; struct NetworkClientInfo;
/** The type of password we're asking for. */
enum NetworkPasswordType {
NETWORK_GAME_PASSWORD, ///< The password of the game.
NETWORK_COMPANY_PASSWORD, ///< The password of the company.
};
/** /**
* Destination of our chat messages. * Destination of our chat messages.
* @warning The values of the enum items are part of the admin network API. Only append at the end. * @warning The values of the enum items are part of the admin network API. Only append at the end.