doctor can see patients who logged on before
This commit is contained in:
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
||||
using ClientApp.Utils;
|
||||
using System.Diagnostics;
|
||||
using Util;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
@@ -168,7 +169,7 @@ namespace Server
|
||||
Console.WriteLine("Log in");
|
||||
this.username = username;
|
||||
sendMessage(DataParser.getLoginResponse("OK"));
|
||||
sendMessage(DataParser.getStartSessionJson());
|
||||
//sendMessage(DataParser.getStartSessionJson());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -185,6 +186,7 @@ namespace Server
|
||||
|
||||
public void sendMessage(byte[] message)
|
||||
{
|
||||
Debug.WriteLine("serverclient " + Encoding.ASCII.GetString(message.Skip(5).ToArray()));
|
||||
stream.BeginWrite(message, 0, message.Length, new AsyncCallback(OnWrite), null);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ namespace Server
|
||||
this.mDoctor = value;
|
||||
this.clients.ForEach((client) =>
|
||||
{
|
||||
var dinges = DataParser.getNewConnectionJson(client.username);
|
||||
Debug.WriteLine("foreach " + Encoding.ASCII.GetString(dinges));
|
||||
Debug.WriteLine("foreach called for " + client.username);
|
||||
byte[] dinges = DataParser.getNewConnectionJson(client.username);
|
||||
Debug.WriteLine("foreach " + Encoding.ASCII.GetString(dinges.Skip(5).ToArray()));
|
||||
this.mDoctor.sendMessage(dinges);
|
||||
});
|
||||
}
|
||||
@@ -63,7 +64,8 @@ namespace Server
|
||||
|
||||
public void NewLogin(Client client)
|
||||
{
|
||||
clients.Add(client);
|
||||
this.clients.Add(client);
|
||||
Debug.WriteLine("amount of clients is now " + this.clients.Count);
|
||||
var dinges = DataParser.getNewConnectionJson(client.username);
|
||||
Debug.WriteLine("new login" + Encoding.ASCII.GetString(dinges));
|
||||
Doctor?.sendMessage(dinges);
|
||||
|
||||
Reference in New Issue
Block a user