Merge branch 'master' into feature/handleChatData

This commit is contained in:
Dogukan
2020-10-21 22:43:18 +02:00
9 changed files with 106 additions and 26 deletions

View File

@@ -8,7 +8,7 @@ using static SharedClientServer.JSONConvert;
namespace Client
{
public delegate void OnLobbyCreated(int id);
public delegate void LobbyCallback(int id);
class Client : ObservableObject
{
private TcpClient tcpClient;
@@ -23,7 +23,8 @@ namespace Client
public Callback OnLobbiesListReceived;
public Callback OnLobbyJoinSuccess;
public Callback OnLobbiesReceivedAndWaitingForHost;
public OnLobbyCreated OnLobbyCreated;
public LobbyCallback OnLobbyCreated;
public LobbyCallback OnLobbyLeave;
private ClientData data = ClientData.Instance;
public Lobby[] Lobbies { get; set; }
@@ -125,6 +126,10 @@ namespace Client
case LobbyIdentifier.JOIN_SUCCESS:
OnLobbyJoinSuccess?.Invoke();
break;
case LobbyIdentifier.LEAVE:
int lobbyLeaveID = JSONConvert.GetLobbyID(payload);
OnLobbyLeave?.Invoke(lobbyLeaveID);
break;
}
//TODO fill lobby with the data received
break;