feat: Security improvements for spoofed packets (#1201)

* Add cheat detection for spoofed packets

* Add config option for ip loggin

* remove packet saving
This commit is contained in:
David Markowitz
2023-09-28 10:16:11 -07:00
committed by GitHub
parent bd65fc6e33
commit b24775f472
9 changed files with 237 additions and 25 deletions

View File

@@ -4909,13 +4909,6 @@ void GameMessages::HandleParseChatMessage(RakNet::BitStream* inStream, Entity* e
inStream->Read(character);
wsString.push_back(character);
}
auto player = Player::GetPlayer(sysAddr);
if (!player || !player->GetCharacter()) return;
if (player->GetObjectID() != entity->GetObjectID()) {
Game::logger->Log("GameMessages", "Player %s is trying to send a chat message from an entity %llu they do not own!", player->GetCharacter()->GetName().c_str(), entity->GetObjectID());
return;
}
if (wsString[0] == L'/') {
SlashCommandHandler::HandleChatCommand(wsString, entity, sysAddr);