private static void SendUpdatedGamesList(List <Message> result) { var clientConnectedMessage = new ClientConnectedMessage(); clientConnectedMessage.Games = GameManager.RecieveAllGames(); result.Add(clientConnectedMessage); }
private static List <Message> HandleRetrieveAllGamesMessage(Message message) { var result = new List <Message>(); var clientConnectedMessage = message as ClientConnectedMessage; clientConnectedMessage.Games = GameManager.RecieveAllGames(); result.Add(clientConnectedMessage); return(result); }
private static List <Message> HandleClientConnectedMessage(Message message, string userId) { var result = new List <Message>(); var clientConnectedMessage = message as ClientConnectedMessage; if (!AbstractPlayers.Select(p => p.Id).Contains(userId)) { AbstractPlayers.Add(new Player { Id = userId, Name = message.Login }); } clientConnectedMessage.Games = GameManager.RecieveAllGames(); result.Add(clientConnectedMessage); return(result); }