diff --git a/src/main/java/app/controllers/admin/RconController.java b/src/main/java/app/controllers/admin/RconController.java index 0c9f55c..eff6609 100644 --- a/src/main/java/app/controllers/admin/RconController.java +++ b/src/main/java/app/controllers/admin/RconController.java @@ -12,11 +12,16 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + @RestController @RequestMapping("api/admin/rcon") public class RconController { StatsService statsService; + private List blockList = List.of(new String[]{"sm_ban", "ban", "sm_unban", "unban"}); @Autowired public RconController(StatsService statsService) { @@ -31,6 +36,8 @@ public class RconController { public ResponseEntity rcon(HttpServletRequest request, @RequestParam String srv, @RequestParam String command) { + if (blockList.contains(Arrays.stream(command.split(" ")).limit(1).findFirst().orElse(""))) + return new ResponseEntity<>("banned", HttpStatus.OK); return new ResponseEntity<>(statsService.rconExecute(srv, command), HttpStatus.OK); } }