hack in team chat support

This commit is contained in:
Chris Forbes
2010-05-16 16:18:27 +12:00
parent d87807809d
commit 128f12e88e
5 changed files with 25 additions and 2 deletions

View File

@@ -37,6 +37,20 @@ namespace OpenRA.Network
Game.chat.AddLine(client, order.TargetString);
break;
}
case "TeamChat":
{
var client = Game.LobbyInfo.Clients.FirstOrDefault(c => c.Index == clientId);
if (client != null)
{
var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index);
var isAlly = player != null && Game.world.LocalPlayer != null
&& player.Stances[Game.world.LocalPlayer] == Stance.Ally;
if (isAlly)
Game.chat.AddLine(client, "(Team) " + order.TargetString);
}
break;
}
case "StartGame":
{
Game.chat.AddLine(Color.White, "Server", "The game has started.");