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:
Lion Kortlepel 2022-10-31 02:33:51 +01:00
parent d36bb7962c
commit 5581fd1692
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -199,7 +199,8 @@ void TServer::GlobalParser(const std::weak_ptr<TClient>& Client, std::vector<uin
})) { })) {
break; break;
} }
Network.SendToAll(nullptr, Packet, true, true); std::string SanitizedPacket = fmt::format("C:{}: {}", LockedClient->GetName(), Message);
Network.SendToAll(nullptr, StringToVector(SanitizedPacket), true, true);
return; return;
} }
case 'E': case 'E':
@ -212,7 +213,6 @@ void TServer::GlobalParser(const std::weak_ptr<TClient>& Client, std::vector<uin
case 'Z': // position packet case 'Z': // position packet
PPSMonitor.IncrementInternalPPS(); PPSMonitor.IncrementInternalPPS();
Network.SendToAll(LockedClient.get(), Packet, false, false); Network.SendToAll(LockedClient.get(), Packet, false, false);
HandlePosition(*LockedClient, StringPacket); HandlePosition(*LockedClient, StringPacket);
default: default:
return; return;