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

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