From 26dd78fff7e0e933ea0d3db6238a2f7f58447069 Mon Sep 17 00:00:00 2001 From: yuwui Date: Sun, 5 Dec 2021 23:16:12 +0100 Subject: [PATCH 01/13] change default network version to 171022 --- CMakeVariables.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeVariables.txt b/CMakeVariables.txt index bbed7d46..01e03d87 100644 --- a/CMakeVariables.txt +++ b/CMakeVariables.txt @@ -6,7 +6,7 @@ LICENSE=AGPL-3.0 # The network version. # 171023 - Darkflame Universe client # 171022 - Unmodded client -NET_VERSION=171023 +NET_VERSION=171022 # Debugging # __dynamic=1 # Set __dynamic to 1 to enable the -rdynamic flag for the linker, yielding some symbols in crashlogs. From 0c006b4007f3bee51d3780dea513a7336cd05409 Mon Sep 17 00:00:00 2001 From: JoachimF Date: Sun, 5 Dec 2021 23:50:30 +0100 Subject: [PATCH 02/13] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d724be24..f10ad07b 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ git clone --recursive https://github.com/DarkflameUniverse/DarkflameServer Some tools utilized to streamline the setup process require Python 3, make sure you have it installed. -**Choosing the right version for your client** + +### Choosing the right version for your client DLU clients identify themselves using a higher version number than the regular live clients out there. This was done make sure that older and incomplete clients wouldn't produce false positive bug reports for us, and because we made bug fixes and new content for the client. From 1ba48ecd64bde2fe09c7cd24fb3fc1d0260e518e Mon Sep 17 00:00:00 2001 From: Arkannex <95593487+Arkannex@users.noreply.github.com> Date: Sun, 5 Dec 2021 17:43:38 -0600 Subject: [PATCH 03/13] Update NPC.xml Addition of an NPC to Gnarled Forest near Bucky Urchin. --- vanity/NPC.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vanity/NPC.xml b/vanity/NPC.xml index 53b639d3..4a61deaf 100644 --- a/vanity/NPC.xml +++ b/vanity/NPC.xml @@ -381,6 +381,20 @@ + + 8613, 13000, 7570 + + The red parrot can be very difficult to find! + Some say there are elephants in this forest. + I think I may be lost... + I'm feeling a bit emotionally conflicted right now + + + + + + + 4523, 2517, 11909 @@ -423,4 +437,4 @@ :D :P - \ No newline at end of file + From f760ef456c6055358a360970810c1fb2c2de271e Mon Sep 17 00:00:00 2001 From: Manas Shah Date: Sun, 5 Dec 2021 15:59:50 -0800 Subject: [PATCH 04/13] Small fixes for windows clang compile --- dCommon/Diagnostics.cpp | 3 ++- dScripts/NjMonastryBossInstance.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dCommon/Diagnostics.cpp b/dCommon/Diagnostics.cpp index c64d4c18..5963400d 100644 --- a/dCommon/Diagnostics.cpp +++ b/dCommon/Diagnostics.cpp @@ -2,8 +2,9 @@ // If we're on Win32, we'll include our minidump writer #ifdef _WIN32 -#include + #include +#include #include "Game.h" #include "dLogger.h" diff --git a/dScripts/NjMonastryBossInstance.cpp b/dScripts/NjMonastryBossInstance.cpp index 8c7f8e9e..faf92edd 100644 --- a/dScripts/NjMonastryBossInstance.cpp +++ b/dScripts/NjMonastryBossInstance.cpp @@ -16,7 +16,7 @@ // // // // // // // void NjMonastryBossInstance::OnStartup(Entity *self) { - auto spawnerNames = std::vector { LedgeFrakjawSpawner, LowerFrakjawSpawner, BaseEnemiesSpawner + std::to_string(1), + auto spawnerNames = std::vector { LedgeFrakjawSpawner, LowerFrakjawSpawner, BaseEnemiesSpawner + std::to_string(1), BaseEnemiesSpawner + std::to_string(2), BaseEnemiesSpawner + std::to_string(3), BaseEnemiesSpawner + std::to_string(4), CounterweightSpawner }; From bcfa1fb9062a09056c3b1ed37182b40f97d14a2e Mon Sep 17 00:00:00 2001 From: Avery Date: Sun, 5 Dec 2021 19:27:45 -0800 Subject: [PATCH 05/13] Update 1_fix_overbuild_mission.sql --- migrations/cdserver/1_fix_overbuild_mission.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/migrations/cdserver/1_fix_overbuild_mission.sql b/migrations/cdserver/1_fix_overbuild_mission.sql index 1a4cd34f..9862d166 100644 --- a/migrations/cdserver/1_fix_overbuild_mission.sql +++ b/migrations/cdserver/1_fix_overbuild_mission.sql @@ -1,2 +1 @@ --- Fixes the overbuild mission that has the wrong target, therefore not being completable UPDATE Missions SET target_objectID = 12259 WHERE id = 1177; From 0a9d4d0d66c5c12347227a1f9ad3cd5e9d1184d3 Mon Sep 17 00:00:00 2001 From: Avery Date: Sun, 5 Dec 2021 19:28:06 -0800 Subject: [PATCH 06/13] Update 0_nt_footrace.sql --- migrations/cdserver/0_nt_footrace.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/migrations/cdserver/0_nt_footrace.sql b/migrations/cdserver/0_nt_footrace.sql index 32330f1d..2019f07d 100644 --- a/migrations/cdserver/0_nt_footrace.sql +++ b/migrations/cdserver/0_nt_footrace.sql @@ -1,5 +1,3 @@ --- changes the NT foot race such that it does not share the - BEGIN TRANSACTION; UPDATE ComponentsRegistry SET component_id = 1901 WHERE id = 12916; From 2f064f0145c59f0612e7ed306d6b54e28b359eac Mon Sep 17 00:00:00 2001 From: Aaron Kimbrell Date: Sun, 5 Dec 2021 22:37:32 -0600 Subject: [PATCH 07/13] change repo url in worldconfig.ini to be correct --- resources/worldconfig.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/worldconfig.ini b/resources/worldconfig.ini index b4f485f8..e5932ec7 100644 --- a/resources/worldconfig.ini +++ b/resources/worldconfig.ini @@ -6,7 +6,7 @@ mysql_password= # URL to the code repository for the hosted server # If you fork this repository and/or make changes to the code, reflect that here to comply with AGPLv3 -source=https://github.com/DarkflameUniverse/DLUv3 +source=https://github.com/DarkflameUniverse/DarkflameServer # Port to the chat server, same as in chatconfig.ini chat_server_port=2005 From 4b8712b0f517ff942e7f15ee6486e20088bdc7da Mon Sep 17 00:00:00 2001 From: Avery Date: Mon, 6 Dec 2021 00:37:30 -0500 Subject: [PATCH 08/13] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d724be24..545a5979 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,8 @@ sudo ln -s /usr/local/mysql-connector-c++/lib64/libssl.1.1.dylib /path/to/build/ sudo ln -s /usr/local/mysql-connector-c++/lib64/libcrypto.1.1.dylib /path/to/build/folder/libcrypto.1.1.dylib ``` -### Windows builds (native) -Ensure that you have either the [MSVC](https://visualstudio.microsoft.com/vs/) or the [Clang](https://github.com/llvm/llvm-project/releases/) (recommended) compiler installed. You will also need to install [CMake](https://cmake.org/download/). +### Windows builds (native) (CURRENTLY BROKEN ONCE COMPILED) +~~Ensure that you have either the [MSVC](https://visualstudio.microsoft.com/vs/) or the [Clang](https://github.com/llvm/llvm-project/releases/) (recommended) compiler installed. You will also need to install [CMake](https://cmake.org/download/). **Build the repository** ```batch @@ -92,7 +92,7 @@ cmake .. :: Run CMake with build flag to build cmake --build . ``` - +~~ ### Windows builds (WSL) This section will go through how to install [WSL](https://docs.microsoft.com/en-us/windows/wsl/install) and building in a Linux environment under Windows. WSL requires Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11. From 7e4be6fdb6e79567ebf7e6f499eafcef0215268c Mon Sep 17 00:00:00 2001 From: Avery Date: Mon, 6 Dec 2021 00:39:13 -0500 Subject: [PATCH 09/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 545a5979..ad114f5d 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ sudo ln -s /usr/local/mysql-connector-c++/lib64/libcrypto.1.1.dylib /path/to/bui ``` ### Windows builds (native) (CURRENTLY BROKEN ONCE COMPILED) -~~Ensure that you have either the [MSVC](https://visualstudio.microsoft.com/vs/) or the [Clang](https://github.com/llvm/llvm-project/releases/) (recommended) compiler installed. You will also need to install [CMake](https://cmake.org/download/). +Ensure that you have either the [MSVC](https://visualstudio.microsoft.com/vs/) or the [Clang](https://github.com/llvm/llvm-project/releases/) (recommended) compiler installed. You will also need to install [CMake](https://cmake.org/download/). **Build the repository** ```batch @@ -92,7 +92,7 @@ cmake .. :: Run CMake with build flag to build cmake --build . ``` -~~ + ### Windows builds (WSL) This section will go through how to install [WSL](https://docs.microsoft.com/en-us/windows/wsl/install) and building in a Linux environment under Windows. WSL requires Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11. From 3845dc77f96334ea726ac1c5d38a1a47f29ad61a Mon Sep 17 00:00:00 2001 From: yuwui Date: Mon, 6 Dec 2021 07:04:18 +0100 Subject: [PATCH 10/13] strip carriage return from txt files --- dGame/UserManager.cpp | 45 ++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/dGame/UserManager.cpp b/dGame/UserManager.cpp index 54b39c9f..5418e9f3 100644 --- a/dGame/UserManager.cpp +++ b/dGame/UserManager.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "Database.h" #include "Game.h" @@ -25,38 +26,46 @@ UserManager * UserManager::m_Address = nullptr; uint32_t FindCharShirtID(uint32_t shirtColor, uint32_t shirtStyle); uint32_t FindCharPantsID(uint32_t pantsColor); +inline void StripCR(std::string& str) { + str.erase(std::remove(str.begin(), str.end(), '\r'), str.end()); +} + void UserManager::Initialize() { std::string firstNamePath = "./res/names/minifigname_first.txt"; - std::string middleNamePath = "./res/names/minifigname_middle.txt"; - std::string lastNamePath = "./res/names/minifigname_last.txt"; - std::string line; + std::string middleNamePath = "./res/names/minifigname_middle.txt"; + std::string lastNamePath = "./res/names/minifigname_last.txt"; + std::string line; - std::fstream fnFile(firstNamePath, std::ios::in); - std::fstream mnFile(middleNamePath, std::ios::in); - std::fstream lnFile(lastNamePath, std::ios::in); + std::fstream fnFile(firstNamePath, std::ios::in); + std::fstream mnFile(middleNamePath, std::ios::in); + std::fstream lnFile(lastNamePath, std::ios::in); - while (std::getline(fnFile, line, '\n')) { + while (std::getline(fnFile, line, '\n')) { std::string name = line; - m_FirstNames.push_back(name); - } + StripCR(name); + m_FirstNames.push_back(name); + } - while (std::getline(mnFile, line, '\n')) { + while (std::getline(mnFile, line, '\n')) { std::string name = line; - m_MiddleNames.push_back(name); - } + StripCR(name); + m_MiddleNames.push_back(name); + } - while (std::getline(lnFile, line, '\n')) { + while (std::getline(lnFile, line, '\n')) { std::string name = line; - m_LastNames.push_back(name); - } + StripCR(name); + m_LastNames.push_back(name); + } - fnFile.close(); - mnFile.close(); - lnFile.close(); + fnFile.close(); + mnFile.close(); + lnFile.close(); //Load our pre-approved names: std::fstream chatList("./res/chatplus_en_us.txt", std::ios::in); while (std::getline(chatList, line, '\n')) { + StripCR(line); m_PreapprovedNames.push_back(line); } From 2dd96198afc243fe44ae32ad50d50355b9b74efb Mon Sep 17 00:00:00 2001 From: yuwui Date: Mon, 6 Dec 2021 10:31:09 +0100 Subject: [PATCH 11/13] try original zone path before lowercasing --- dZoneManager/Zone.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dZoneManager/Zone.cpp b/dZoneManager/Zone.cpp index 68adb943..95bb07bc 100644 --- a/dZoneManager/Zone.cpp +++ b/dZoneManager/Zone.cpp @@ -42,7 +42,15 @@ void Zone::LoadZoneIntoMemory() { m_ZonePath = m_ZoneFilePath.substr(0, m_ZoneFilePath.rfind('/') + 1); if (m_ZoneFilePath == "ERR") return; + // try to open with regular cased path first std::ifstream file(m_ZoneFilePath, std::ios::binary); + if (!file) { + // if that fails try the path in lowercase + std::transform(m_ZoneFilePath.begin(), m_ZoneFilePath.end(), m_ZoneFilePath.begin(), ::tolower); + + file.open(m_ZoneFilePath, std::ios::binary); + } + if (file) { BinaryIO::BinaryRead(file, m_ZoneFileFormatVersion); @@ -171,8 +179,7 @@ std::string Zone::GetFilePathForZoneID() { CDZoneTableTable * zoneTable = CDClientManager::Instance()->GetTable("ZoneTable"); const CDZoneTable* zone = zoneTable->Query(this->GetZoneID().GetMapID()); if (zone != nullptr) { - std::string toReturn = "./res/maps/" + zone->zoneName; - std::transform(toReturn.begin(), toReturn.end(), toReturn.begin(), ::tolower); + std::string toReturn = "./res/maps/" + zone->zoneName; return toReturn; } From 932bf7ca60fd144003ce88e0c0637185affbf6ed Mon Sep 17 00:00:00 2001 From: yuwui Date: Mon, 6 Dec 2021 12:29:42 +0100 Subject: [PATCH 12/13] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05766373..c5d4f1c4 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Some tools utilized to streamline the setup process require Python 3, make sure DLU clients identify themselves using a higher version number than the regular live clients out there. This was done make sure that older and incomplete clients wouldn't produce false positive bug reports for us, and because we made bug fixes and new content for the client. -If you're using a DLU client, then you don't need to change anything. But if you're using any other client, you'll have to go into the "CMakeVariables.txt" file and change it to match your client's version. (likely 171022) +If you're using a DLU client you'll have to go into the "CMakeVariables.txt" file and change the NET_VERSION variable to 171023 to match the modified client's version number. ### Linux builds Make sure packages like `gcc`, `cmake`, and `zlib` are installed. Depending on the distribution, these packages might already be installed. From 713cb6c6e5cd9350a7fbc27028c73e825993a100 Mon Sep 17 00:00:00 2001 From: Arkannex <95593487+Arkannex@users.noreply.github.com> Date: Mon, 6 Dec 2021 08:04:19 -0600 Subject: [PATCH 13/13] Update NPC.xml --- vanity/NPC.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/vanity/NPC.xml b/vanity/NPC.xml index 4a61deaf..3bb5ae9f 100644 --- a/vanity/NPC.xml +++ b/vanity/NPC.xml @@ -382,19 +382,19 @@ - 8613, 13000, 7570 - - The red parrot can be very difficult to find! - Some say there are elephants in this forest. - I think I may be lost... - I'm feeling a bit emotionally conflicted right now - - - - - - - + 8613, 13000, 7570 + + The red parrot can be very difficult to find! + Some say there are elephants in this forest. + I think I may be lost... + I'm feeling a bit emotionally conflicted right now + + + + + + + 4523, 2517, 11909