// createNewRoom creates a new room
// Return nil in case of room is existed
createNewRoom creates a new room
Return nil in case of room is existed
// createNewRoom creates a new room // Return nil in case of room is existed
func (h *Handler) createNewRoom(game games.GameMetadata, roomID string) *room.Room {
	if !h.isRoomBusy(roomID) {
		newRoom := room.NewRoom(roomID, game, h.onlineStorage, h.cfg)
		h.rooms[newRoom.ID] = newRoom
		return newRoom
	}
	return nil
}
func ( h * Handler ) createNewRoom ( game games . GameMetadata , roomID string ) * room . Room { if ! h . isRoomBusy ( roomID ) { newRoom := room . NewRoom ( roomID , game , h . onlineStorage , h . cfg ) h . rooms [ newRoom . ID ] = newRoom return newRoom } return nil }
createNewRoom creates a new room
Return nil in case of room is existed
createNewRoom creates a new room Return nil in case of room is existed
// If the roomID doesn't have any running sessions (room was closed) // we spawn a new room // TODO: Might have race condition (and it has (:)