Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin DRUAULT-AUBIN
lo23-project
Commits
0eeadfea
Commit
0eeadfea
authored
Jan 02, 2018
by
Thibault Chiche
Browse files
[Com] modif leaveGame
parent
a9b7e8e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Battleship/src/main/java/com/utclo23/com/ComFacade.java
View file @
0eeadfea
...
...
@@ -158,13 +158,14 @@ public class ComFacade {
}
/**
* Called to send "leave game" notification to everybody.
* Called to send "leave game" notification to all users in the game.
* @param recipients: receivers of the notification
*/
public
void
leaveGame
()
{
public
void
leaveGame
(
List
<
LightPublicUser
>
recipients
)
{
M_LeaveGame
mLeaveGame
=
new
M_LeaveGame
(
iDataCom
.
getMyPublicUserProfile
());
for
(
Inet4Address
ip
:
kIpCtrl
.
getHashMap
().
values
())
{
if
(
ip
!=
null
)
{
Sender
os
=
new
Sender
(
ip
.
getHostAddress
(),
kIpCtrl
.
getPort
(),
mLeaveGame
);
for
(
LightPublicUser
recipient
:
recipients
)
{
if
(
kIpCtrl
.
getHashMap
().
get
(
recipient
.
getId
())
!=
null
)
{
Sender
os
=
new
Sender
(
kIpCtrl
.
getHashMap
().
get
(
recipient
.
getId
())
.
getHostAddress
(),
kIpCtrl
.
getPort
(),
mLeaveGame
);
new
Thread
(
os
).
start
();
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment