Updated the switch case to include the new requests,

This commit is contained in:
Aareschluchtje
2015-10-10 22:39:58 +02:00
parent 61b837dd8a
commit 81338c0477
+28
View File
@@ -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<Meting> 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");