Resolve conflicting port options between chat, master, and world

move chat_server_port to shared since it's used by world and chat
This commit is contained in:
Aaron Kimbre 2024-01-02 19:17:51 -06:00
parent dc45436cbc
commit 9920f01cb8
9 changed files with 12 additions and 11 deletions

View File

@ -115,6 +115,9 @@ foreach(resource_file ${RESOURCE_FILES})
)
message(STATUS "Moved " ${resource_file} " to project binary directory")
elseif(resource_file MATCHES ".ini")
UpdateConfigOption("build/authconfig.ini" "port" "auth_server_port")
UpdateConfigOption("build/chatconfig.ini" "port" "chat_server_port")
UpdateConfigOption("build/masterconfig.ini" "port" "master_server_port")
message(STATUS "Checking " ${resource_file} " for missing config options")
file(READ ${PROJECT_BINARY_DIR}/${resource_file} current_file_contents)
string(REPLACE "\\\n" "" current_file_contents ${current_file_contents})

View File

@ -86,7 +86,7 @@ int main(int argc, char** argv) {
uint32_t maxClients = 50;
uint32_t ourPort = 1001; //LU client is hardcoded to use this for auth port, so I'm making it the default.
if (Game::config->GetValue("max_clients") != "") maxClients = std::stoi(Game::config->GetValue("max_clients"));
if (Game::config->GetValue("port") != "") ourPort = std::atoi(Game::config->GetValue("port").c_str());
if (Game::config->GetValue("auth_server_port") != "") ourPort = std::atoi(Game::config->GetValue("auth_server_port").c_str());
Game::server = new dServer(Game::config->GetValue("external_ip"), ourPort, 0, maxClients, false, true, Game::logger, masterIP, masterPort, ServerType::Auth, Game::config, &Game::lastSignal);

View File

@ -102,7 +102,7 @@ int main(int argc, char** argv) {
uint32_t maxClients = 50;
uint32_t ourPort = 1501;
if (Game::config->GetValue("max_clients") != "") maxClients = std::stoi(Game::config->GetValue("max_clients"));
if (Game::config->GetValue("port") != "") ourPort = std::atoi(Game::config->GetValue("port").c_str());
if (Game::config->GetValue("chat_server_port") != "") ourPort = std::atoi(Game::config->GetValue("chat_server_port").c_str());
Game::server = new dServer(Game::config->GetValue("external_ip"), ourPort, 0, maxClients, false, true, Game::logger, masterIP, masterPort, ServerType::Chat, Game::config, &Game::lastSignal);

View File

@ -285,7 +285,7 @@ int main(int argc, char** argv) {
uint32_t maxClients = 999;
uint32_t ourPort = 1000;
if (Game::config->GetValue("max_clients") != "") maxClients = std::stoi(Game::config->GetValue("max_clients"));
if (Game::config->GetValue("port") != "") ourPort = std::stoi(Game::config->GetValue("port"));
if (Game::config->GetValue("master_server_port") != "") ourPort = std::stoi(Game::config->GetValue("master_server_port"));
Game::server = new dServer(Game::config->GetValue("external_ip"), ourPort, 0, maxClients, true, false, Game::logger, "", 0, ServerType::Master, Game::config, &Game::lastSignal);

View File

@ -1,5 +1,5 @@
# Port number. The client has the authserver port hardcoded to 1001
port=1001
auth_server_port=1001
# 0 or 1, should ignore playkeys
# If 1 everyone with an account will be able to login, regardless of if they have a key or not

View File

@ -1,6 +1,3 @@
# Port number
port=2005
# If you would like to increase the maximum number of best friends a player can have on the server
# Change the value below to what you would like this to be (5 is live accurate)
max_number_of_best_friends=5

View File

@ -2,7 +2,7 @@
master_ip=localhost
# Port number
port=2000
master_server_port=2000
# The port number to start world servers on. Will be incremented for each world
world_port_start=3000

View File

@ -62,3 +62,7 @@ event_8=
version_major=1
version_current=10
version_minor=64
# The port the chat server is started and listening on
# Used in chat and world servers
chat_server_port=2005

View File

@ -2,9 +2,6 @@
# If you fork this repository and/or make changes to the code, reflect that here to comply with AGPLv3
source=https://github.com/DarkflameUniverse/DarkflameServer
# Port to the chat server, same as in chatconfig.ini
chat_server_port=2005
# 0 or 1, should disable chat
disable_chat=0