mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-01 15:26:59 +00:00
fix chat message impersonation issue
instead of using the supplied name, we ignore it entirely and use the server's internal name for the client
This commit is contained in:
parent
d36bb7962c
commit
5581fd1692
@ -199,7 +199,8 @@ void TServer::GlobalParser(const std::weak_ptr<TClient>& Client, std::vector<uin
|
||||
})) {
|
||||
break;
|
||||
}
|
||||
Network.SendToAll(nullptr, Packet, true, true);
|
||||
std::string SanitizedPacket = fmt::format("C:{}: {}", LockedClient->GetName(), Message);
|
||||
Network.SendToAll(nullptr, StringToVector(SanitizedPacket), true, true);
|
||||
return;
|
||||
}
|
||||
case 'E':
|
||||
@ -212,7 +213,6 @@ void TServer::GlobalParser(const std::weak_ptr<TClient>& Client, std::vector<uin
|
||||
case 'Z': // position packet
|
||||
PPSMonitor.IncrementInternalPPS();
|
||||
Network.SendToAll(LockedClient.get(), Packet, false, false);
|
||||
|
||||
HandlePosition(*LockedClient, StringPacket);
|
||||
default:
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user