void client_ShowPlayersInLobbyRoomCompleted(object sender, ServiceReference1.ShowPlayersInLobbyRoomCompletedEventArgs e)
 {
     plData.Clear();
     foreach (var item in e.Result)
     {
         plData.Add(new PlayerData()
         {
             PlayerId = item.PlayerId, PlayerName = item.PlayerName
         });
     }
 }
Esempio n. 2
0
 void client_ShowPlayersInLobbyRoomCompleted(object sender, ServiceReference1.ShowPlayersInLobbyRoomCompletedEventArgs e)
 {
     plData.Clear();
     foreach (var item in e.Result)
     {
         plData.Add(new PlayerData()
         {
             PlayerId = item.PlayerId, PlayerName = item.PlayerName
         });
         if (plData.Count >= 4)
         {
             App.client.StartGameCompleted += client_StartGameCompleted;
             App.client.StartGameAsync(App.Host);
         }
     }
 }
Esempio n. 3
0
 void client1_ShowPlayersInLobbyRoomCompleted(object sender, ServiceReference1.ShowPlayersInLobbyRoomCompletedEventArgs e)
 {
     try
     {
         LstCreatedLobby.Items.Clear();
         //   List<ServiceReference1.Player> pl = e.Result.ToList();
         foreach (var item in e.Result)
         {
             LstCreatedLobby.Items.Add(item.PlayerId + " " + item.PlayerName);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 4
0
 void client1_ShowPlayersInLobbyRoomCompleted(object sender, ServiceReference1.ShowPlayersInLobbyRoomCompletedEventArgs e)
 {
     try
     {
         LstCreatedLobby.Items.Clear();
         //   List<ServiceReference1.Player> pl = e.Result.ToList();
         foreach (var item in e.Result)
         {
             LstCreatedLobby.Items.Add(item.PlayerId + " " + item.PlayerName);
         }
         client1.CheckPlayerCountCompleted += client1_CheckPlayerCountCompleted;
         client1.CheckPlayerCountAsync(host.PlayerName);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.InnerException.ToString());
     }
 }