Changeset - r25726:96b4fe65dab7
[Not reviewed]
master
0 4 0
rubidium42 - 3 years ago 2021-06-21 16:29:21
rubidium@openttd.org
Codechange: [Network] Remove overload on NetworkValidateClientName

Rename the zero-parameter NetworkValidateClientName to NetworkValidateOurClientName to make it clearer it is performed on our client name, and to make it a non-overloaded function to aid with the variant being added a few commits later
4 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/network/network.cpp
Show inline comments
 
@@ -795,7 +795,7 @@ bool NetworkClientConnectGame(const std:
 
	std::string resolved_connection_string = ParseGameConnectionString(connection_string, NETWORK_DEFAULT_PORT, &join_as).GetAddressAsString(false);
 

	
 
	if (!_network_available) return false;
 
	if (!NetworkValidateClientName()) return false;
 
	if (!NetworkValidateOurClientName()) return false;
 

	
 
	_network_join.connection_string = resolved_connection_string;
 
	_network_join.company = join_as;
src/network/network_client.cpp
Show inline comments
 
@@ -1338,7 +1338,7 @@ bool NetworkValidateClientName(std::stri
 
 * See \c NetworkValidateClientName(char*) for details about the functionality.
 
 * @return True iff the client name is valid.
 
 */
 
bool NetworkValidateClientName()
 
bool NetworkValidateOurClientName()
 
{
 
	return NetworkValidateClientName(_settings_client.network.client_name);
 
}
src/network/network_func.h
Show inline comments
 
@@ -36,7 +36,7 @@ extern StringList _network_ban_list;
 

	
 
byte NetworkSpectatorCount();
 
bool NetworkIsValidClientName(const std::string_view client_name);
 
bool NetworkValidateClientName();
 
bool NetworkValidateOurClientName();
 
bool NetworkValidateClientName(std::string &client_name);
 
bool NetworkValidateServerName(std::string &server_name);
 
void NetworkUpdateClientName(const std::string &client_name);
src/network/network_gui.cpp
Show inline comments
 
@@ -1263,7 +1263,7 @@ static WindowDesc _network_start_server_
 

	
 
static void ShowNetworkStartServerWindow()
 
{
 
	if (!NetworkValidateClientName()) return;
 
	if (!NetworkValidateOurClientName()) return;
 

	
 
	CloseWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME);
 
	CloseWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_LOBBY);
 
@@ -1557,7 +1557,7 @@ static WindowDesc _network_lobby_window_
 
 */
 
static void ShowNetworkLobbyWindow(NetworkGameList *ngl)
 
{
 
	if (!NetworkValidateClientName()) return;
 
	if (!NetworkValidateOurClientName()) return;
 

	
 
	CloseWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_START);
 
	CloseWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME);
0 comments (0 inline, 0 general)