Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
parkquiz [2018-04-13 14:11] Joakim Forsgren |
parkquiz [2018-05-02 20:53] Joakim Forsgren |
||
---|---|---|---|
Line 54: | Line 54: | ||
* status_code, | * status_code, | ||
* opponent_login | * opponent_login | ||
- | * status på alla frågor 1-18 för båda spelarna | + | * me[] (status på alla frågor 1-18 för me) (-1 = ej svarat, 0 = fel, 1 = rätt) |
+ | * op[] (status på alla frågor 1-18 för op) (-1 = ej svarat, 0 = fel, 1 = rätt) | ||
* [status_message] | * [status_message] | ||
* **e=get-games** | * **e=get-games** | ||
Line 99: | Line 100: | ||
* option4 | * option4 | ||
* [status_message] | * [status_message] | ||
- | * **e=my-turn**\\ | + | |
+ | * skickar: | ||
+ | * auth_token | ||
+ | * game_id | ||
+ | * svar: | ||
+ | * status_code | ||
+ | * my_question (1 eller 0) | ||
+ | | ||
* skickar: | * skickar: | ||
* auth_token | * auth_token | ||
Line 110: | Line 118: | ||
/** | /** | ||
* @file | * @file | ||
- | * Check if my turn. | + | * Check i my turn. |
*/ | */ | ||
Line 144: | Line 152: | ||
$op = $row_op[' | $op = $row_op[' | ||
- | // Decide whether or not it is my turn. | + | // Decide whether or not it is your turn to start new-turn. |
$my_turn = 0; | $my_turn = 0; | ||
- | if ($user_id == $game[' | + | if ($me == $op) { |
- | if ($me == $op) { | + | |
- | $my_turn = 1; | + | if (in_array($me, [0, 6, 12])) { |
+ | $my_turn = 1; | ||
+ | } | ||
} | } | ||
- | } | + | |
- | else { | + | if (in_array($op, [3, 9, 15])) { |
- | if ($op < $me) { | + | $my_turn = 1; |
- | $my_turn = 1; | + | } |
} | } | ||
- | } | ||
- | |||
- | if ($me == 18 && $op == 18) { | ||
- | $my_turn = 0; | ||
} | } | ||
Line 166: | Line 172: | ||
]; | ]; | ||
quiz_response($data); | quiz_response($data); | ||
- | |||
</ | </ |