Rename NETWORK_DEFAULT_PORT to kNetworkDefaultPort

This commit is contained in:
Harry-Hopkinson 2024-04-26 16:14:19 +00:00 committed by Harry Hopkinson
parent ef7d7575de
commit 5ef115941d
5 changed files with 5 additions and 5 deletions

View File

@ -557,7 +557,7 @@ static Widget _serverListWidgets[] = {
void JoinServer(std::string address) void JoinServer(std::string address)
{ {
int32_t port = NETWORK_DEFAULT_PORT; int32_t port = kNetworkDefaultPort;
auto endBracketIndex = address.find(']'); auto endBracketIndex = address.find(']');
auto colonIndex = address.find_last_of(':'); auto colonIndex = address.find_last_of(':');
if (colonIndex != std::string::npos) if (colonIndex != std::string::npos)

View File

@ -40,7 +40,7 @@
#ifndef DISABLE_NETWORK #ifndef DISABLE_NETWORK
int32_t gNetworkStart = NETWORK_MODE_NONE; int32_t gNetworkStart = NETWORK_MODE_NONE;
std::string gNetworkStartHost; std::string gNetworkStartHost;
int32_t gNetworkStartPort = NETWORK_DEFAULT_PORT; int32_t gNetworkStartPort = kNetworkDefaultPort;
std::string gNetworkStartAddress; std::string gNetworkStartAddress;
static uint32_t _port = 0; static uint32_t _port = 0;

View File

@ -60,7 +60,7 @@ static exitcode_t HandleUriJoin(const std::vector<std::string>& args)
{ {
std::string hostname; std::string hostname;
int32_t port; int32_t port;
if (args.size() > 1 && TryParseHostnamePort(args[1], &hostname, &port, NETWORK_DEFAULT_PORT)) if (args.size() > 1 && TryParseHostnamePort(args[1], &hostname, &port, kNetworkDefaultPort))
{ {
// Set the network start configuration // Set the network start configuration
gNetworkStart = NETWORK_MODE_CLIENT; gNetworkStart = NETWORK_MODE_CLIENT;

View File

@ -422,7 +422,7 @@ namespace Config
auto model = &gConfigNetwork; auto model = &gConfigNetwork;
model->PlayerName = std::move(playerName); model->PlayerName = std::move(playerName);
model->DefaultPort = reader->GetInt32("default_port", NETWORK_DEFAULT_PORT); model->DefaultPort = reader->GetInt32("default_port", kNetworkDefaultPort);
model->ListenAddress = reader->GetString("listen_address", ""); model->ListenAddress = reader->GetString("listen_address", "");
model->DefaultPassword = reader->GetString("default_password", ""); model->DefaultPassword = reader->GetString("default_password", "");
model->StayConnected = reader->GetBoolean("stay_connected", true); model->StayConnected = reader->GetBoolean("stay_connected", true);

View File

@ -9,7 +9,7 @@
#pragma once #pragma once
#define NETWORK_DEFAULT_PORT 11753 constexpr int16_t kNetworkDefaultPort = 11753;
#define NETWORK_LAN_BROADCAST_PORT 11754 #define NETWORK_LAN_BROADCAST_PORT 11754
#define NETWORK_LAN_BROADCAST_MSG "openrct2.server.query" #define NETWORK_LAN_BROADCAST_MSG "openrct2.server.query"
#define MAX_SERVER_DESCRIPTION_LENGTH 256 #define MAX_SERVER_DESCRIPTION_LENGTH 256