public async Task <IActionResult> WaitingLobby(string login, Guid linkOfGuid) { var waitingRoom = _rooms.SelectRoom(linkOfGuid); if (waitingRoom == Guid.Empty) { return(NotFound()); } var newElem = await _session.Get(linkOfGuid); if (newElem != null) { return(Ok()); } var newSessionRoom = await _rooms.Get(waitingRoom); if (newSessionRoom.Player1 == login) { return(NotFound()); } newSessionRoom.Player2 = login; await _session.AddWithGuidAsync(newSessionRoom.Guid, newSessionRoom); _logger.LogInformation($"{login} join into private game with {linkOfGuid}"); return(Ok()); }
public async Task <IActionResult> WaitingLobby(Guid linkOfGuid) { var room = await _session.Get(linkOfGuid); if (room == null) { return(NotFound()); } else { return(Ok()); } }