Fix ranked player does not join arena #277
@ -94,6 +94,10 @@ public class FightTeam implements IFightTeam{
|
||||
team.setAllowFriendlyFire(false);
|
||||
}
|
||||
|
||||
public UUID getDesignatedLeader(){
|
||||
return designatedLeader;
|
||||
}
|
||||
|
||||
public Region getSchemRegion() {
|
||||
return schemRegion;
|
||||
}
|
||||
|
@ -50,12 +50,8 @@ public class FightStatistics {
|
||||
public static void saveStats(FightTeam winner, String windescription){
|
||||
String gameMode = Config.SchematicType.toDB();
|
||||
|
||||
int blueLeader = 0;
|
||||
int redLeader = 0;
|
||||
if(Fight.getBlueTeam().getLeader() != null)
|
||||
blueLeader = SteamwarUser.get(Fight.getBlueTeam().getLeader().getPlayer().getUniqueId()).getId();
|
||||
if(Fight.getRedTeam().getLeader() != null)
|
||||
redLeader = SteamwarUser.get(Fight.getRedTeam().getLeader().getPlayer().getUniqueId()).getId();
|
||||
int blueLeader = getLeader(Fight.getBlueTeam());
|
||||
int redLeader = getLeader(Fight.getRedTeam());
|
||||
|
||||
int win = 0;
|
||||
double blueResult;
|
||||
@ -109,11 +105,19 @@ public class FightStatistics {
|
||||
int newRedElo = (int) Math.round(redElo + K * (1 - blueResult - redWinExpectation));
|
||||
Elo.setElo(blueLeader, gameMode, newBlueElo);
|
||||
Elo.setElo(redLeader, gameMode, newRedElo);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getBlueTeam().getPrefix() + Fight.getBlueTeam().getLeader().getPlayer().getName() + "§8: §7" + blueElo + "§8»§e" + newBlueElo);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getRedTeam().getPrefix() + Fight.getRedTeam().getLeader().getPlayer().getName() + "§8: §7" + redElo + "§8»§e" + newRedElo);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getBlueTeam().getPrefix() + SteamwarUser.get(blueLeader).getUserName() + "§8: §7" + blueElo + "§8»§e" + newBlueElo);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§7ELO von " + Fight.getRedTeam().getPrefix() + SteamwarUser.get(redLeader).getUserName() + "§8: §7" + redElo + "§8»§e" + newRedElo);
|
||||
}
|
||||
}
|
||||
|
||||
private static int getLeader(FightTeam team){
|
||||
if(team.getLeader() != null)
|
||||
return SteamwarUser.get(team.getLeader().getPlayer().getUniqueId()).getId();
|
||||
else if(team.getDesignatedLeader() != null)
|
||||
return SteamwarUser.get(team.getDesignatedLeader()).getId();
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void savePlayerStats(FightPlayer fp, int fightId){
|
||||
SteamwarUser user = SteamwarUser.get(fp.getPlayer().getUniqueId());
|
||||
de.steamwar.sql.FightPlayer.create(fightId, user.getId(), fp.getTeam().isBlue(), fp.getKit().getName(), fp.getKills(), !fp.isLiving());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren