Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpaceCheckers
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
Container 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
TDT4240-group23
SpaceCheckers
Merge requests
!6
added notification feature to commants
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
added notification feature to commants
dev2
into
dev
Overview
0
Commits
2
Pipelines
0
Changes
10
Merged
Petter Selfors Rølvåg
requested to merge
dev2
into
dev
4 years ago
Overview
0
Commits
2
Pipelines
0
Changes
10
Expand
0
0
Merge request reports
Compare
dev
version 1
3defe1c5
4 years ago
dev (base)
and
latest version
latest version
9d1f005f
2 commits,
4 years ago
version 1
3defe1c5
1 commit,
4 years ago
10 files
+
94
−
53
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
10
Search (e.g. *.vue) (Ctrl+P)
CheckersClient/core/src/com/mygdx/game/controllers/commands/cLobbyLeave.java
+
16
−
6
Options
@@ -12,12 +12,22 @@ public class cLobbyLeave extends Command{
@@ -12,12 +12,22 @@ public class cLobbyLeave extends Command{
@Override
@Override
public
void
execute
(
PlayerController
playerController
,
Connection
connection
){
public
void
execute
(
PlayerController
playerController
,
Connection
connection
){
if
(
data
instanceof
Integer
){
if
(
data
instanceof
Lobby
){
int
result
=
(
int
)
data
;
Lobby
lobby
=
(
Lobby
)
data
;
if
(
result
==
-
1
)
System
.
out
.
println
(
"Failed to leave lobby"
);
if
(
lobby
.
getID
()
!=
-
1
){
else
{
if
(
lobby
.
getPlayersID
().
contains
((
Integer
)
connection
.
getID
()))
{
playerController
.
setLobby
(
new
Lobby
(-
1
));
//Somebody else left
System
.
out
.
println
(
"Request to leave lobby successful"
);
System
.
out
.
println
(
"Somebody left the lobby"
);
playerController
.
setLobby
(
lobby
);
}
else
{
//The current player left
playerController
.
setLobby
(
new
Lobby
(-
1
));
System
.
out
.
println
(
"Request to leave lobby successful"
);
}
}
else
{
System
.
out
.
println
(
"Received leaveLobby command with an error"
);
}
}
}
}
}
}
Loading