From dec11f4fa08a03540103cc3da4ff31eddb1cf9cc Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 31 Dec 2017 17:36:48 +0000 Subject: [PATCH] Force spectator color to white to avoid spoofing by the server. --- OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs index ea34267804..e113a4e46a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs @@ -476,8 +476,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic var label = item.Get("NOFLAG_LABEL"); var font = Game.Renderer.Fonts[label.Font]; var name = WidgetUtils.TruncateText(o.Name, label.Bounds.Width, font); + + // Force spectator color to prevent spoofing by the server + var color = o.IsSpectator ? Color.White : o.Color.RGB; label.GetText = () => name; - label.GetColor = () => o.Color.RGB; + label.GetColor = () => color; } clientList.AddChild(item);