Show eventfights as finished immediatly
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
1bc5011d4f
Commit
eb8a8a2e07
@ -29,7 +29,6 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -100,7 +99,6 @@ public class EventCommand extends BasicCommand {
|
||||
Message.send("EVENT_USAGE", player);
|
||||
|
||||
List<EventFight> fights = EventFight.getEvent(currentEvent.getEventID());
|
||||
Instant now = Instant.now();
|
||||
|
||||
Message.send("EVENT_CURRENT_EVENT", player, currentEvent.getEventName());
|
||||
|
||||
@ -111,7 +109,7 @@ public class EventCommand extends BasicCommand {
|
||||
StringBuilder fline = new StringBuilder(Message.parse("EVENT_CURRENT_FIGHT", player, fight.getStartTime().toLocalDateTime().format(timeFormat), blue.getTeamColor(), blue.getTeamKuerzel(),
|
||||
red.getTeamColor(), red.getTeamKuerzel()));
|
||||
|
||||
if(now.isAfter(fight.getStartTime().toInstant().plus(35, ChronoUnit.MINUTES))){
|
||||
if(fight.hasFinished()){
|
||||
switch(fight.getErgebnis()){
|
||||
case 1:
|
||||
fline.append(Message.parse("EVENT_CURRENT_FIGHT_WIN", player, blue.getTeamColor(), blue.getTeamKuerzel()));
|
||||
|
@ -45,6 +45,7 @@ public class EventFight implements Comparable<EventFight> {
|
||||
private final int teamRed;
|
||||
private final int kampfleiter;
|
||||
private final int ergebnis;
|
||||
private final int fight;
|
||||
|
||||
private EventFight(ResultSet rs) throws SQLException {
|
||||
eventID = rs.getInt("EventID");
|
||||
@ -56,6 +57,7 @@ public class EventFight implements Comparable<EventFight> {
|
||||
teamRed = rs.getInt("TeamRed");
|
||||
kampfleiter = rs.getInt("Kampfleiter");
|
||||
ergebnis = rs.getInt("Ergebnis");
|
||||
fight = rs.getInt("Fight");
|
||||
}
|
||||
|
||||
public void reschedule(){
|
||||
@ -122,6 +124,10 @@ public class EventFight implements Comparable<EventFight> {
|
||||
return ergebnis;
|
||||
}
|
||||
|
||||
public boolean hasFinished() {
|
||||
return fight != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode(){
|
||||
return fightID;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren