Updated the switch case to include the new requests,
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user