From 3ab71daa8d14bfc4d83836c185a48692cbeaf518 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 1 Sep 2024 21:59:37 +0200 Subject: [PATCH] MultiServer: put some limits in place (#3858) Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com> --- MultiServer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MultiServer.py b/MultiServer.py index fb539f56713b..e0b137fd68ce 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1221,6 +1221,10 @@ def _cmd_countdown(self, seconds: str = "10") -> bool: timer = int(seconds, 10) except ValueError: timer = 10 + else: + if timer > 60 * 60: + raise ValueError(f"{timer} is invalid. Maximum is 1 hour.") + async_start(countdown(self.ctx, timer)) return True @@ -2057,6 +2061,8 @@ def _cmd_send_multiple(self, amount: typing.Union[int, str], player_name: str, * item_name, usable, response = get_intended_text(item_name, names) if usable: amount: int = int(amount) + if amount > 100: + raise ValueError(f"{amount} is invalid. Maximum is 100.") new_items = [NetworkItem(names[item_name], -1, 0) for _ in range(int(amount))] send_items_to(self.ctx, team, slot, *new_items)