mirror of
https://github.com/Akomry/sae302_applicom.git
synced 2025-12-06 08:43:54 +00:00
feat(Event): 2.6.6: Gestion des déconnexions
This commit is contained in:
parent
1732a63a4a
commit
0b513c19bc
3 changed files with 14 additions and 5 deletions
|
|
@ -254,6 +254,9 @@ public class ChatServer {
|
|||
doListPost(event.getContent());
|
||||
LOGGER.info("Sending Posts");
|
||||
return true;
|
||||
} else if (event.getType().equals(Event.QUIT)) {
|
||||
LOGGER.info("Déconnexion");
|
||||
return false;
|
||||
} else {
|
||||
LOGGER.warning("Unhandled event type: " + event.getType());
|
||||
return false;
|
||||
|
|
@ -367,6 +370,8 @@ public class ChatServer {
|
|||
try {
|
||||
sock.close();
|
||||
removeClient(this);
|
||||
user.setConnected(false);
|
||||
sendEventToAllContacts(new Event(Event.CONT, user.toJsonObject()));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue