Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
Web Games
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
atm2g19
Web Games
Commits
7634a71b
Commit
7634a71b
authored
5 years ago
by
atm2g19
Browse files
Options
Downloads
Patches
Plain Diff
minor bugfix:
undefined player id from socket
parent
8a4b4533
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/games/battleships.ts
+1
-0
1 addition, 0 deletions
src/games/battleships.ts
with
1 addition
and
0 deletions
src/games/battleships.ts
+
1
−
0
View file @
7634a71b
...
@@ -335,6 +335,7 @@ const battleships : GameConstructor = class battleships implements Game{
...
@@ -335,6 +335,7 @@ const battleships : GameConstructor = class battleships implements Game{
leave
(
sock_id
:
string
){
leave
(
sock_id
:
string
){
let
player
=
this
.
getPlayer
(
sock_id
);
let
player
=
this
.
getPlayer
(
sock_id
);
if
(
!
player
)
return
;
this
.
players
=
this
.
players
.
filter
(
p
=>
p
==
player
?
0
:
1
);
this
.
players
=
this
.
players
.
filter
(
p
=>
p
==
player
?
0
:
1
);
let
game_id
=
player
.
game_id
;
let
game_id
=
player
.
game_id
;
this
.
db
.
query
(
`SELECT data_key, data_value FROM game_data WHERE game_id =
${
game_id
}
AND data_key = 0;`
)
this
.
db
.
query
(
`SELECT data_key, data_value FROM game_data WHERE game_id =
${
game_id
}
AND data_key = 0;`
)
...
...
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