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); 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) static void InterpretServerOrder(Connection conn, ServerOrder so)
{ {
switch (so.Name) switch (so.Name)
@@ -342,9 +347,7 @@ namespace OpenRA.Server
Console.WriteLine(e.ToString()); Console.WriteLine(e.ToString());
conns.Remove(toDrop); conns.Remove(toDrop);
SendChat(toDrop, "Connection Dropped");
DispatchOrders(toDrop, 0,
new ServerOrder(toDrop.PlayerIndex, "Chat", "Connection Dropped").Serialize());
/* don't get stuck waiting for the dropped player, if they were the one holding up a frame */ /* don't get stuck waiting for the dropped player, if they were the one holding up a frame */