예제 #1
0
        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());
        }
예제 #2
0
        public async Task <IActionResult> WaitingLobby(Guid linkOfGuid)
        {
            var room = await _session.Get(linkOfGuid);

            if (room == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok());
            }
        }