Skip to content
Snippets Groups Projects
Commit f3ca6eb9 authored by Abhisha Nirmalathas's avatar Abhisha Nirmalathas
Browse files

ensuring cleared cookies edge case hadnlign pt 2

parent 7869807a
Branches
No related tags found
2 merge requests!2Feat/cookie,!1Feat/cookie
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "user.h" #include "user.h"
// implementation specific constants for users // implementation specific constants for users
#define INITIAL_KEYWORDS 5 #define INITIAL_KEYWORDS 20
#define INITAL_N_USERS 10 #define INITAL_N_USERS 10
#define INITIAL_KEYWORD_LENGTH 30 #define INITIAL_KEYWORD_LENGTH 30
...@@ -135,16 +135,20 @@ bool players_ready(User_list* user_list){ ...@@ -135,16 +135,20 @@ bool players_ready(User_list* user_list){
/** /**
* checks if all players are ready * checks if all players are ready
* */ * */
int count =0;
for(int i=0; i < user_list->n_users; i++){ for(int i=0; i < user_list->n_users; i++){
// other player is not ready // other player is not ready
if (user_list->users[i]->status != READY){ if (user_list->users[i]->status != READY){
return false; count++;
} }
// only one player, need to wait // only one player, need to wait
else if (user_list->n_users == 1){ else if (user_list->n_users == 1){
return false; return false;
} }
} }
if(count + 1 == user_list->n_users){
return false;
}
return true; return true;
} }
void change_player_status(int user_id, User_list* user_list, STATUS status){ void change_player_status(int user_id, User_list* user_list, STATUS status){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment