Skip to content

Commit

Permalink
New threshold for ddos
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Aug 21, 2024
1 parent b3074c4 commit 5c37e4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cogs/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class ServerInfo:

Packets = namedtuple('Packets', 'rx tx')

PPS_THRESHOLD = 30000 # china got a lot players
PPS_THRESHOLD = 100000 # china got a lot players
PPS_RATIO_MIN = 1000 # ratio is not reliable for low traffic
PPS_RATIO_THRESHOLD = 2.5 # responding to less than half the traffic indicates junk traffic

Expand Down Expand Up @@ -209,7 +209,7 @@ def __str__(self) -> str:

def is_under_attack(self) -> bool:
return self.packets.rx > self.PPS_THRESHOLD \
or self.packets.rx > self.PPS_RATIO_MIN and self.packets.rx / self.packets.tx > self.PPS_RATIO_THRESHOLD
or (self.packets.rx > self.PPS_RATIO_MIN and self.packets.rx / self.packets.tx > self.PPS_RATIO_THRESHOLD)

@property
def status(self) -> str:
Expand Down

0 comments on commit 5c37e4b

Please sign in to comment.