[ADD] added get lobby for users method
This commit is contained in:
@@ -55,9 +55,6 @@ namespace Client
|
|||||||
wantToBeHost = true;
|
wantToBeHost = true;
|
||||||
wantToBeHostId = id;
|
wantToBeHostId = id;
|
||||||
client.OnLobbiesReceivedAndWaitingForHost = hostLobbiesReceived;
|
client.OnLobbiesReceivedAndWaitingForHost = hostLobbiesReceived;
|
||||||
// lobby id krijgen waarvan je host bent
|
|
||||||
// wachten totdat list van lobbies is gekomen
|
|
||||||
// uit die list de id zoeken en die joinen
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,18 @@ namespace Server.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Lobby GetLobbyForUser(User user)
|
||||||
|
{
|
||||||
|
foreach (Lobby l in lobbies)
|
||||||
|
{
|
||||||
|
if (l.Users.Contains(user))
|
||||||
|
{
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void AddToLobby(Lobby lobby, User user)
|
public void AddToLobby(Lobby lobby, User user)
|
||||||
{
|
{
|
||||||
foreach (Lobby l in lobbies)
|
foreach (Lobby l in lobbies)
|
||||||
|
|||||||
Reference in New Issue
Block a user