Exemple #1
0
    def launch(self):
        """Request launching a game. The game may not be installed yet."""
        if not self.is_launchable():
            logger.error("Game is not launchable")
            return

        self.load_config()  # Reload the config before launching it.

        if str(self.id) in LOG_BUFFERS:  # Reset game logs on each launch
            log_buffer = LOG_BUFFERS[str(self.id)]
            log_buffer.delete(log_buffer.get_start_iter(), log_buffer.get_end_iter())

        self.state = self.STATE_LAUNCHING
        self.prelaunch_pids = system.get_running_pid_list()
        self.emit("game-start")
        jobs.AsyncCall(self.runner.prelaunch, self.configure_game)
Exemple #2
0
    def launch(self):
        """Request launching a game. The game may not be installed yet."""
        if not self.is_installed:
            raise RuntimeError("Tried to launch a game that isn't installed")
        self.load_config()  # Reload the config before launching it.

        if str(self.id) in LOG_BUFFERS:  # Reset game logs on each launch
            LOG_BUFFERS.pop(str(self.id))

        if not self.runner:
            dialogs.ErrorDialog(_("Invalid game configuration: Missing runner"))
            return
        if not self.is_launchable():
            logger.error("Game is not launchable")
            return
        self.state = self.STATE_LAUNCHING
        self.prelaunch_pids = system.get_running_pid_list()
        self.emit("game-start")
        jobs.AsyncCall(self.runner.prelaunch, self.configure_game)
Exemple #3
0
 def get_new_pids(self):
     """Return list of PIDs started since the game was launched"""
     return set(system.get_running_pid_list()) - set(self.prelaunch_pids)