public async Task CreateRoom(string roomId) { var room = new RoomConfig { RoomId = roomId, PlayerList = new PlayerList() }; _roomList.AddRoom(room); await UpdateRoomInfo(); }
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)); }