SteamWar/BungeeCore
Archiviert
13
2

Update some stuff

Dieser Commit ist enthalten in:
yoyosource 2022-04-01 10:55:29 +02:00
Ursprung 21a9dd858a
Commit cbc1dd6505
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -23,10 +23,7 @@ import com.google.common.io.ByteArrayDataInput;
import de.steamwar.bungeecore.ArenaMode;
import de.steamwar.bungeecore.comms.SpigotHandler;
import de.steamwar.bungeecore.comms.packets.FightEndsPacket;
import de.steamwar.bungeecore.sql.SchemElo;
import de.steamwar.bungeecore.sql.SchematicNode;
import de.steamwar.bungeecore.sql.SchematicType;
import de.steamwar.bungeecore.sql.UserElo;
import de.steamwar.bungeecore.sql.*;
import net.md_5.bungee.api.config.ServerInfo;
import java.util.List;
@ -66,6 +63,8 @@ public class FightEndsHandler implements SpigotHandler {
blueResult = 0;
}
// TODO: Implement hourly unranked when against same team maybe half hourly
int blueSchemElo = SchemElo.getElo(fightEndsPacket.getBlueSchem());
int redSchemElo = SchemElo.getElo(fightEndsPacket.getRedSchem());
@ -84,6 +83,7 @@ public class FightEndsHandler implements SpigotHandler {
double winTeamExpectation = 1 / (1 + Math.pow(10, (eloTeamEnemy - eloTeamOwn) / 600f));
for (int player : players) {
int playerElo = UserElo.getEloOrDefault(player, gameMode);
int fights = UserElo.getFightsOfSeason(player, gameMode);
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + K * (result - winTeamExpectation)));
}
}

Datei anzeigen

@ -56,7 +56,7 @@ public class UserElo {
}, userID, gameMode, Season.getSeason()));
}
private static int getFightsOfSeason(int userID, String gameMode) {
public static int getFightsOfSeason(int userID, String gameMode) {
return fightsOfSeason.select(rs -> {
if (rs.next())
return rs.getInt("Fights");