[ADDED] lobby now secured when the game starts. start button is still for everyone available, not working yet
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user