diff options
| author | Cerapter <cerap@protonmail.com> | 2018-08-16 22:57:41 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-08-16 22:57:41 +0200 |
| commit | aee3099d9b1ce0fb1e2521612d8f4eb07b323e4a (patch) | |
| tree | fadc95d27b00cd27355129b256d5176ec4bdf976 | |
| parent | c8b62267b9b4481e4dd458ed9a4f76feb9863e63 (diff) | |
Added the command `/allow_blankposting` for CMs and mods to control blankposting.
| -rw-r--r-- | server/aoprotocol.py | 3 | ||||
| -rw-r--r-- | server/area_manager.py | 2 | ||||
| -rw-r--r-- | server/commands.py | 11 |
3 files changed, 14 insertions, 2 deletions
diff --git a/server/aoprotocol.py b/server/aoprotocol.py index 211bcff5..11d2fbd7 100644 --- a/server/aoprotocol.py +++ b/server/aoprotocol.py @@ -358,6 +358,9 @@ class AOProtocol(asyncio.Protocol): if self.client.area.is_iniswap(self.client, pre, anim, folder) and folder != self.client.get_char_name(): self.client.send_host_message("Iniswap is blocked in this area") return + if not self.client.area.blankposting_allowed and text == ' ': + self.client.send_host_message("Blankposting is forbidden in this area!") + return if msg_type not in ('chat', '0', '1'): return if anim_type not in (0, 1, 2, 5, 6): diff --git a/server/area_manager.py b/server/area_manager.py index e6b34a0a..583e149b 100644 --- a/server/area_manager.py +++ b/server/area_manager.py @@ -64,7 +64,7 @@ class AreaManager: """ self.is_locked = False - + self.blankposting_allowed = True self.jukebox = jukebox self.jukebox_votes = [] diff --git a/server/commands.py b/server/commands.py index d952d15a..d1f145d3 100644 --- a/server/commands.py +++ b/server/commands.py @@ -89,7 +89,16 @@ def ooc_cmd_allow_iniswap(client, arg): client.send_host_message('iniswap is {}.'.format(answer[client.area.iniswap_allowed])) return - +def ooc_cmd_allow_blankposting(client, arg): + if not client.is_mod and not client.is_cm: + raise ClientError('You must be authorized to do that.') + client.area.blankposting_allowed = not client.area.blankposting_allowed + answer = {True: 'allowed', False: 'forbidden'} + if client.is_cm: + client.area.send_host_message('The CM has set blankposting in the area to {}.'.format(answer[client.area.blankposting_allowed])) + else: + client.area.send_host_message('A mod has set blankposting in the area to {}.'.format(answer[client.area.blankposting_allowed])) + return def ooc_cmd_roll(client, arg): roll_max = 11037 |
