Example #1
0
     }
     return $response;
 }
 protected function setScript()
 {
     $html = "";
     //CSS
     $html .= '<link href="' . $this->_cur_controller->url->getBaseUri() . 'public/css/event/' . $this->_id . '.css" type="text/css" rel="stylesheet">';
Example #2
0
 public function checkLevel()
 {
     if ($this->_enabled_per_level) {
         $server = $this->_cur_controller->session->get("minigame_server");
         if (!empty($server) && is_numeric($server)) {
             $server_obj = new \HaiQuan\Frontend\Models\CtgServer();
             $server_detail = $server_obj->getServerByServerID($server);
             if (!empty($server_detail)) {
                 $server_detail = $server_detail->toArray();
                 $game_class = new \library\game();
                 $user_info = $game_class->getCharacterOnServer($this->user["ch_public_id"], $server_detail);
                 if (isset($user_info["data"]["playerLevel"]) && !empty($user_info["data"]["playerLevel"])) {
                     $level = $user_info["data"]["playerLevel"];
                     if ($level >= $this->_minimum_level) {
                         if ($level > $this->user[$this->_game_prefix]["minigame_level"]) {
                             $minus = $this->user[$this->_game_prefix]["minigame_level"];
                             if ($this->user[$this->_game_prefix]["minigame_level"] < $this->_minimum_level) {
                                 $minus = $this->_minimum_level;
                             }
                             $update_point = ($level - $minus) * $this->_level_point;
                             $this->user[$this->_game_prefix]["minigame_point"] = $this->user[$this->_game_prefix]["minigame_point"] + $update_point;
                             $this->user[$this->_game_prefix]["minigame_level"] = $level;
                             $point_model = new $this->_point_model();
                             $point_model->updatePointByUser($this->user[$this->_game_prefix], $this->user["ch_public_id"]);
                         }
                     }
                 }
             }
         }
     }
 }