Skip to content

Commit

Permalink
MultiServer: put some limits in place (ArchipelagoMW#3858)
Browse files Browse the repository at this point in the history
Co-authored-by: black-sliver <[email protected]>
  • Loading branch information
Berserker66 and black-sliver authored Sep 1, 2024
1 parent 6f46397 commit 3ab71da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions MultiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3ab71da

Please sign in to comment.