From 758e10baff1743e82ca54f54c612e663297825c8 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 19 Jul 2020 15:30:29 +0200 Subject: [PATCH] Fix unplaced Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/commands/RankCommand.java | 5 ++++- src/de/steamwar/bungeecore/sql/Elo.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/RankCommand.java b/src/de/steamwar/bungeecore/commands/RankCommand.java index c68cc98..f745fde 100644 --- a/src/de/steamwar/bungeecore/commands/RankCommand.java +++ b/src/de/steamwar/bungeecore/commands/RankCommand.java @@ -29,7 +29,10 @@ public class RankCommand extends BasicCommand { int elo = Elo.getElo(user.getId(), mode.getSchemType()); int placement = Elo.getPlacement(user.getId(), mode.getSchemType()); - BungeeCore.send(player, "§e" + placement + "§8. §7mit §e" + elo + " §7Elo§8."); + if(placement == -1) + BungeeCore.send(player, "§7" + mode.getChatName() + "§8: §eunplatziert"); + else + BungeeCore.send(player, "§7" + mode.getChatName() + "§8: §e" + placement + "§8. §7mit §e" + elo + " §7Elo§8."); } } diff --git a/src/de/steamwar/bungeecore/sql/Elo.java b/src/de/steamwar/bungeecore/sql/Elo.java index 8c693e5..450b07a 100644 --- a/src/de/steamwar/bungeecore/sql/Elo.java +++ b/src/de/steamwar/bungeecore/sql/Elo.java @@ -22,7 +22,7 @@ public class Elo { ResultSet rs = SQL.select("SELECT COUNT(*) AS Place FROM Elo WHERE GameMode = ? AND Elo > ?", gameMode, elo); try{ if(!rs.next()) - throw new SecurityException("Could not get place"); + return -1; return rs.getInt("Place"); }catch(SQLException e){