Esempio n. 1
0
    def __init__(self, bot):
        """Plugin init

        Reads games from config"""
        self.games = {}
        self.order = []
        self.last_promote = 0
        if not config.has_section('Pickup games'):
            log.err('Could not find section "Pickup games" of the config!')
            return
        games = config.items('Pickup games')
#        log.msg(games)

        for (gamenick, gamename) in games:
            if gamenick == 'order':
                self.order = config.getlist('Pickup games', 'order')
            else:
                if config.has_section('Pickup: '+gamenick):
                    gamesettings = dict(config.items('Pickup: '+gamenick))
                else:
                    gamesettings = {}
                self.games[gamenick] = Game(
                    self,
                    gamenick, gamename,
                    **gamesettings)
                if gamenick not in self.order:
                    self.order.append(gamenick)

        self.order = filter(lambda x: x in self.games, self.order)
Esempio n. 2
0
 def __init__(self, pickup, nick, name, captains=2, players=8, autopick=False, **kwargs):
     self.pickup = pickup
     self.nick = nick
     self.name = name
     self.caps = int(captains)
     self.maxplayers = int(players)
     self.autopick = bool(autopick)
     self.info = kwargs
     self.players = []
     self.starting = False
     self.abort_start = False
     
     if 'teamnames' in kwargs:
         self.teamnames = config.getlist('Pickup: '+nick, 'teamnames')
     else:
         self.teamnames = []
Esempio n. 3
0
 def load_modules(self):
     """Loads modules set in the config"""
     log.msg(_("Loading enabled modules..."))
     self.load(config.getlist('Modules', 'modules'))
Esempio n. 4
0
 def load_modules_config(self):
     """Load modules' defaults"""
     log.msg(_("Loading default module configs..."))
     self.load_module_config(config.getlist('Modules', 'modules'))
Esempio n. 5
0
 def __init__(self):
     self.channels = config.getlist('Server', 'channels')
     self.nickname = config.get('Bot', 'nickname')