Merge remote-tracking branch 'refs/remotes/origin/main'

Conflicts:
	dGame/dGameMessages/GameMessages.cpp
This commit is contained in:
wincent
2023-10-22 17:38:08 +02:00
160 changed files with 1071 additions and 1016 deletions

View File

@@ -11,7 +11,7 @@
#include "Entity.h"
#include "ControllablePhysicsComponent.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "WorldPackets.h"
#include "NiPoint3.h"
#include "NiQuaternion.h"
@@ -39,7 +39,7 @@
void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* packet) {
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) {
Game::logger->Log("ClientPackets", "Unable to get user to parse chat message");
LOG("Unable to get user to parse chat message");
return;
}
@@ -68,7 +68,7 @@ void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* pack
std::string playerName = user->GetLastUsedChar()->GetName();
bool isMythran = user->GetLastUsedChar()->GetGMLevel() > eGameMasterLevel::CIVILIAN;
bool isOk = Game::chatFilter->IsSentenceOkay(GeneralUtils::UTF16ToWTF8(message), user->GetLastUsedChar()->GetGMLevel()).empty();
Game::logger->LogDebug("ClientPackets", "Msg: %s was approved previously? %i", GeneralUtils::UTF16ToWTF8(message).c_str(), user->GetLastChatMessageApproved());
LOG_DEBUG("Msg: %s was approved previously? %i", GeneralUtils::UTF16ToWTF8(message).c_str(), user->GetLastChatMessageApproved());
if (!isOk) {
// Add a limit to the string converted by general utils because it is a user received string and may be a bad actor.
CheatDetection::ReportCheat(
@@ -81,7 +81,7 @@ void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* pack
if (!isOk && !isMythran) return;
std::string sMessage = GeneralUtils::UTF16ToWTF8(message);
Game::logger->Log("Chat", "%s: %s", playerName.c_str(), sMessage.c_str());
LOG("%s: %s", playerName.c_str(), sMessage.c_str());
ChatPackets::SendChatMessage(sysAddr, chatChannel, playerName, user->GetLoggedInChar(), isMythran, message);
auto* recorder = Recording::Recorder::GetRecorder(user->GetLoggedInChar());
@@ -94,7 +94,7 @@ void ClientPackets::HandleChatMessage(const SystemAddress& sysAddr, Packet* pack
void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Packet* packet) {
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) {
Game::logger->Log("ClientPackets", "Unable to get user to parse position update");
LOG("Unable to get user to parse position update");
return;
}
@@ -307,14 +307,14 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
void ClientPackets::HandleChatModerationRequest(const SystemAddress& sysAddr, Packet* packet) {
User* user = UserManager::Instance()->GetUser(sysAddr);
if (!user) {
Game::logger->Log("ClientPackets", "Unable to get user to parse chat moderation request");
LOG("Unable to get user to parse chat moderation request");
return;
}
auto* entity = Player::GetPlayer(sysAddr);
if (entity == nullptr) {
Game::logger->Log("ClientPackets", "Unable to get player to parse chat moderation request");
LOG("Unable to get player to parse chat moderation request");
return;
}