Commit 4d1f9a13 authored by Peining's avatar Peining
Browse files

Merge branch 'develop' of https://gitlab.utc.fr/qdruault/lo23-project into develop

modify functions about statistics
parents 95681eb2 969f928b
......@@ -284,7 +284,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
@Override
public void leaveGame() {
String role = this.gameMediator.getOwnerStatus();
if (!role.equals("spectator") && this.gameMediator.getCurrentGame()!=null) {
if (!role.equals("spectator") && this.gameMediator.getCurrentGame() != null) {
Logger.getLogger(DataFacade.class.getName()).log(Level.INFO, null, "data | leave game");
this.comfacade.leaveGame(this.gameMediator.getCurrentGame().getRecipients(this.getMyPublicUserProfile().getPlayerName()));
......@@ -308,7 +308,6 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
public void opponentHasLeftGame() {
Logger.getLogger(DataFacade.class.getName()).info("data | opponent has left");
if (!this.gameMediator.isFinishedGame()) {
try {
this.gameMediator.defWin();
......@@ -321,8 +320,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
}
@Override
public void removeGame(String id)
{
public void removeGame(String id) {
this.gameMediator.removeGame(id);
}
......@@ -426,6 +424,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
public PublicUser getMyPublicUserProfile() {
PublicUser usr = this.userMediator.getMyPublicUserProfile();
if (usr != null) {
try {
usr.setNumberDefeatsClassic(this.getNumberDefeatsClassic());
......@@ -435,6 +434,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain {
} catch (DataException ex) {
Logger.getLogger(DataFacade.class.getName()).log(Level.SEVERE, null, ex);
}
}
return usr;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment