mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Strengthen checks for slash commands (#1198)
This commit is contained in:
parent
08020cd86d
commit
51540568fb
@ -4909,6 +4909,13 @@ void GameMessages::HandleParseChatMessage(RakNet::BitStream* inStream, Entity* e
|
|||||||
inStream->Read(character);
|
inStream->Read(character);
|
||||||
wsString.push_back(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'/') {
|
if (wsString[0] == L'/') {
|
||||||
SlashCommandHandler::HandleChatCommand(wsString, entity, sysAddr);
|
SlashCommandHandler::HandleChatCommand(wsString, entity, sysAddr);
|
||||||
|
Loading…
Reference in New Issue
Block a user