Beispiel #1
0
 public void PlayerJoinedGame(int gameID, Models.ClientUserProfile prof)
 {
     Dispatcher.CurrentDispatcher.InvokeAsync(() =>
     {
         GameFrame gameFrame = findGameFrame(gameID);
         if (gameFrame != null)
         {
             gameFrame.getGame().AddPlayerToWaitingList(prof);
         }
     });
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
 public void RefreshStatus()
 {
     Models.ClientUserProfile prof = manager.GetProfile();
     this.credit.Content   = "Credit: $" + prof.credit;
     this.username.Content = "Hello " + prof.username;
 }
Beispiel #5
0
        public async Task RefreshProfile()
        {
            profile = await Communication.AuthFunctions.Instance.getClientUser();

            statusWindow.RefreshStatus();
        }
Beispiel #6
0
 public void AddPlayerToWaitingList(ClientUserProfile profile)
 {
     waitingList.Add(profile);
     messageList.Add(profile.username, "");
 }