Added the command /allow_blankposting
for CMs and mods to control blankposting.
This commit is contained in:
parent
c8b62267b9
commit
aee3099d9b
@ -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():
|
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")
|
self.client.send_host_message("Iniswap is blocked in this area")
|
||||||
return
|
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'):
|
if msg_type not in ('chat', '0', '1'):
|
||||||
return
|
return
|
||||||
if anim_type not in (0, 1, 2, 5, 6):
|
if anim_type not in (0, 1, 2, 5, 6):
|
||||||
|
@ -64,7 +64,7 @@ class AreaManager:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.is_locked = False
|
self.is_locked = False
|
||||||
|
self.blankposting_allowed = True
|
||||||
self.jukebox = jukebox
|
self.jukebox = jukebox
|
||||||
self.jukebox_votes = []
|
self.jukebox_votes = []
|
||||||
|
|
||||||
|
@ -89,7 +89,16 @@ def ooc_cmd_allow_iniswap(client, arg):
|
|||||||
client.send_host_message('iniswap is {}.'.format(answer[client.area.iniswap_allowed]))
|
client.send_host_message('iniswap is {}.'.format(answer[client.area.iniswap_allowed]))
|
||||||
return
|
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):
|
def ooc_cmd_roll(client, arg):
|
||||||
roll_max = 11037
|
roll_max = 11037
|
||||||
|
Loading…
Reference in New Issue
Block a user