[FIX] merge stuff

This commit is contained in:
Sem van der Hoeven
2020-10-22 17:05:02 +02:00
parent 9fa231ab00
commit 4a400628df
2 changed files with 2 additions and 6 deletions

View File

@@ -87,7 +87,8 @@ namespace Client
private void joinLobby() private void joinLobby()
{ {
// lobby die je wilt joinen verwijderen
// nieuwe binnengekregen lobby toevoegen
client.OnLobbyJoinSuccess = OnLobbyJoinSuccess; client.OnLobbyJoinSuccess = OnLobbyJoinSuccess;
client.SendMessage(JSONConvert.ConstructLobbyJoinMessage(SelectedLobby.ID)); client.SendMessage(JSONConvert.ConstructLobbyJoinMessage(SelectedLobby.ID));
} }

View File

@@ -188,16 +188,11 @@ namespace Server.Models
break; break;
case LobbyIdentifier.JOIN: case LobbyIdentifier.JOIN:
int id = JSONConvert.GetLobbyID(payload); int id = JSONConvert.GetLobbyID(payload);
ServerCommunication.INSTANCE.JoinLobby(this.User, id);
sendMessage(JSONConvert.ConstructLobbyJoinSuccessMessage());
bool isHost; bool isHost;
ServerCommunication.INSTANCE.JoinLobby(this.User,id, out isHost); ServerCommunication.INSTANCE.JoinLobby(this.User,id, out isHost);
sendMessage(JSONConvert.ConstructLobbyJoinSuccessMessage(isHost)); sendMessage(JSONConvert.ConstructLobbyJoinSuccessMessage(isHost));
ServerCommunication.INSTANCE.sendToAll(JSONConvert.ConstructLobbyListMessage(ServerCommunication.INSTANCE.lobbies.ToArray())); ServerCommunication.INSTANCE.sendToAll(JSONConvert.ConstructLobbyListMessage(ServerCommunication.INSTANCE.lobbies.ToArray()));
//Task.Run(SendLobbyData);
serverCom.sendToAll(JSONConvert.GetMessageToSend(JSONConvert.RANDOMWORD, new serverCom.sendToAll(JSONConvert.GetMessageToSend(JSONConvert.RANDOMWORD, new
{ {
id = serverCom.GetLobbyForUser(User).ID, id = serverCom.GetLobbyForUser(User).ID,