Connections shit
This commit is contained in:
@@ -20,6 +20,8 @@ namespace DoctorApp.Utils
|
||||
private bool sessionRunning = false;
|
||||
private IHandler handler = null;
|
||||
private LoginViewModel LoginViewModel;
|
||||
private MainViewModel MainViewModel;
|
||||
private ClientInfoViewModel ClientInfoViewModel;
|
||||
|
||||
|
||||
public Client() : this("localhost", 5555)
|
||||
@@ -119,6 +121,12 @@ namespace DoctorApp.Utils
|
||||
sendMessage(DataParser.getSetResistanceResponseJson(true));
|
||||
}
|
||||
break;
|
||||
case DataParser.NEW_CONNECTION:
|
||||
this.MainViewModel.NewConnectedUser(DataParser.getUsernameFromResponseJson(payloadbytes));
|
||||
break;
|
||||
case DataParser.DISCONNECT:
|
||||
this.MainViewModel.NewConnectedUser(DataParser.getUsernameFromResponseJson(payloadbytes));
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine($"Received json with identifier {identifier}:\n{Encoding.ASCII.GetString(payloadbytes)}");
|
||||
break;
|
||||
@@ -247,5 +255,15 @@ namespace DoctorApp.Utils
|
||||
{
|
||||
this.LoginViewModel = loginViewModel;
|
||||
}
|
||||
|
||||
internal void SetMainViewModel(MainViewModel mainViewModel)
|
||||
{
|
||||
this.MainViewModel = mainViewModel;
|
||||
}
|
||||
|
||||
internal void SetClientInfoViewModel(ClientInfoViewModel clientInfoViewModel)
|
||||
{
|
||||
this.ClientInfoViewModel = clientInfoViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user