Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 14 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
BIN  apple-touch-icon.png
3  application/controllers/missions.php
@@ -125,7 +125,7 @@ public function execute($slug=false) {
125 125 // when players initially arrive update their state, depending if they
126 126 // are onthe mission or not
127 127 if ($player->state == 'mission-vote-acknowledge') {
128   - if ($player->team === false) {
  128 + if ($player->team == false) {
129 129 $player->state = 'mission-watch';
130 130 } else {
131 131 $player->state = 'mission-execute';
@@ -146,6 +146,7 @@ public function execute($slug=false) {
146 146
147 147 // check success/fail
148 148 $vote_result = Game::check_mission_vote($game);
  149 +
149 150 // when all players have acknowledged we redirect top relevant step
150 151 if ($vote_result == "Success") {
151 152
14 application/models/game.php
@@ -12,7 +12,7 @@ class Game {
12 12 var $fail = 0;
13 13 var $last_mission = false;
14 14 var $updated = '';
15   -
  15 +
16 16 // work out the correct url for viewing this game
17 17 static function get_url_for_state($state, $slug) {
18 18 if ($state == 'joining') {
@@ -29,6 +29,8 @@ static function get_url_for_state($state, $slug) {
29 29 return '/missions/vote/'.$slug;
30 30 } else if ($state == 'mission-execute') {
31 31 return '/missions/execute/'.$slug;
  32 + } else if ($state == 'mission-watch') {
  33 + return '/missions/execute/'.$slug;
32 34 } else if ($state == 'mission-result') {
33 35 return '/missions/result/'.$slug;
34 36 } else if ($state == 'mission-failed') {
@@ -172,15 +174,17 @@ static function check_mission_vote($game) {
172 174 $voted_yes = 0;
173 175 $voted_no = 0;
174 176 $required_fails = Game::how_many_fails($game, $game->current_mission);
175   - foreach ($game->players as $player) {
176   - if ($player->state == "mission-execute") {
177   - if ($player->vote == "Succeed") {
  177 + foreach ($game->players as $p1) {
  178 + if ($p1->state == "mission-execute") {
  179 + if ($p1->vote == "Succeed") {
178 180 $voted_yes++;
179   - } else if ($player->vote == "Fail") {
  181 + } else if ($p1->vote == "Fail") {
180 182 $voted_no++;
181 183 } else {
182 184 $not_voted++;
183 185 }
  186 + } else if ($p1->state == "mission-vote-acknowledge") {
  187 + $not_voted++;
184 188 }
185 189 }
186 190 if ($not_voted > 0) {
4 application/views/shared/_header.php
@@ -6,7 +6,9 @@
6 6 <link href='http://fonts.googleapis.com/css?family=Exo:800' rel='stylesheet' type='text/css'>
7 7 <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
8 8 <link href="/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
9   - <link href="/css/application.css" rel="stylesheet" media="screen">
  9 + <link href="/css/application.css" rel="stylesheet" media="screen">
  10 + <link rel="shortcut icon" href="favicon.ico" >
  11 + <link rel="apple-touch-icon" href="apple-touch-icon.png" >
10 12 </head>
11 13
12 14 <body data-game="<?= $game_name ?>">
BIN  favicon.ico
Binary file not shown
2  index.php
... ... @@ -1,5 +1,7 @@
1 1 <?php
2 2
  3 +date_default_timezone_set('UTC');
  4 +
3 5 /*
4 6 *---------------------------------------------------------------
5 7 * APPLICATION ENVIRONMENT
1  php.ini
... ... @@ -0,0 +1 @@
  1 +short_open_tag=On

No commit comments for this range

Something went wrong with that request. Please try again.