public function action_index() { $result = DB::select('points', 'name')->from('user_fortune')->join('user')->on('user.id', '=', 'user_fortune.id')->order_by('user_fortune.points', 'desc')->limit(10)->execute()->as_array(); $ranking = ['points' => $result]; $exp = ['components' => [View_Twig::forge('game/component/status'), View_Twig::forge('game/component/map'), View_Twig::forge('game/component/ranking', $ranking), View_Twig::forge('game/component/station_change_list'), View_Twig::forge('game/component/station_history'), View_Twig::forge('game/component/chat')], 'js' => [View_Twig::forge('game/js/map_position'), View_Twig::forge('game/js/train_position'), View_Twig::forge('game/js/my_position'), View_Twig::forge('game/js/station_change_list'), View_Twig::forge('game/js/station_history'), View_Twig::forge('game/js/chat')]]; $this->template->content = View_Twig::forge('game/ride', $exp); }
public function action_battle() { //マニュアル バトルの仕方 $exports = []; $this->template->title = 'Metro Royal Manual'; $this->template->navigation = View_Twig::forge('portal/_navigation'); $this->template->content = View_Twig::forge('manual/battle', $exports); }
public function action_entry() { // 登録時 if (Input::method() == 'POST') { // バリデーション $val = Model_Twitteruser::validate('create'); $input = array('uid' => Session::get('uid'), 'token' => Session::get('token'), 'secret' => Session::get('secret')); if ($val->run($input)) { // バリデーション成功時 $user = Model_User::forge(array('name' => Session::get('nickname'), 'password' => substr(str_shuffle('1234567890abcdefghijklmnopqrstuvwxyz'), 0, 10), 'sex' => Input::post('sex'), 'birth_station_id' => Input::post('birth_station_id'))); $twitter_user = Model_TwitterUser::forge($input); if ($user and $twitter_user) { // ユーザー生成成功 try { \DB::start_transaction(); if ($user->save() === false) { // User保存失敗 throw new \Exception('user save failed.'); } $twitter_user->user_id = $user->id; if ($twitter_user->save() === false) { // TwitterUser保存失敗 throw new \Exception('twitter_user save failed.'); } //その他Userに付随する情報を作成 //user_state $state = Model_Userstate::forge(array('id' => $user->id, 'ride_state' => '0', 'now_station_id' => $user->birth_station_id)); if ($state->save() === false) { // user_state保存失敗 throw new \Exception('user_state save failed.'); } //user_fortune //ポイントは動的にできるように。。。 $fortune = Model_Userfortune::forge(array('id' => $user->id, 'points' => 10000, 'domination1' => ' ', 'domination2' => ' ', 'domination3' => ' ')); if ($fortune->save() == false) { // user_state保存失敗 throw new \Exception('user_fortune save failed.'); } // 保存成功 \DB::commit_transaction(); //サインアップ成功なのでいらないSessionは消す Session::delete('uid'); Session::delete('token'); Session::delete('secret'); Session::delete('nickname'); Model_User::login_twitter($user->id); Response::redirect('portal'); } catch (\Exception $e) { \DB::rollback_transaction(); Response::redirect('portal'); } } else { // ユーザー生成失敗 Response::redirect('portal'); } } else { // バリデーション失敗時 Response::redirect('portal'); } // 登録できたら ポータルに戻る. } // Viewに受け渡す用 $exp = ['name' => Session::get('nickname'), 'stations' => Model_Traininfo::get_birth_train_summary()]; $this->template->title = '新規アカウント登録'; $this->template->content = View_Twig::forge('portal/entry', $exp); }
public function action_index() { $this->template->content = View_Twig::forge('game/on'); }
public function action_index() { $exports = ['components' => [View_Twig::forge('game/component/status'), View_Twig::forge('game/component/train')], 'js' => [View_Twig::forge('game/js/map_position'), View_Twig::forge('game/js/train_position'), View_Twig::forge('game/js/my_position')]]; $this->template->content = View_Twig::forge('game/game', $exports); //$this->template->content = View_Twig::forge('game/index', $exports); }