diff --git a/README.md b/README.md index b082f59a..2d17b127 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,15 @@ certutil -hashfile SHA256 * Copy over or create symlinks from `macros`, `BrickModels`, `chatplus_en_us.txt`, `names`, and `maps` in your client `res` directory to the server `build/res` directory * Unzip the navmeshes [here](./resources/navmeshes.zip) and place them in `build/res/maps/navmeshes` +**Fix chatplus_en_us.txt** +* If the file has been made in windows it has to be converted to support unix. Inside of WSL run this command +* Move yourself into build/res using cd if you are not yet in there. +```bash +cd build/res +sudo apt install dos2unix +dos2unix -o chatplus_en_us.txt chatplus_en_us.txt +``` + **Setup locale** * In the `build` directory create a `locale` directory if it does not already exist * Copy over or create symlinks from `locale.xml` in your client `locale` directory to the `build/locale` directory diff --git a/dChatFilter/dChatFilter.cpp b/dChatFilter/dChatFilter.cpp index f03e5583..f211243e 100644 --- a/dChatFilter/dChatFilter.cpp +++ b/dChatFilter/dChatFilter.cpp @@ -83,7 +83,7 @@ void dChatFilter::ReadWordlistDCF(const std::string& filepath) { } void dChatFilter::ExportWordlistToDCF(const std::string& filepath) { - std::ofstream file(filepath, std::ios::binary); + std::ofstream file(filepath, std::ios::binary | std::ios_base::out ); if (file) { BinaryIO::BinaryWrite(file, uint32_t(dChatFilterDCF::header)); BinaryIO::BinaryWrite(file, uint32_t(dChatFilterDCF::formatVersion)); @@ -110,22 +110,16 @@ bool dChatFilter::IsSentenceOkay(const std::string& message, int gmLevel) { segment = std::regex_replace(segment, reg, ""); size_t hash = CalculateHash(segment); - Game::logger->Log("SEGMENT", "Word: %s Hash: %zu", segment.c_str(), hash); if (std::find(m_UserUnapprovedWordCache.begin(), m_UserUnapprovedWordCache.end(), hash) != m_UserUnapprovedWordCache.end()) { - Game::logger->Log("SENTENCEOKAY", "SENTENCE IS UNNAPROVED"); return false; } - bool a = IsInWordlist(hash); - Game::logger->Log("ISWORDLIST", "ISINWORDLIST: %s", a?"YES":"NO"); - if (!a) { - Game::logger->Log("SENTENCEOKAY", "SENTENCE IS NOT IN WORDLIST"); + if (!IsInWordlist(hash)) { m_UserUnapprovedWordCache.push_back(hash); return false; } } - Game::logger->Log("SENTENCEOKAY", "SENTENCE IS OKAY TO SEND"); return true; } diff --git a/dNet/ClientPackets.cpp b/dNet/ClientPackets.cpp index 2da9629e..566120f6 100644 --- a/dNet/ClientPackets.cpp +++ b/dNet/ClientPackets.cpp @@ -295,7 +295,6 @@ void ClientPackets::HandleChatModerationRequest(const SystemAddress& sysAddr, Pa std::unordered_map unacceptedItems; bool bAllClean = Game::chatFilter->IsSentenceOkay(message, user->GetLastUsedChar()->GetGMLevel()); - Game::logger->Log("BALLCLEAN", "%s", bAllClean?"Is Clean":"IS NOT CLEAN!!!"); if (!bAllClean) { unacceptedItems.insert(std::make_pair((char)0, (char)message.length())); }