Exemple #1
0
 function load()
 {
     parent::load();
     $this->quiz = trim($this->data['guide_quiz']);
     if ($this->quiz == GUIDE_QUIZ_COMPLETED) {
         exit(0);
         return null;
     }
     $m = new GuideModel();
     $this->taskState = 0;
     if ($this->quiz == GUIDE_QUIZ_NOTSTARTED || $this->quiz == GUIDE_QUIZ_SUSPENDED) {
         $this->clientAction = 0 - 1;
         if (isset($_GET['v']) && $_GET['v'] == 'f') {
             if ($this->quiz == GUIDE_QUIZ_NOTSTARTED) {
                 $m->setGuideTask($this->player->playerId, GUIDE_QUIZ_SUSPENDED);
             }
             $m->dispose();
             exit(0);
             return null;
         }
         if (isset($_GET['v']) && $_GET['v'] == 'n') {
             $this->quiz = '1,200';
             $this->clientAction = 1;
             $m->setGuideTask($this->player->playerId, $this->quiz);
         } else {
             $this->taskNumber = isset($_GET['v']) && $_GET['v'] == 's' ? 1 : 0;
             if ($this->taskNumber == 1) {
                 $this->clientAction = 0;
                 $this->quiz = '0,1';
                 $m->setGuideTask($this->player->playerId, $this->quiz);
             }
             return null;
         }
     }
     $quizArray = explode(',', $this->quiz);
     $this->taskNumber = $quizArray[1];
     if ($this->taskNumber == 200) {
         if (isset($_GET['v'])) {
             if ($_GET['v'] == 'y') {
                 $this->taskNumber = 0;
                 $this->clientAction = 1;
                 $this->quiz = GUIDE_QUIZ_NOTSTARTED;
                 $m->setGuideTask($this->player->playerId, $this->quiz);
                 return null;
             }
             if ($_GET['v'] == 'c') {
                 $this->quiz = '0,201,0';
                 $quizArray = explode(',', $this->quiz);
                 $this->taskNumber = $quizArray[1];
                 $m->setGuideTask($this->player->playerId, $this->quiz);
             }
         }
     }
     if ($this->taskNumber == 201) {
         $this->handleNoQuiz($m, $quizArray[2]);
     } else {
         if ($quizArray[0] == 1) {
             $this->clientAction = $quizArray[0] = 0;
             $m->setGuideTask($this->player->playerId, implode(',', $quizArray));
             $this->newReadQuiz($this->taskNumber, $m, $quizArray);
         } else {
             $this->checkForQuiz($this->taskNumber, $m, $quizArray);
         }
     }
     $m->dispose();
 }
Exemple #2
0
 public function load()
 {
     parent::load();
     $this->quiz = trim($this->data['guide_quiz']);
     if ($this->quiz == GUIDE_QUIZ_COMPLETED) {
         exit(0);
     } else {
         $m = new GuideModel();
         $this->taskState = 0;
         if ($this->quiz == GUIDE_QUIZ_NOTSTARTED || $this->quiz == GUIDE_QUIZ_SUSPENDED) {
             $this->clientAction = 0 - 1;
             if (isset($_GET['v']) && $_GET['v'] == "f") {
                 if ($this->quiz == GUIDE_QUIZ_NOTSTARTED) {
                     $m->setGuideTask($this->player->playerId, GUIDE_QUIZ_SUSPENDED);
                 }
                 $m->dispose();
                 exit(0);
             } else {
                 if (isset($_GET['v']) && $_GET['v'] == "n") {
                     $this->quiz = "1,200";
                     $this->clientAction = 1;
                     $m->setGuideTask($this->player->playerId, $this->quiz);
                 } else {
                     $this->taskNumber = isset($_GET['v']) && $_GET['v'] == "s" ? 1 : 0;
                     if ($this->taskNumber == 1) {
                         $this->clientAction = 0;
                         $this->quiz = "0,1";
                         $m->setGuideTask($this->player->playerId, $this->quiz);
                     }
                 }
             }
         } else {
             $quizArray = explode(",", $this->quiz);
             $this->taskNumber = $quizArray[1];
             if ($this->taskNumber == 200 && isset($_GET['v'])) {
                 if ($_GET['v'] == "y") {
                     $this->taskNumber = 0;
                     $this->clientAction = 1;
                     $this->quiz = GUIDE_QUIZ_NOTSTARTED;
                     $m->setGuideTask($this->player->playerId, $this->quiz);
                 } else {
                     if ($_GET['v'] == "c") {
                         $this->quiz = "0,201,0";
                         $quizArray = explode(",", $this->quiz);
                         $this->taskNumber = $quizArray[1];
                         $m->setGuideTask($this->player->playerId, $this->quiz);
                     }
                 }
             }
             if ($this->taskNumber == 201) {
                 $this->handleNoQuiz($m, $quizArray[2]);
             } else {
                 if ($quizArray[0] == 1) {
                     $this->clientAction = $quizArray[0] = 0;
                     $m->setGuideTask($this->player->playerId, implode(",", $quizArray));
                     $this->newReadQuiz($this->taskNumber, $m, $quizArray);
                 } else {
                     $this->checkForQuiz($this->taskNumber, $m, $quizArray);
                 }
             }
             $m->dispose();
         }
     }
 }