diff --git a/config_sample/areas.yaml b/config_sample/areas.yaml index df5e1e550..50fb42c26 100644 --- a/config_sample/areas.yaml +++ b/config_sample/areas.yaml @@ -25,6 +25,9 @@ ## evidence_mod: FFA ## locking_allowed: false ## iniswap_allowed: true +## background: gs4 +## bglock: false +## custom_bg_allowed: true ## showname_changes_allowed: true ## shouts_allowed: true ## jukebox: false diff --git a/server/area_manager.py b/server/area_manager.py index 490e3ddaf..7962d5f30 100644 --- a/server/area_manager.py +++ b/server/area_manager.py @@ -37,8 +37,9 @@ def __init__(self, area_id, server, name, - background, - bg_lock, + background='gs4', + bg_lock=False, + custom_bg=True, evidence_mod='FFA', locking_allowed=False, iniswap_allowed=True, @@ -54,6 +55,7 @@ def __init__(self, self.name = name self.background = background self.bg_lock = bg_lock + self.custom_bg = custom_bg self.server = server self.music_looper = None self.next_message_time = 0 @@ -410,8 +412,7 @@ def change_background(self, bg: str): Raises: AreaError: if `bg` is not in background list """ - - if bg.lower() not in (name.lower() + if self.custom_bg == False or bg.lower() not in (name.lower() for name in self.server.backgrounds): raise AreaError('Invalid background name.') self.background = bg @@ -738,6 +739,12 @@ def load_areas(self): item['locking_allowed'] = False if 'iniswap_allowed' not in item: item['iniswap_allowed'] = True + if 'background' not in item: + item['background'] = 'gs4' + if 'bglock' not in item: + item['bglock'] = False + if 'custom_bg_allowed' not in item: + item['custom_bg_allowed'] = True if 'showname_changes_allowed' not in item: item['showname_changes_allowed'] = True if 'shouts_allowed' not in item: @@ -751,7 +758,7 @@ def load_areas(self): item['area']) self.areas.append( self.Area(self.cur_id, self.server, item['area'], - item['background'], item['bglock'], + item['background'], item['bglock'], item['custom_bg_allowed'], item['evidence_mod'], item['locking_allowed'], item['iniswap_allowed'], item['showname_changes_allowed'],