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

View File

@@ -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;