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 }); } }
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); } } }
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); } }
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()); } }