Esempio n. 1
0
 def start_ticker(self):
     log.info("Ticking every %ss." % self.tick_interval)
     tock = False
     while True:
         log.debug("Tock." if tock else "Tick.")
         # TODO: timestamp here instead of 1, for debugging?
         self.redis.rpush(self.tick_key, 1)
         sleep(self.tick_interval)
         tock = not tock
Esempio n. 2
0
 def start_ticker(self):
     log.info('Ticking every %ss.' % self.tick_interval)
     tock = False
     while True:
         log.debug('Tock.' if tock else 'Tick.')
         # TODO: timestamp here instead of True, for debugging?
         self.redis.rpush(self.tick_key, True)
         sleep(self.tick_interval)
         tock = not tock
Esempio n. 3
0
    def load_modules(self):
        sys.path.append(self.world_path)

        self.components = self._import_subclasses(self.config['world']['components'], Component)
        self.modes = self._import_subclasses(self.config['world']['modes'], Mode)

        log.debug('Loaded %s component(s) and %s mode(s).' % (
            len(self.components), len(self.modes)
        ))
Esempio n. 4
0
    def load_modules(self):
        sys.path.append(self.world_path)

        self.components = self._import_subclasses(
            self.config["world"]["components"], Component
        )
        self.modes = self._import_subclasses(self.config["world"]["modes"], Mode)

        log.debug(
            "Loaded %s component(s) and %s mode(s)."
            % (len(self.components), len(self.modes))
        )
Esempio n. 5
0
 def perform_command(self, entity_id, command):
     entity = self.get(entity_id)
     log.debug("Processing: [%s] %s" % (entity.id, command))
     entity.perform(command)
Esempio n. 6
0
 def perform_command(self, entity_id, command):
     entity = self.get(entity_id)
     log.debug('Processing: [%s] %s' % (entity.id, command))
     entity.perform(command)