summaryrefslogtreecommitdiff
path: root/security.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-31 11:09:06 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-31 11:09:06 -0300
commitb34aa7437e55577953a50b6a0e65debcb930f253 (patch)
tree11db0c47a2f6772644bf133ed7155746a197293e /security.py
parentc67dcb3dbaf3efb888d25e6c17f4d62b9ccedc12 (diff)
downloadserver-b34aa7437e55577953a50b6a0e65debcb930f253.tar.gz
server-b34aa7437e55577953a50b6a0e65debcb930f253.tar.bz2
server-b34aa7437e55577953a50b6a0e65debcb930f253.tar.xz
server-b34aa7437e55577953a50b6a0e65debcb930f253.zip
Registration failure now only gives 2 lame points.
This means each connection can attempt up to three registrations. Raise to 3 in case of attack :p
Diffstat (limited to 'security.py')
-rw-r--r--security.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/security.py b/security.py
index 59a3efc..112f636 100644
--- a/security.py
+++ b/security.py
@@ -84,6 +84,17 @@ def unban_ip(ip):
stdout("%s is not banned." % (ip))
return
+def get_score(proto):
+ if (proto == PACKET_REGX):
+ return 2
+ elif proto == PACKET_NACK:
+ return 5
+ elif proto == PACKET_ACK:
+ return 0
+ else
+ stdout("\"%s\" is not a valid packet reply code" % str(proto))
+ return 0
+
def score(conn, score):
#print("Score request: %d" % score)
conn.MS_score += score