Merge branch 'master' into feature/jsonForWords

This commit is contained in:
SemvdH
2020-10-22 17:01:28 +02:00
committed by GitHub
5 changed files with 27 additions and 8 deletions

View File

@@ -136,9 +136,16 @@ namespace SharedClientServer
return dynamicAsObject.ToObject<Lobby>();
}
public static byte[] ConstructLobbyJoinSuccessMessage()
public static byte[] ConstructLobbyJoinSuccessMessage(bool isHost)
{
return GetMessageToSend(LOBBY, new { identifier = LobbyIdentifier.JOIN_SUCCESS});
return GetMessageToSend(LOBBY, new { identifier = LobbyIdentifier.JOIN_SUCCESS,
host = isHost});
}
public static bool GetLobbyJoinIsHost(byte[] json)
{
dynamic payload = JsonConvert.DeserializeObject(Encoding.ASCII.GetString(json));
return payload.host;
}
#endregion