From 30c5d5a2a3cc150c016c9a7e291f8f4a794cbd5f Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Wed, 14 Oct 2020 15:58:06 +0200 Subject: [PATCH] add message to server switch --- Server/Client.cs | 3 +++ Server/Communication.cs | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Server/Client.cs b/Server/Client.cs index 092fe70..67cb0e7 100644 --- a/Server/Client.cs +++ b/Server/Client.cs @@ -113,6 +113,9 @@ namespace Server Console.WriteLine($"set resistance worked is " + worked); //set resistance on doctor GUI break; + case DataParser.MESSAGE: + //TODO send message to clients + break; default: Console.WriteLine($"Received json with identifier {identifier}:\n{Encoding.ASCII.GetString(payloadbytes)}"); break; diff --git a/Server/Communication.cs b/Server/Communication.cs index ab956c9..1169597 100644 --- a/Server/Communication.cs +++ b/Server/Communication.cs @@ -35,15 +35,6 @@ namespace Server var tcpClient = listener.EndAcceptTcpClient(ar); Console.WriteLine($"Client connected from {tcpClient.Client.RemoteEndPoint}"); clients.Add(new Client(this, tcpClient)); - /*if (doctor == null) - { - doctor = clients.ElementAt(0); - } - else - { - - doctor.sendMessage(DataParser.getNewConnectionJson("jan")); - }*/ listener.BeginAcceptTcpClient(new AsyncCallback(OnConnect), null); }