From a4894bc8df282ec7e58dc87dddd2b67abc122988 Mon Sep 17 00:00:00 2001 From: gsd Date: Sun, 12 Mar 2023 18:51:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B4=D0=B0=20=D0=BF=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/app/controllers/admin/BanController.java | 3 +++ src/main/java/app/controllers/admin/KickController.java | 2 ++ src/main/java/app/controllers/admin/RconController.java | 2 ++ src/main/java/app/controllers/user/ProfileController.java | 1 + .../java/app/exceptions/handler/GlobalExceptionAdvice.java | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/app/controllers/admin/BanController.java b/src/main/java/app/controllers/admin/BanController.java index a6b5e70..ec4fe46 100644 --- a/src/main/java/app/controllers/admin/BanController.java +++ b/src/main/java/app/controllers/admin/BanController.java @@ -4,6 +4,7 @@ import app.annotations.enums.AuthMethod; import app.annotations.interfaces.BurstUpdatePlayers; import app.annotations.interfaces.CheckPermitionFlag; import app.annotations.interfaces.CheckWebAccess; +import app.annotations.interfaces.WaitAfterNext; import app.entities.db.Ban; import app.services.ProfileService; import app.services.db.BanService; @@ -37,6 +38,7 @@ public class BanController { @CheckWebAccess @CheckPermitionFlag(flag = "d") @BurstUpdatePlayers + @WaitAfterNext public ResponseEntity banPlayer( HttpServletRequest request, @CookieValue(value = "steam64") String admin_steam64, @@ -55,6 +57,7 @@ public class BanController { @DeleteMapping @CheckWebAccess @CheckPermitionFlag(flag = "e") + @WaitAfterNext public ResponseEntity unbanPlayer( HttpServletRequest request, @CookieValue(value = "steam64") String admin_steam64, diff --git a/src/main/java/app/controllers/admin/KickController.java b/src/main/java/app/controllers/admin/KickController.java index 98de5d0..1b74300 100644 --- a/src/main/java/app/controllers/admin/KickController.java +++ b/src/main/java/app/controllers/admin/KickController.java @@ -3,6 +3,7 @@ package app.controllers.admin; import app.annotations.interfaces.BurstUpdatePlayers; import app.annotations.interfaces.CheckPermitionFlag; import app.annotations.interfaces.CheckWebAccess; +import app.annotations.interfaces.WaitAfterNext; import app.entities.PlayerProfile; import app.services.ProfileService; import app.services.ServerService; @@ -36,6 +37,7 @@ public class KickController { @CheckWebAccess @CheckPermitionFlag(flag = "c") @BurstUpdatePlayers + @WaitAfterNext public ResponseEntity kickPlayer( HttpServletRequest request, @CookieValue(value = "steam64") String steam64, diff --git a/src/main/java/app/controllers/admin/RconController.java b/src/main/java/app/controllers/admin/RconController.java index bc48f48..e0fbb09 100644 --- a/src/main/java/app/controllers/admin/RconController.java +++ b/src/main/java/app/controllers/admin/RconController.java @@ -2,6 +2,7 @@ package app.controllers.admin; import app.annotations.interfaces.CheckPermitionFlag; import app.annotations.interfaces.CheckWebAccess; +import app.annotations.interfaces.WaitAfterNext; import app.services.StatsService; import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +24,7 @@ public class RconController { @PostMapping @CheckWebAccess @CheckPermitionFlag(flag = "m") + @WaitAfterNext public ResponseEntity rcon(HttpServletRequest request, @RequestParam String srv, @RequestParam String command) { diff --git a/src/main/java/app/controllers/user/ProfileController.java b/src/main/java/app/controllers/user/ProfileController.java index 000515f..850397d 100644 --- a/src/main/java/app/controllers/user/ProfileController.java +++ b/src/main/java/app/controllers/user/ProfileController.java @@ -40,6 +40,7 @@ public class ProfileController { @GetMapping @CheckWebAccess @BurstUpdatePlayers + @WaitAfterNext public ResponseEntity GetCurrentUser(HttpServletRequest request, @CookieValue(value = "steam64", defaultValue = "") String steam64, @RequestParam(value = "requests", defaultValue = "") String requests diff --git a/src/main/java/app/exceptions/handler/GlobalExceptionAdvice.java b/src/main/java/app/exceptions/handler/GlobalExceptionAdvice.java index 90b29ed..5148744 100644 --- a/src/main/java/app/exceptions/handler/GlobalExceptionAdvice.java +++ b/src/main/java/app/exceptions/handler/GlobalExceptionAdvice.java @@ -42,6 +42,6 @@ public class GlobalExceptionAdvice { @ExceptionHandler(WaitRateLimit.class) public ResponseEntity handWaitRateLimit(){ - return new ResponseEntity<>("wait current before call this", HttpStatus.FORBIDDEN); + return new ResponseEntity<>("wait current before call this", HttpStatus.TOO_MANY_REQUESTS); } }