aboutsummaryrefslogtreecommitdiff
path: root/server/aoprotocol.py
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-08-13 14:39:09 +0200
committerCerapter <cerap@protonmail.com>2018-08-13 14:39:09 +0200
commit3712526ff0e4a715ea9548f331edfc43d1502eb9 (patch)
treef78792708d114cf45581fe9239674100d8a7a666 /server/aoprotocol.py
parent37c0a709488d6d8b3d8191f321098ea996d9cf70 (diff)
Added a HDID-based banning system.
Diffstat (limited to 'server/aoprotocol.py')
-rw-r--r--server/aoprotocol.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/aoprotocol.py b/server/aoprotocol.py
index 9bddb0a5..75ee824b 100644
--- a/server/aoprotocol.py
+++ b/server/aoprotocol.py
@@ -65,7 +65,7 @@ class AOProtocol(asyncio.Protocol):
buf = data
- if not self.client.is_checked and self.server.ban_manager.is_banned(self.client.ipid):
+ if not self.client.is_checked and (self.server.ban_manager.is_banned(self.client.ipid) or self.server.ban_manager.is_hdid_banned(self.client.hdid)):
self.client.transport.close()
else:
self.client.is_checked = True
@@ -165,6 +165,9 @@ class AOProtocol(asyncio.Protocol):
if not self.validate_net_cmd(args, self.ArgType.STR, needs_auth=False):
return
self.client.hdid = args[0]
+ if self.server.ban_manager.is_hdid_banned(self.client.hdid):
+ self.client.disconnect()
+ return
if self.client.hdid not in self.client.server.hdid_list:
self.client.server.hdid_list[self.client.hdid] = []
if self.client.ipid not in self.client.server.hdid_list[self.client.hdid]: