def setup(): config = PluginConfig("banner") default_timeout = config.getOption("Config", "default_timeout", 180000) for option in config.getAllOptions("Banners"): msg = option[1] delay = config.getOption("Timeouts", option[0], default_timeout, False) banners.append(Banner(msg, int(delay))) info_msg[0] = string.Template(config.getOption("Config", "serverinfo", "XSBS Version 2.0")).substitute(colordict) del config
def setup(): config = PluginConfig('banner') default_timeout = config.getOption('Config', 'default_timeout', 180000) for option in config.getAllOptions('Banners'): msg = option[1] delay = config.getOption('Timeouts', option[0], default_timeout, False) banners.append(Banner(msg, int(delay))) info_msg[0] = string.Template( config.getOption('Config', 'serverinfo', 'XSBS Version 2.0')).substitute(colordict) del config
from xsbs.events import registerServerEventHandler, triggerServerEvent from xsbs.settings import PluginConfig from xsbs.game import modes from xsbs.ui import error, info from xsbs.colors import colordict from xsbs.commands import registerCommandHandler import logging import sbserver import string config = PluginConfig('maprotation') preset_rotation = config.getOption('Config', 'use_preset_rotation', 'yes') == 'yes' start_mode = config.getOption('Config', 'start_mode', 'ffa') nextmap_response = config.getOption('Config', 'nextmap_response', 'The next map is ${blue}${mapname}') map_modes = config.getAllOptions('Maps') del config nextmap_response = string.Template(nextmap_response) class Map: def __init__(self, name, mode): self.name = name self.mode = mode def getSuccessor(mode_num, map): try: maps = modeMapLists[modes[mode_num]] if map == '': return maps[0] else: ndx = maps.index(map) except ValueError:
from xsbs.settings import PluginConfig from xsbs.game import modes from xsbs.ui import error, info from xsbs.colors import colordict from xsbs.commands import registerCommandHandler import logging import sbserver import string config = PluginConfig('maprotation') preset_rotation = config.getOption('Config', 'use_preset_rotation', 'yes') == 'yes' start_mode = config.getOption('Config', 'start_mode', 'ffa') nextmap_response = config.getOption('Config', 'nextmap_response', 'The next map is ${blue}${mapname}') map_modes = config.getAllOptions('Maps') del config nextmap_response = string.Template(nextmap_response) class Map: def __init__(self, name, mode): self.name = name self.mode = mode def getSuccessor(mode_num, map): try: maps = modeMapLists[modes[mode_num]] if map == '': return maps[0]