From 81338c0477da991a481f1b88ff52f863e2b26de4 Mon Sep 17 00:00:00 2001 From: Aareschluchtje Date: Sat, 10 Oct 2015 22:39:58 +0200 Subject: [PATCH] Updated the switch case to include the new requests, --- ErgometerServer/DoctorThread.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ErgometerServer/DoctorThread.cs b/ErgometerServer/DoctorThread.cs index 6022421..ece4d0a 100644 --- a/ErgometerServer/DoctorThread.cs +++ b/ErgometerServer/DoctorThread.cs @@ -4,6 +4,7 @@ using System.Net.Sockets; using System.Runtime.Remoting.Lifetime; using System.Threading; using ErgometerLibrary; +using System.Collections.Generic; namespace ErgometerServer { @@ -52,6 +53,33 @@ namespace ErgometerServer break; case NetCommand.CommandType.USER: server.AddUser(input.users); + break; + case NetCommand.CommandType.REQUEST: + switch (input.Request) + { + case NetCommand.RequestType.USERS: + sendToDoctor(new NetCommand(FileHandler.LoadUsers(), input.Session)); + break; + case NetCommand.RequestType.OLDDATA: + List metingen = FileHandler.ReadMetingen(input.Session); + foreach (Meting meting in metingen) + { + sendToDoctor(new NetCommand(meting, input.Session)); + } + break; + case NetCommand.RequestType.ALLSESSIONS: + //Net implemented yet + break; + case NetCommand.RequestType.CURRENTSESSIONS: + //not implemented yet + break; + case NetCommand.RequestType.SESSIONDATA: + //not implemented yet + break; + default: + throw new FormatException("Unknown Command"); + } + break; default: throw new FormatException("Unknown Command");