Don't ignore the message limit in team chat
This commit is contained in:
@@ -81,22 +81,27 @@ namespace OpenRA.Network
|
||||
{
|
||||
var client = orderManager.LobbyInfo.ClientWithIndex(clientId);
|
||||
|
||||
// Cut chat messages to the hard limit to avoid exploits
|
||||
var message = order.TargetString;
|
||||
if (message.Length > ChatMessageMaxLength)
|
||||
message = order.TargetString.Substring(0, ChatMessageMaxLength);
|
||||
|
||||
if (client != null)
|
||||
{
|
||||
if (world == null)
|
||||
{
|
||||
if (orderManager.LocalClient != null && client.Team == orderManager.LocalClient.Team)
|
||||
Game.AddChatLine(client.Color, "[Team] " + client.Name, order.TargetString);
|
||||
Game.AddChatLine(client.Color, "[Team] " + client.Name, message);
|
||||
}
|
||||
else
|
||||
{
|
||||
var player = world.FindPlayerByClient(client);
|
||||
if (player != null && player.WinState == WinState.Lost)
|
||||
Game.AddChatLine(client.Color, client.Name + " (Dead)", order.TargetString);
|
||||
Game.AddChatLine(client.Color, client.Name + " (Dead)", message);
|
||||
else if ((player != null && world.LocalPlayer != null && player.Stances[world.LocalPlayer] == Stance.Ally) || (world.IsReplay && player != null))
|
||||
Game.AddChatLine(client.Color, "[Team" + (world.IsReplay ? " " + client.Team : "") + "] " + client.Name, order.TargetString);
|
||||
Game.AddChatLine(client.Color, "[Team" + (world.IsReplay ? " " + client.Team : "") + "] " + client.Name, message);
|
||||
else if ((orderManager.LocalClient != null && orderManager.LocalClient.IsObserver && client.IsObserver) || (world.IsReplay && client.IsObserver))
|
||||
Game.AddChatLine(client.Color, "[Spectators] " + client.Name, order.TargetString);
|
||||
Game.AddChatLine(client.Color, "[Spectators] " + client.Name, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user