diff --git a/Client/Client.cs b/Client/Client.cs index 17551de..5152afe 100644 --- a/Client/Client.cs +++ b/Client/Client.cs @@ -72,10 +72,10 @@ namespace Client Array.Copy(message, 1, payload, 0, message.Length - 1); switch (id) { - case 0x01: + case JSONConvert.LOGIN: // json log in username data break; - case 0x02: + case JSONConvert.MESSAGE: // json message data (string, string) combo = JSONConvert.GetUsernameAndMessage(payload); string textUsername = combo.Item1; @@ -84,11 +84,11 @@ namespace Client break; - case 0x03: + case JSONConvert.LOBBY: // lobby data //TODO fill lobby with the data received break; - case 0x04: + case JSONConvert.CANVAS: // canvas data break; default: diff --git a/Client/ViewModels/ViewModel.cs b/Client/ViewModels/ViewModel.cs index fb310bf..abb89e3 100644 --- a/Client/ViewModels/ViewModel.cs +++ b/Client/ViewModels/ViewModel.cs @@ -5,6 +5,7 @@ using System.ComponentModel; using System.Text; using System.Windows.Input; using SharedClientServer; +using System.Diagnostics; namespace Client { @@ -43,9 +44,6 @@ namespace Client { get { - if (_model == null) - _model = new Model(); - return _model; } @@ -61,5 +59,10 @@ namespace Client get { return _lobbies; } set { _lobbies = value; } } + + public void OnHostButtonClick() + { + Debug.WriteLine("Click host button"); + } } } diff --git a/Client/Views/MainWindow.xaml b/Client/Views/MainWindow.xaml index 7830f07..b3221df 100644 --- a/Client/Views/MainWindow.xaml +++ b/Client/Views/MainWindow.xaml @@ -12,7 +12,7 @@ - + @@ -34,7 +34,6 @@