diff --git a/Client/ViewModels/ViewModel.cs b/Client/ViewModels/ViewModel.cs index 2a23b36..40a550f 100644 --- a/Client/ViewModels/ViewModel.cs +++ b/Client/ViewModels/ViewModel.cs @@ -61,6 +61,7 @@ namespace Client Debug.WriteLine("attempting to host game for " + ClientData.Instance.User.Username); client.SendMessage(JSONConvert.ConstructLobbyHostMessage()); client.OnLobbyCreated = becomeHostForLobby; + } private void becomeHostForLobby(int id) @@ -68,6 +69,7 @@ namespace Client Debug.WriteLine($"got host succes with data {id} "); wantToBeHost = true; wantToBeHostId = id; + ClientData.Instance.User.Host = true; client.OnLobbiesReceivedAndWaitingForHost = hostLobbiesReceived; } diff --git a/Client/Views/LoginScreen.xaml.cs b/Client/Views/LoginScreen.xaml.cs index 91965b7..ec453c4 100644 --- a/Client/Views/LoginScreen.xaml.cs +++ b/Client/Views/LoginScreen.xaml.cs @@ -29,6 +29,7 @@ namespace Client.Views { User user = new User(usernameTextbox.Text); Client client = new Client(user.Username); + loginButton.IsEnabled = false; client.OnSuccessfullConnect = () => { // because we need to start the main window on a UI thread, we need to let the dispatcher handle it, which will execute the code on the ui thread @@ -42,6 +43,7 @@ namespace Client.Views }); }; + } } }