Example #1
0
def launch_game(game_id):
    core = RequiredFeature('core').request()
    game_controller = RequiredFeature('game-controller').request()
    core.logger.info('Launching game %s' % game_id)
    game_controller.launch_game(game_id)
    del core
    del game_controller
Example #2
0
def launch_game(game_id):
    core = RequiredFeature('core').request()
    game_controller = RequiredFeature('game-controller').request()
    core.logger.info('Launching game %s' % game_id)
    game_controller.launch_game(game_id)
    del core
    del game_controller
Example #3
0
def start_running_game():
    if plugin.get_setting('last_run', str):
        lastrun = plugin.get_setting('last_run', str)
        core = RequiredFeature('core').request()
        game_controller = RequiredFeature('game-controller').request()
        core.logger.info('Resuming game %s' % lastrun)
        game_controller.launch_game(lastrun)
        del core
        del game_controller
Example #4
0
def launch_game_from_widget(xml_id):
    core = RequiredFeature('core').request()
    game_id = int(xml_id)
    internal_game_id = plugin.get_storage('sorted_game_storage').get(game_id)

    game_controller = RequiredFeature('game-controller').request()
    core.logger.info('Launching game %s' % internal_game_id)
    game_controller.launch_game(internal_game_id)

    del core
    del game_controller
Example #5
0
def launch_game_from_widget(xml_id):
    core = RequiredFeature('core').request()
    game_id = int(xml_id)
    internal_game_id = plugin.get_storage('sorted_game_storage').get(game_id)

    game_controller = RequiredFeature('game-controller').request()
    core.logger.info('Launching game %s' % internal_game_id)
    game_controller.launch_game(internal_game_id)

    del core
    del game_controller
Example #6
0
def launch_game(game_id):
    import xbmcgui
    import time
    if (check_host(plugin.get_setting('host', str)) == True):
        if plugin.get_setting('last_run', str):
            lastrun = plugin.get_setting('last_run', str)
            if (lastrun != game_id):
                result = quit_game('Switch')
                if result == 'True':
                    core = RequiredFeature('core').request()
                    game_controller = RequiredFeature(
                        'game-controller').request()
                    core.logger.info('Launching game %s' % game_id)
                    game_controller.launch_game(game_id)
                    del core
                    del game_controller
            else:
                core = RequiredFeature('core').request()
                game_controller = RequiredFeature('game-controller').request()
                core.logger.info('Launching game %s' % game_id)
                game_controller.launch_game(game_id)
                del core
                del game_controller
        else:
            core = RequiredFeature('core').request()
            game_controller = RequiredFeature('game-controller').request()
            core.logger.info('Launching game %s' % game_id)
            game_controller.launch_game(game_id)
            del core
            del game_controller
    else:
        if plugin.get_setting('last_run', str):
            cleanup = xbmcgui.Dialog().yesno(
                'Communication Error',
                'The host is either not powered on or is asleep on the job. \nOtherwise, please troubleshoot a network issue. \nIf you have restarted the host since your last session, you will need to remove residual data. \n\nWould you like to remove residual data now?',
                nolabel='No',
                yeslabel='Yes')
            if cleanup:
                plugin.set_setting('last_run', '')
        else:
            xbmcgui.Dialog().ok(
                'Communication Error',
                'The host is either not powered on or is asleep on the job. \nOtherwise, please troubleshoot a network issue.'
            )