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'); }
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}; }