Added broadcast

This commit is contained in:
2015-10-20 19:40:55 +02:00
parent ad74945882
commit 62bb9bec96
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -40,6 +40,9 @@ namespace ErgometerServer
case NetCommand.CommandType.CHAT: case NetCommand.CommandType.CHAT:
server.SendToClient(input); server.SendToClient(input);
break; break;
case NetCommand.CommandType.BROADCAST:
server.BroadcastToClients(input.ChatMessage);
break;
case NetCommand.CommandType.VALUESET: case NetCommand.CommandType.VALUESET:
server.SendToClient(input); server.SendToClient(input);
break; break;
+2 -2
View File
@@ -88,11 +88,11 @@ namespace ErgometerServer
} }
} }
public void BroadcastToClients(NetCommand command) public void BroadcastToClients(string message)
{ {
foreach (ClientThread clientThread in clients) foreach (ClientThread clientThread in clients)
{ {
clientThread.SendToClient(command); clientThread.SendToClient(new NetCommand(message, true, clientThread.session));
} }
} }