Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nirmalathasa_comp30023_2019_project-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Abhisha Nirmalathas
nirmalathasa_comp30023_2019_project-1
Commits
f3ca6eb9
Commit
f3ca6eb9
authored
6 years ago
by
Abhisha Nirmalathas
Browse files
Options
Downloads
Patches
Plain Diff
ensuring cleared cookies edge case hadnlign pt 2
parent
7869807a
Branches
Branches containing commit
No related tags found
2 merge requests
!2
Feat/cookie
,
!1
Feat/cookie
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
user.c
+6
-2
6 additions, 2 deletions
user.c
with
6 additions
and
2 deletions
user.c
+
6
−
2
View file @
f3ca6eb9
...
@@ -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
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment