The protagonist Yijia woke up and thought he had traveled through time, but the visitor told him that it was his dream, so the protagonist and another person found a way to wake up from the dream. As for why? The plot requires it, who cares?
Intention: No intention