Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Progark gruppe 3
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
Container Registry
Model registry
Operate
Environments
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
Tobias Ingebrigt Ørstad
Progark gruppe 3
Merge requests
!103
Made sure players can only join tournaments that have not gone past the starttime
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Made sure players can only join tournaments that have not gone past the starttime
95-backend-cleanup
into
dev
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Tobias Ingebrigt Ørstad
requested to merge
95-backend-cleanup
into
dev
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#95 (closed)
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
b76fd9a7
1 commit,
5 years ago
1 file
+
13
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
backend/api/tournament.js
+
13
−
0
Options
@@ -220,6 +220,8 @@ router.post("/join", (req, res) => {
active
:
true
,
// the array of players cannot already contain the player
players
:
{
$nin
:
[
playerId
]
},
// we dont want tournaments that have gone past their starttime
startTime
:
{
$gte
:
new
Date
()
},
},
// Add the player to the array
{
@@ -500,6 +502,17 @@ function roundcheck(client, tournament) {
//if there are less then two people left in the first round, or zero people left in the first round
//the tournament ends
}
if
(
rounds
.
length
>
0
)
{
// If there is only one player in the tournaments first round and the starttime
// has expired, we end the tournament
if
(
left
.
length
<
2
&&
active
==
1
&&
new
Date
(
start
)
<
new
Date
()
)
{
end
=
true
;
}
}
functions
.
timeOut
(
client
,
tournament
,
timedOut
,
timedOutRounds
)
.
then
(
Loading