diff --git a/server/aoprotocol.py b/server/aoprotocol.py index 211bcff..11d2fbd 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 e6b34a0..583e149 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 d952d15..d1f145d 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