[ADDED] lobby now secured when the game starts. start button is still for everyone available, not working yet

This commit is contained in:
Lars
2020-10-22 15:40:09 +02:00
parent 8190724f77
commit cac0fdc0a4
10 changed files with 467 additions and 363 deletions

View File

@@ -11,7 +11,10 @@ using System.Collections.ObjectModel;
using Client.Views;
using System.Linq;
using System.Windows.Data;
using System.Data;
using System.Windows.Controls.Primitives;
using System.Windows.Controls;
namespace Client
{
class ViewModel : INotifyPropertyChanged
@@ -79,8 +82,16 @@ namespace Client
{
// lobby die je wilt joinen verwijderen
// nieuwe binnengekregen lobby toevoegen
client.OnLobbyJoinSuccess = OnLobbyJoinSuccess;
client.SendMessage(JSONConvert.ConstructLobbyJoinMessage(SelectedLobby.ID));
if (SelectedLobby != null)
{
if (SelectedLobby.PlayersIn == SelectedLobby.MaxPlayers || !SelectedLobby.LobbyJoineble)
{
return;
}
client.OnLobbyJoinSuccess = OnLobbyJoinSuccess;
client.SendMessage(JSONConvert.ConstructLobbyJoinMessage(SelectedLobby.ID));
}
}
private void OnLobbyJoinSuccess()
@@ -168,5 +179,7 @@ namespace Client
get { return _lobbies; }
set { _lobbies = value; }
}
}
}