Archiviert
1
0

Merge pull request 'Add Replay WIPISCH' (#334) from Replay into master

Reviewed-on: SteamWar/BungeeCore#334
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-04-11 08:08:03 +02:00
Commit 4a0c50a08d

Datei anzeigen

@ -11,7 +11,7 @@ import java.util.stream.Collectors;
public class Fight {
private static final Statement getPage = new Statement("SELECT f.FightID, f.GameMode, f.Server, f.StartTime, f.BlueLeader, f.RedLeader, (b.NodeId IS NULL OR b.AllowReplay) AND (r.NodeId IS NULL OR r.AllowReplay) AS ReplayAllowed, f.Win, f.Replay IS NOT NULL AS ReplayExists FROM Fight f LEFT OUTER JOIN SchematicNode b ON f.BlueSchem = b.NodeId LEFT OUTER JOIN SchematicNode r ON f.RedSchem = r.NodeId ORDER BY FightID DESC LIMIT ?, ?");
private static final Statement getPage = new Statement("SELECT f.FightID, f.GameMode, f.Server, f.StartTime, f.BlueLeader, f.RedLeader, (b.NodeId IS NULL OR b.AllowReplay) AND (r.NodeId IS NULL OR r.AllowReplay) AS ReplayAllowed, f.Win, (SELECT COUNT(1) FROM Replay WHERE Replay.FightID = f.FightID) as ReplayAvailable FROM Fight f LEFT OUTER JOIN SchematicNode b ON f.BlueSchem = b.NodeId LEFT OUTER JOIN SchematicNode r ON f.RedSchem = r.NodeId ORDER BY FightID DESC LIMIT ?, ?");
private final int fightID;
private final String gameMode;
@ -22,8 +22,8 @@ public class Fight {
private final int redLeader;
private final int win;
private final boolean replayExists;
private final boolean replayAllowed;
private final boolean replayAvailable;
private final List<FightPlayer> bluePlayers = new ArrayList<>();
private final List<FightPlayer> redPlayers = new ArrayList<>();
@ -36,8 +36,8 @@ public class Fight {
blueLeader = rs.getInt("BlueLeader");
redLeader = rs.getInt("RedLeader");
replayAllowed = rs.getBoolean("ReplayAllowed");
replayAvailable = rs.getBoolean("ReplayAvailable");
win = rs.getInt("Win");
replayExists = rs.getBoolean("ReplayExists");
}
private void initPlayers(List<FightPlayer> fightPlayers) {
@ -118,6 +118,6 @@ public class Fight {
}
public boolean replayExists() {
return replayExists && getGameMode() != null;
return getGameMode() != null && replayAvailable;
}
}