[FIX] made message sending statful

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

View File

@@ -173,6 +173,7 @@ namespace Client
Debug.WriteLine("[CLIENT] Received weird identifier: " + id);
break;
}
SendMessage(JSONConvert.GetMessageToSend(JSONConvert.MESSAGE_RECEIVED,null));
}

View File

@@ -192,12 +192,15 @@ namespace Server.Models
ServerCommunication.INSTANCE.JoinLobby(this.User,id, out isHost);
sendMessage(JSONConvert.ConstructLobbyJoinSuccessMessage(isHost));
ServerCommunication.INSTANCE.sendToAll(JSONConvert.ConstructLobbyListMessage(ServerCommunication.INSTANCE.lobbies.ToArray()));
serverCom.sendToAll(JSONConvert.GetMessageToSend(JSONConvert.RANDOMWORD, new
OnMessageReceivedOk = () =>
{
id = serverCom.GetLobbyForUser(User).ID,
word = JSONConvert.SendRandomWord("WordsForGame.json")
}));
serverCom.sendToAll(JSONConvert.GetMessageToSend(JSONConvert.RANDOMWORD, new
{
id = serverCom.GetLobbyForUser(User).ID,
word = JSONConvert.SendRandomWord("WordsForGame.json")
}));
OnMessageReceivedOk = null;
};
break;
case LobbyIdentifier.LEAVE:
id = JSONConvert.GetLobbyID(payload);