Example #1
0
        public async Task CreateRoom(string roomId)
        {
            var room = new RoomConfig
            {
                RoomId     = roomId,
                PlayerList = new PlayerList()
            };

            _roomList.AddRoom(room);

            await UpdateRoomInfo();
        }
Example #2
0
        public ActionResult <Room> CreateRoom(Room room)
        {
            var historyRoom = RoomList.FindRoom(room.Id);

            if (!(historyRoom is null))
            {
                return(BadRequest());
            }

            RoomList.AddRoom(room);

            HttpContext.Session.SetInt32(KeyRoomId, room.Id);

            return(CreatedAtAction(nameof(GetRoom), new { id = room.Id }, room));
        }