diff --git a/CommonCore/SQL/src/de/steamwar/sql/EventFight.java b/CommonCore/SQL/src/de/steamwar/sql/EventFight.java index 4143c596..e26e641c 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/EventFight.java +++ b/CommonCore/SQL/src/de/steamwar/sql/EventFight.java @@ -41,7 +41,7 @@ public class EventFight implements Comparable { private static final SelectStatement byGroupLast = new SelectStatement(table, "SELECT * FROM EventFight WHERE GroupID = ? ORDER BY StartTime DESC LIMIT 1"); private static final SelectStatement allComing = new SelectStatement<>(table, "SELECT * FROM EventFight WHERE StartTime > now() ORDER BY StartTime ASC"); private static final SelectStatement event = new SelectStatement<>(table, "SELECT * FROM EventFight WHERE EventID = ? ORDER BY StartTime ASC"); - private static final SelectStatement activeFights = new SelectStatement<>(table, "SELECT * FROM EventFight WHERE Fight IS NOT NULL AND StartTime < now() AND DATEDIFF(StartTime, now()) < 0"); + private static final SelectStatement activeFights = new SelectStatement<>(table, "SELECT * FROM EventFight WHERE EventID IN (SELECT EventID FROM Event WHERE Start < now() and End > now()) AND Fight IS NULL AND StartTime < now()"); private static final Statement reschedule = table.update(Table.PRIMARY, "StartTime"); private static final Statement setResult = table.update(Table.PRIMARY, "Ergebnis"); private static final Statement setFight = table.update(Table.PRIMARY, "Fight"); diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java index d5f188c2..7777408e 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/EventModeListener.java @@ -103,7 +103,6 @@ public class EventModeListener extends BasicListener { if (activeFights.stream() .noneMatch(fight -> fight.getTeamRed() == user.getTeam() || fight.getTeamBlue() == user.getTeam())) { - player.storeCookie(EVENT_TO_SPECTATE_KEY, "TRUE".getBytes()); player.transferToHost(new InetSocketAddress("steamwar.de", 25565)); } }