1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-25 05:04:07 +01:00

Change: remove company passwords over client allow lists

This commit is contained in:
Rubidium
2024-03-23 18:55:43 +01:00
committed by rubidium42
parent a002803d1c
commit 71fc907584
7 changed files with 21 additions and 76 deletions

View File

@@ -67,7 +67,6 @@ bool _network_server; ///< network-server is active
bool _network_available; ///< is network mode available?
bool _network_dedicated; ///< are we a dedicated server?
bool _is_network_server; ///< Does this client wants to be a network-server?
NetworkCompanyState *_network_company_states = nullptr; ///< Statistics about some companies.
ClientID _network_own_client_id; ///< Our client identifier.
ClientID _redirect_console_to_client; ///< If not invalid, redirect the console output to a client.
uint8_t _network_reconnect; ///< Reconnect timeout
@@ -85,7 +84,6 @@ uint32_t _sync_seed_2; ///< Second part of the seed.
#endif
uint32_t _sync_frame; ///< The frame to perform the sync check.
bool _network_first_time; ///< Whether we have finished joining or not.
CompanyMask _network_company_passworded; ///< Bitmask of the password status of all companies.
static_assert((int)NETWORK_COMPANY_NAME_LENGTH == MAX_LENGTH_COMPANY_NAME_CHARS * MAX_CHAR_LENGTH);
@@ -287,9 +285,9 @@ std::string GenerateCompanyPasswordHash(const std::string &password, const std::
* @param company_id id of the company we want to check the 'passworded' flag for.
* @return true if the company requires a password.
*/
bool NetworkCompanyIsPassworded(CompanyID company_id)
bool NetworkCompanyIsPassworded([[maybe_unused]] CompanyID company_id)
{
return HasBit(_network_company_passworded, company_id);
return false;
}
/* This puts a text-message to the console, or in the future, the chat-box,
@@ -687,10 +685,6 @@ void NetworkClose(bool close_admins)
NetworkFreeLocalCommandQueue();
delete[] _network_company_states;
_network_company_states = nullptr;
_network_company_passworded = 0;
InitializeNetworkPools(close_admins);
}
@@ -985,7 +979,6 @@ bool NetworkServerStart()
Debug(net, 5, "Starting listeners for incoming server queries");
NetworkUDPServerListen();
_network_company_states = new NetworkCompanyState[MAX_COMPANIES];
_network_server = true;
_networking = true;
_frame_counter = 0;
@@ -995,7 +988,6 @@ bool NetworkServerStart()
_network_own_client_id = CLIENT_ID_SERVER;
_network_clients_connected = 0;
_network_company_passworded = 0;
NetworkInitGameInfo();