コード例 #1
0
ファイル: game.php プロジェクト: radiosilence/trouble
 protected function _game_dashboard()
 {
     $uid = $this->_auth->user_id();
     $t = $this->_template;
     $g = $this->_game;
     $p = \Trouble\Player::container()->get_by_agent_game($g->id, $uid);
     $t->player = $p;
     if ($p->status > 0) {
         $t->target = $g->get_current_target($p);
         if ($t->target->id == $uid) {
             $t->self_target = True;
         }
     } else {
         $t->kill = $g->get_killed_by($p);
     }
     $t->_dialog_kill = $t->render('forms/kill.php');
     return $t->render('game_dashboard.php');
 }
コード例 #2
0
ファイル: player.php プロジェクト: radiosilence/trouble
 public function get_by_agent_game($game_id, $agent_id)
 {
     return \Trouble\Player::container()->get(array("joins" => array(new \Core\Join("agent", "Agent", array('id', 'alias', 'avatar'))), "filters" => array(new \Core\Filter("game", $game_id), new \Core\Filter("agent", $agent_id)), "order" => new \Core\Order("id")))->{0};
 }