From d0a6e081de9df220a1575bcd81056a04d79e9b42 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Tue, 4 Sep 2018 21:57:20 +0200 Subject: [PATCH] Blankpost filter is now more agressive + check for typing ' /' in OOC. --- server/aoprotocol.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/server/aoprotocol.py b/server/aoprotocol.py index 21b0daa..4e725d0 100644 --- a/server/aoprotocol.py +++ b/server/aoprotocol.py @@ -376,9 +376,16 @@ class AOProtocol(asyncio.Protocol): if len(self.client.charcurse) > 0 and folder != self.client.get_char_name(): self.client.send_host_message("You may not iniswap while you are charcursed!") return - if not self.client.area.blankposting_allowed and text == ' ': - self.client.send_host_message("Blankposting is forbidden in this area!") - return + if not self.client.area.blankposting_allowed: + if text == ' ': + self.client.send_host_message("Blankposting is forbidden in this area!") + return + if text.isspace(): + self.client.send_host_message("Blankposting is forbidden in this area, and putting more spaces in does not make it not blankposting.") + return + if len(text.replace(' ', '')) < 3 and text != '<' and text != '>': + self.client.send_host_message("While that is not a blankpost, it is still pretty spammy. Try forming sentences.") + return if msg_type not in ('chat', '0', '1'): return if anim_type not in (0, 1, 2, 5, 6): @@ -501,6 +508,9 @@ class AOProtocol(asyncio.Protocol): if self.client.name.startswith(self.server.config['hostname']) or self.client.name.startswith('G') or self.client.name.startswith('M'): self.client.send_host_message('That name is reserved!') return + if args[1].startswith(' /'): + self.client.send_host_message('Your message was not sent for safety reasons: you left a space before that slash.') + return if args[1].startswith('/'): spl = args[1][1:].split(' ', 1) cmd = spl[0].lower()