diff --git a/README.md b/README.md index 2d17b127..b082f59a 100644 --- a/README.md +++ b/README.md @@ -162,15 +162,6 @@ 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 f211243e..862045eb 100644 --- a/dChatFilter/dChatFilter.cpp +++ b/dChatFilter/dChatFilter.cpp @@ -105,9 +105,22 @@ bool dChatFilter::IsSentenceOkay(const std::string& message, int gmLevel) { std::string segment; std::regex reg("(!*|\\?*|\\;*|\\.*|\\,*)"); + + + + #ifdef _win32 + while (std::getline(file, line)) { + line.erase(std::remove(line.begin(), line.end(), '\r'), line.end()); //Remove nix line-endings + std::transform(line.begin(), line.end(), line.begin(), ::tolower); //Transform to lowercase + m_Words.push_back(CalculateHash(line)); + } + #else while (std::getline(sMessage, segment, ' ')) { + #endif + + std::transform(segment.begin(), segment.end(), segment.begin(), ::tolower); //Transform to lowercase - segment = std::regex_replace(segment, reg, ""); + segment = std::regex_replace(segment, reg, ""); size_t hash = CalculateHash(segment); diff --git a/dNet/ClientPackets.cpp b/dNet/ClientPackets.cpp index 566120f6..ef5b68ef 100644 --- a/dNet/ClientPackets.cpp +++ b/dNet/ClientPackets.cpp @@ -64,8 +64,6 @@ void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* pack std::string playerName = user->GetLastUsedChar()->GetName(); bool isMythran = user->GetLastUsedChar()->GetGMLevel() > 0; - Game::logger->Log("IsUserMythran", "%s", isMythran?"Yes, they are mythran\n":"No, they are not mythran\n"); - Game::logger->Log("IsMessageApproved", "%s", user->GetLastChatMessageApproved()?"Yes, Their message is approved\n":"No, their message is not approved\n"); if (!user->GetLastChatMessageApproved() && !isMythran) return;