diff --git a/Server/mods/deathmatch/logic/CMainConfig.cpp b/Server/mods/deathmatch/logic/CMainConfig.cpp index bece65e885..f19a642f57 100644 --- a/Server/mods/deathmatch/logic/CMainConfig.cpp +++ b/Server/mods/deathmatch/logic/CMainConfig.cpp @@ -22,8 +22,6 @@ #include "CHTTPD.h" #include "CStaticFunctionDefinitions.h" -#define MTA_SERVER_CONF_TEMPLATE "mtaserver.conf.template" - extern CGame* g_pGame; CBandwidthSettings* g_pBandwidthSettings = new CBandwidthSettings(); @@ -116,11 +114,6 @@ bool CMainConfig::Load() return false; } - if (AddMissingSettings()) - { - Save(); - } - // Name int iResult = GetString(m_pRootNode, "servername", m_strServerName, 1, 96); if (iResult == DOESNT_EXIST) @@ -843,56 +836,6 @@ bool CMainConfig::Save() return false; } -// -// Compare against default config and add missing nodes. -// Returns true if nodes were added. -// -bool CMainConfig::AddMissingSettings() -{ - // Only mtaserver.conf is currently supported - if (!g_pGame->IsUsingMtaServerConf()) - return false; - - SString strTemplateFilename = PathJoin(g_pServerInterface->GetServerModPath(), "mtaserver.conf.template"); - - if (!FileExists(strTemplateFilename)) - return false; - - CXMLFile* pFileTemplate = g_pServerInterface->GetXML()->CreateXML(strTemplateFilename); - CXMLNode* pRootNodeTemplate = pFileTemplate && pFileTemplate->Parse() ? pFileTemplate->GetRootNode() : nullptr; - if (!pRootNodeTemplate) - { - CLogger::ErrorPrintf("Can't parse '%s'\n", *strTemplateFilename); - return false; - } - - // Check that each item in the template also exists in the server config - bool bChanged = false; - CXMLNode* pPrevNode = nullptr; - for (auto it = pRootNodeTemplate->ChildrenBegin(); it != pRootNodeTemplate->ChildrenEnd(); ++it) - { - CXMLNode* pNodeTemplate = *it; - SString strNodeName = pNodeTemplate->GetTagName(); - CXMLNode* pNode = m_pRootNode->FindSubNode(strNodeName); - if (!pNode) - { - CLogger::LogPrintf("Adding missing '%s' to mtaserver.conf\n", *strNodeName); - SString strNodeValue = pNodeTemplate->GetTagContent(); - SString strNodeComment = pNodeTemplate->GetCommentText(); - pNode = m_pRootNode->CreateSubNode(strNodeName, pPrevNode); - pNode->SetTagContent(strNodeValue); - pNode->SetCommentText(strNodeComment, true); - bChanged = true; - } - pPrevNode = pNode; - } - - // Clean up - g_pServerInterface->GetXML()->DeleteXML(pFileTemplate); - FileDelete(strTemplateFilename); - return bChanged; -} - bool CMainConfig::IsValidPassword(const char* szPassword) { if (!szPassword) diff --git a/Server/mods/deathmatch/logic/CMainConfig.h b/Server/mods/deathmatch/logic/CMainConfig.h index 9758ae2dbf..6d4da5e987 100644 --- a/Server/mods/deathmatch/logic/CMainConfig.h +++ b/Server/mods/deathmatch/logic/CMainConfig.h @@ -152,7 +152,6 @@ class CMainConfig : public CXMLConfig private: void RegisterCommand(const char* szName, FCommandHandler* pFunction, bool bRestricted, const char* szConsoleHelpText); bool GetSettingTable(const SString& strName, const char** szAttribNames, uint uiNumAttribNames, CLuaArguments* outTable); - bool AddMissingSettings(); CConsole* m_pConsole; CXMLNode* m_pRootNode; diff --git a/Server/mods/deathmatch/mtaserver.conf.template b/Server/mods/deathmatch/mtaserver.conf.template deleted file mode 100644 index 88288cc9d6..0000000000 --- a/Server/mods/deathmatch/mtaserver.conf.template +++ /dev/null @@ -1,288 +0,0 @@ - - - - Default MTA Server - - - - - - auto - - - 22003 - - - 32 - - - 22005 - - - - - - 5 - - - 20 - - - - - - none - - - - - - - - - - - - - - - - 1 - - - - - - 1 - - - 0 - - - - - - medium - - - - 100 - - 1500 - - 500 - - 400 - - 2000 - - 400 - - 100 - - 100 - - - 1 - - - 30 - - - 0 - - - 150 - - - 0 - - - server-id.keys - - - logs/server.log - - - logs/server_auth.log - - - logs/db.log - - - - - - acl.xml - - - logs/scripts.log - - - 0 - - - 0 - - - 1 - - - 60 - - - 0 - - - 1 - - - 4 - - - - - - backups - - - 3 - - - 10 - - - 1 - - - 1 - - - Admin - - - 1 - - - 127.0.0.1 - - - 1 - - - 0 - - - 1000 - 100 - - - 1 - diff --git a/utils/buildactions/install_data.lua b/utils/buildactions/install_data.lua index 930ecf3519..e2c40ec9a1 100644 --- a/utils/buildactions/install_data.lua +++ b/utils/buildactions/install_data.lua @@ -49,13 +49,6 @@ newaction { return end - local success, message = os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "mtaserver.conf.template", false, true) - if not success then - errormsg("ERROR: Couldn't copy server config files", "\n"..message) - os.exit(1) - return - end - local success, message = os.copydir("Server/mods/deathmatch", BIN_DIR.."/server/mods/deathmatch", "*.xml", false, true) if not success then errormsg("ERROR: Couldn't copy server xml files", "\n"..message) @@ -76,7 +69,7 @@ newaction { success = success and http.download_print_errors(NET_PATH_X64_WIN, BIN_DIR.."/server/x64/net.dll") success = success and http.download_print_errors(NET_PATH_ARM64_WIN, BIN_DIR.."/server/arm64/net.dll") success = success and http.download_print_errors(NETC_PATH_WIN, BIN_DIR.."/MTA/netc.dll") - + -- A download failed if not success then os.exit(1)