geforkt von SteamWar/BungeeCore
Update some stuff
Dieser Commit ist enthalten in:
Ursprung
21a9dd858a
Commit
cbc1dd6505
@ -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)));
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren