SendChat function in server

This commit is contained in:
Chris Forbes
2009-12-04 21:38:07 +13:00
parent 8acb8341c0
commit 19eea366e7

View File

@@ -306,6 +306,11 @@ namespace OpenRA.Server
return a(cmdValue);
}
static void SendChat(Connection asConn, string text)
{
DispatchOrders(null, 0, new ServerOrder(asConn.PlayerIndex, "Chat", text).Serialize());
}
static void InterpretServerOrder(Connection conn, ServerOrder so)
{
switch (so.Name)
@@ -342,9 +347,7 @@ namespace OpenRA.Server
Console.WriteLine(e.ToString());
conns.Remove(toDrop);
DispatchOrders(toDrop, 0,
new ServerOrder(toDrop.PlayerIndex, "Chat", "Connection Dropped").Serialize());
SendChat(toDrop, "Connection Dropped");
/* don't get stuck waiting for the dropped player, if they were the one holding up a frame */