public void PlayerJoinedGame(int gameID, Models.ClientUserProfile prof) { Dispatcher.CurrentDispatcher.InvokeAsync(() => { GameFrame gameFrame = findGameFrame(gameID); if (gameFrame != null) { gameFrame.getGame().AddPlayerToWaitingList(prof); } }); }
public void ShowAvatar() { Models.ClientUserProfile prof = manager.GetProfile(); BitmapImage image = manager.getAvatar(); if (image != null) { user_avatar.Source = image; } username.Content = prof.username; credit.Content = "Credit: $" + prof.credit; }
internal void ConnectToServer() { TRY_AGAIN: if (!(Communication.Server.Instance.connect())) { MessageBoxResult rs = MessageBox.Show("Could not connect.\nClick Yes to try again or No to quit", "No Connection", MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.No); if (rs == MessageBoxResult.Yes) { goto TRY_AGAIN; } else { mainWindow.Close(); } } else { mainWindow.mainFrame.NavigationService.Navigate(new Login(this)); profile = new Models.ClientUserProfile(); } }
public void RefreshStatus() { Models.ClientUserProfile prof = manager.GetProfile(); this.credit.Content = "Credit: $" + prof.credit; this.username.Content = "Hello " + prof.username; }
public async Task RefreshProfile() { profile = await Communication.AuthFunctions.Instance.getClientUser(); statusWindow.RefreshStatus(); }
public void AddPlayerToWaitingList(ClientUserProfile profile) { waitingList.Add(profile); messageList.Add(profile.username, ""); }