Skip to content
Snippets Groups Projects
Commit 8bf521b7 authored by Schuh Martin's avatar Schuh Martin
Browse files

Update Persistence.java

parent 03547f2f
No related branches found
No related tags found
5 merge requests!74V1,!73Initial commit,!71Merge DataBase into Development,!27Player can now place bombs that have a explosion radius that dont go through the wall.,!24Player can now place bombs that have a explosion radius that dont go through the wall.
......@@ -465,25 +465,16 @@ public class Persistence {
try {
String hash = HashGenerator.hashAndHex(password);
if (hash.equals(db.checkCredentials(userName))) {
PlayerAccount playerAccount = new PlayerAccount(userName, hash, AccountType.ONLINE);
gsonHandler.saveAccount(playerAccount);
gsonHandler.loadAccount();
db.getStatistics(userName);
Parser.playerStatsValid(statistics);
account = new PlayerAccount(userName, hash, AccountType.ONLINE);
gsonHandler.saveAccount(account);
log.info("Login successful!");
} else {
throw new DatabaseException();
throw new DatabaseException("Wrong password!");
}
}
catch (GSONException | SQLException e) {
throw new RuntimeException(e);
}
catch (DatabaseException e) {
throw new DatabaseException("Wrong password!");
}
catch (ParserException e) {
throw new DatabaseException("Player statistics data corrupted!");
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment