[ADD] added that when you join an empty lobby you become the host

This commit is contained in:
Sem van der Hoeven
2020-10-22 13:22:52 +02:00
parent 471247827b
commit 0b72c4dc9b
5 changed files with 22 additions and 10 deletions

View File

@@ -175,8 +175,9 @@ namespace Server.Models
break;
case LobbyIdentifier.JOIN:
int id = JSONConvert.GetLobbyID(payload);
ServerCommunication.INSTANCE.JoinLobby(this.User,id);
sendMessage(JSONConvert.ConstructLobbyJoinSuccessMessage());
bool isHost;
ServerCommunication.INSTANCE.JoinLobby(this.User,id, out isHost);
sendMessage(JSONConvert.ConstructLobbyJoinSuccessMessage(isHost));
ServerCommunication.INSTANCE.sendToAll(JSONConvert.ConstructLobbyListMessage(ServerCommunication.INSTANCE.lobbies.ToArray()));
break;
case LobbyIdentifier.LEAVE: