Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
WIMMA Lab 2019
Overflow
ehasa-backend
Commits
3d0060de
Commit
3d0060de
authored
5 years ago
by
Ronnie Friman
Browse files
Options
Downloads
Patches
Plain Diff
moved mockdata scoreticks
parent
4a16057a
No related branches found
No related tags found
3 merge requests
!59
Development to master
,
!54
Development to testing
,
!50
Mockdata replay
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/replay/replay.service.ts
+6
-7
6 additions, 7 deletions
src/replay/replay.service.ts
with
6 additions
and
7 deletions
src/replay/replay.service.ts
+
6
−
7
View file @
3d0060de
...
...
@@ -57,7 +57,7 @@ export class ReplayService {
async
replayData
(
gameId
)
{
//
// this block returs all player data from the game
// this block retur
n
s all player data from the game
//
let
playerdata
=
await
this
.
trackingRepository
.
find
({
where
:
{
game
:
gameId
},
...
...
@@ -78,7 +78,7 @@ export class ReplayService {
}),
);
//
// this block return all faction data from the game
// this block return
s
all faction data from the game
//
let
factions
=
await
this
.
factionRepository
.
find
({
game
:
gameId
});
let
currentFactions
=
factions
.
map
(
faction
=>
{
...
...
@@ -111,7 +111,6 @@ export class ReplayService {
);
}),
);
console
.
log
(
currentScore
);
return
{
players
:
currentdata
,
...
...
@@ -137,6 +136,7 @@ export class ReplayService {
const
LAT
=
62.24147
;
const
LNG
=
25.72088
;
// set the score tick amount
// not used at the moment
const
SCORE_TICKS
=
10
;
// setup the arrays for users, gamepersons and groups
const
users
=
[];
...
...
@@ -195,6 +195,9 @@ export class ReplayService {
for
(
let
i
=
1
;
i
<
USER_LOCATIONS
+
1
;
i
++
)
{
let
date
:
number
=
Date
.
now
();
let
x
=
1
;
// score ticks with players to sync them
await
this
.
scoreService
.
scoreTick
(
gameId
);
// add location entry for each gameperson
await
Promise
.
all
(
gamepersons
.
map
(
async
gameperson
=>
{
// format player locations with x-modifier that same factions are closer to each other
...
...
@@ -214,10 +217,6 @@ export class ReplayService {
}),
);
}
// generate x-amount of score tick
for
(
let
i
=
0
;
i
<
SCORE_TICKS
;
i
++
)
{
await
this
.
scoreService
.
scoreTick
(
gameId
);
}
return
{
message
:
'
all done
'
,
...
...
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