Skip to content

Commit

Permalink
Patch GM9 exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Sep 23, 2023
1 parent 08020cd commit 3e33b47
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dGame/dGameMessages/GameMessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4909,6 +4909,13 @@ 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);
Expand Down

0 comments on commit 3e33b47

Please sign in to comment.