当前位置: 首页>>代码示例>>PHP>>正文


PHP Authenticate::is_player方法代码示例

本文整理汇总了PHP中Authenticate::is_player方法的典型用法代码示例。如果您正苦于以下问题:PHP Authenticate::is_player方法的具体用法?PHP Authenticate::is_player怎么用?PHP Authenticate::is_player使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authenticate的用法示例。


在下文中一共展示了Authenticate::is_player方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update_product_price

 /**
  * update product price.
  *
  * role: player
  */
 public function update_product_price()
 {
     if (Authenticate::is_player()) {
         if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_product = Product::getInstance();
             $product = $_POST['product_data'];
             $result = $this->model_product->update_player_product($product);
             $binding = array("result_var" => "session_ready", "status_var" => $result);
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:22,代码来源:ProductController.php

示例2: retrieve_leaderboard

 /**
  * retrieve player ranking and global ranking.
  * route : player
  */
 public function retrieve_leaderboard()
 {
     if (Authenticate::is_player()) {
         if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_leaderboard = Leaderboard::getInstance();
             $player_ranking = $this->model_leaderboard->get_player_ranking();
             $global_ranking = $this->model_leaderboard->get_global_ranking();
             $binding = array("result_var" => "session_ready", "leaderboard_player_var" => json_encode($player_ranking), "leaderboard_global_var" => json_encode($global_ranking));
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:21,代码来源:LeaderboardController.php

示例3: unlock_achievement

 /**
  * save new achievement via REST.
  * role: player
  */
 public function unlock_achievement()
 {
     if (Authenticate::is_player()) {
         if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_achievement = Achievement::getInstance();
             /*
              * populate type of achievement.
              * invoke method to unlock the achievement.
              * log this event about achievement earning.
              */
             $achievement = $_POST["achievement"];
             $result = $this->model_achievement->unlock_achievement($achievement);
             $log = Log::getInstance();
             $log->logging_game_earn_achievement("Achievement id {$achievement}");
             $binding = array("result_var" => "session_ready", "unlock_status" => $result);
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:28,代码来源:AchievementController.php

示例4: update_employee

 /**
  * update employee status.
  * role: player
  */
 public function update_employee()
 {
     if (Authenticate::is_player()) {
         if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_employee = Employee::getInstance();
             $employee = $_POST['employee_data'];
             $result = $this->model_employee->update_employee_status($employee);
             $binding = array("result_var" => "session_ready", "status_var" => $result);
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:21,代码来源:EmployeeController.php

示例5: retrieve_balance

 /**
  * retrieve balance sheet from database.
  * role: player
  */
 public function retrieve_balance()
 {
     if (Authenticate::is_player()) {
         if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_journal = Journal::getInstance();
             /*
              * invoke method to retrieve balance data.
              * convert into json format and binding these data.
              */
             $result = $this->model_journal->get_balance_sheet();
             $binding = array("result_var" => "session_ready", "balance_var" => json_encode($result, JSON_PRETTY_PRINT));
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:24,代码来源:AccountingController.php

示例6: update_avatar

 /**
  * update player avatar after cropped by javascript on front end page.
  * set session of update status.
  * role: player
  */
 public function update_avatar()
 {
     if (Authenticate::is_player()) {
         $model_player = Player::getInstance();
         if ($model_player->update_avatar()) {
             $_SESSION['operation'] = 'success';
         } else {
             $_SESSION['operation'] = 'error';
         }
         transport("page/sign/id=" . $_SESSION['ply_id']);
     } else {
         transport("page");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:19,代码来源:PlayerController.php

示例7: update_material

 /**
  * role: player
  */
 public function update_material()
 {
     if (Authenticate::is_player()) {
         if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_material = Material::getInstance();
             $material = $_POST["material_data"];
             $result = true;
             foreach (json_decode($material) as $attribute) {
                 $result = $this->model_material->update_material($attribute->pma_id, $attribute->pma_stock, $attribute->pma_expired_remaining);
             }
             $binding = array("result_var" => "session_ready", "status_var" => $result);
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:23,代码来源:InventoryController.php

示例8: get_simulation_avatar

 /**
  * retrieve another avatar from another user.
  * role: player
  * @return string
  */
 public function get_simulation_avatar()
 {
     if (Authenticate::is_player()) {
         if (true || isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {
             $this->model_player = Player::getInstance();
             /*
              * retrieve at least 3 avatar except player.
              * wrap it up and convert to json format.
              */
             $avatar = $this->model_player->fetch_simulation_avatar();
             $binding = array("result_var" => "session_ready", "avatar_var" => json_encode($avatar, JSON_PRETTY_PRINT));
             binding_data($binding);
         } else {
             transport("error404");
         }
     } else {
         $binding = array("result_var" => "no_session");
         binding_data($binding);
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:25,代码来源:GameServerController.php

示例9: game

 /**
  * show game page via user profile.
  * game could be played if user has been logged in.
  * role: player
  */
 public function game()
 {
     if (Authenticate::is_player()) {
         $this->framework->view->page = "game";
         $this->framework->view->content = "/frontend/pages/game";
         $this->framework->view->show("frontend/game");
         $log = Log::getInstance();
         $log->logging_web_play(uniqid());
     } else {
         transport("page");
     }
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:17,代码来源:PageController.php


注:本文中的Authenticate::is_player方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。