diff --git a/src/main/java/de/exodus_hn/excalibur_tour/controller/CodeController.java b/src/main/java/de/exodus_hn/excalibur_tour/controller/CodeController.java index ae2fae8..7a3540f 100644 --- a/src/main/java/de/exodus_hn/excalibur_tour/controller/CodeController.java +++ b/src/main/java/de/exodus_hn/excalibur_tour/controller/CodeController.java @@ -51,16 +51,18 @@ public class CodeController { t.setActivationTimestamp(now); tourCodeService.updateCode(t); } else if (activationTimestamp.plus(12, ChronoUnit.HOURS).isBefore(now)) { + logger.warning("Tour " + t.getCode() + " expired"); return ResponseEntity.notFound().build(); } LocalDateTime heartbeat = t.getLastHeartbeatTimestamp(); if (heartbeat != null && heartbeat.plus(3, ChronoUnit.MINUTES).isAfter(now)) { + logger.warning("Tour " + t.getCode() + " was tried to be accessed."); return ResponseEntity.notFound().build(); } t.setLastHeartbeatTimestamp(now); tourCodeService.updateCode(t); TourSession tourSession = tourSessionService.getSessionByTourCode(t); - logger.info("Tour: " + t.getCode() + " started playing with Session " + tourSession); + logger.info("Tour " + t.getCode() + " started playing with Session " + tourSession); return ResponseEntity.ok( GetSessionAndAllRiddleData.builder() .riddles(riddleService.getAllRiddles().stream() @@ -93,7 +95,7 @@ public class CodeController { } if (t == null) { t = tourCodeService.addTourCode(code); - System.out.println("DEBUG: Created TC " + t.getId()); + logger.info("Created TC " + t.getId()); return ResponseEntity.ok(t.getCode()); } return ResponseEntity.badRequest().body("BAD: " + t.getId()); diff --git a/src/main/java/de/exodus_hn/excalibur_tour/controller/SessionController.java b/src/main/java/de/exodus_hn/excalibur_tour/controller/SessionController.java index cf4c4f2..49a7565 100644 --- a/src/main/java/de/exodus_hn/excalibur_tour/controller/SessionController.java +++ b/src/main/java/de/exodus_hn/excalibur_tour/controller/SessionController.java @@ -32,7 +32,7 @@ public class SessionController { } TourSession session = tourSessionService.getSessionByTourCode(code); if (session == null || !session.getTourCode().getActivated()) { - System.out.println("Session not found for " + code); + logger.info("Session not found for " + code); return "Not available"; } return String.format("%s", session.getData());