diff options
| author | Cerapter <cerap@protonmail.com> | 2018-09-04 21:57:20 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-09-04 21:57:20 +0200 |
| commit | d0a6e081de9df220a1575bcd81056a04d79e9b42 (patch) | |
| tree | 9dc7db563129b100bbe3f39b93a47c8318db027c | |
| parent | 4f30afa51d84be5ea16911b7e4fbd545a87e24b3 (diff) | |
Blankpost filter is now more agressive + check for typing ' /' in OOC.
| -rw-r--r-- | server/aoprotocol.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/server/aoprotocol.py b/server/aoprotocol.py index 21b0daa8..4e725d05 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('<dollar>G') or self.client.name.startswith('<dollar>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() |
