SteamWar/BungeeCore
Archiviert
13
2

Hotfix TeamCommand.tp
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-05-12 23:29:28 +02:00
Ursprung 6848bac447
Commit 6ed534bcb3

Datei anzeigen

@ -53,10 +53,10 @@ public class FightEndsHandler extends PacketHandler {
@Handler
public void handle(FightEndsPacket fightEndsPacket) {
BungeeCore.get().getLogger().log(Level.INFO, fightEndsPacket.getWin() + " " + fightEndsPacket.getBlueSchem() + " " + fightEndsPacket.getRedSchem() + " " + fightEndsPacket.getBluePlayers() + " " + fightEndsPacket.getRedPlayers() + " " + fightEndsPacket.getGameMode() + " " + fightEndsPacket.getDuration());
if (!ArenaMode.getBySchemType(SchematicType.fromDB(fightEndsPacket.getGameMode())).isRanked()) {
return;
}
BungeeCore.get().getLogger().log(Level.INFO, fightEndsPacket.getWin() + " " + fightEndsPacket.getBlueSchem() + " " + fightEndsPacket.getRedSchem() + " " + fightEndsPacket.getBluePlayers() + " " + fightEndsPacket.getRedPlayers() + " " + fightEndsPacket.getGameMode() + " " + fightEndsPacket.getDuration());
boolean bluePublic = SchematicNode.getSchematicNode(fightEndsPacket.getBlueSchem()).getOwner() == 0;
boolean redPublic = SchematicNode.getSchematicNode(fightEndsPacket.getRedSchem()).getOwner() == 0;
@ -65,6 +65,8 @@ public class FightEndsHandler extends PacketHandler {
return;
}
BungeeCore.get().getLogger().log(Level.INFO, "After schematic public check");
// Die nächsten Zeilen filtern ein Fight innerhalb eines Teams nicht gewertet wird, bzw auch wenn nur Teile beider Teams im
// gleichen Team sind dieser ungewertet ist.
Set<Integer> teamsIds = fightEndsPacket.getBluePlayers().stream().map(SteamwarUser::get).map(SteamwarUser::getTeam).collect(Collectors.toSet());
@ -74,6 +76,8 @@ public class FightEndsHandler extends PacketHandler {
}
}
BungeeCore.get().getLogger().log(Level.INFO, "After Team check");
calcSchemElo(fightEndsPacket);
calcUserElo(fightEndsPacket);
}
@ -113,6 +117,7 @@ public class FightEndsHandler extends PacketHandler {
private void update(List<Integer> players, String gameMode, double factor) {
for (int player : players) {
BungeeCore.get().getLogger().log(Level.INFO, "Player: " + player + " Elo: " + UserElo.getEloOrDefault(player, gameMode) + " Factor: " + factor);
int playerElo = UserElo.getEloOrDefault(player, gameMode);
int eloGain = (int) Math.round(MEDIAN_ELO_GAIN * factor);
playerElo += eloGain;