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

@@ -202,12 +202,18 @@ namespace Server.Models
return lobby.ID;
}
public void JoinLobby(User user, int id)
public void JoinLobby(User user, int id, out bool isHost)
{
isHost = false;
foreach (Lobby l in lobbies)
{
if (l.ID == id)
{
if (l.Users.Count == 0)
{
user.Host = true;
isHost = true;
}
AddToLobby(l, user);
Debug.WriteLine($"{user.Username} joined lobby with id {id}");
break;