diff --git a/CMakeLists.txt b/CMakeLists.txt index 06fb3992..2379b998 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/dAuthServer/AuthServer.cpp b/dAuthServer/AuthServer.cpp index 857a27b3..974ee27e 100644 --- a/dAuthServer/AuthServer.cpp +++ b/dAuthServer/AuthServer.cpp @@ -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); diff --git a/dChatServer/ChatServer.cpp b/dChatServer/ChatServer.cpp index 3edb9d9e..1642ff9c 100644 --- a/dChatServer/ChatServer.cpp +++ b/dChatServer/ChatServer.cpp @@ -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); diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index a66bcfc2..3b829c48 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -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); diff --git a/resources/authconfig.ini b/resources/authconfig.ini index 62a5c6de..7938b5cc 100644 --- a/resources/authconfig.ini +++ b/resources/authconfig.ini @@ -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 diff --git a/resources/chatconfig.ini b/resources/chatconfig.ini index 1bb1d1b2..402534ed 100644 --- a/resources/chatconfig.ini +++ b/resources/chatconfig.ini @@ -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 diff --git a/resources/masterconfig.ini b/resources/masterconfig.ini index 4864d8cb..ab04af99 100644 --- a/resources/masterconfig.ini +++ b/resources/masterconfig.ini @@ -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 diff --git a/resources/sharedconfig.ini b/resources/sharedconfig.ini index 2e2b6120..e487058d 100644 --- a/resources/sharedconfig.ini +++ b/resources/sharedconfig.ini @@ -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 \ No newline at end of file diff --git a/resources/worldconfig.ini b/resources/worldconfig.ini index 7f296afe..c68b42d2 100644 --- a/resources/worldconfig.ini +++ b/resources/worldconfig.ini @@ -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