Beispiel #1
0
	
elif mode[0] == 'play':
	playLevel();
	
elif mode[0] == 'server':
	port = addon.getSetting('server_port');
	
	action =  args.get('action', None);
	action = action[0];
	
	dp = xbmcgui.DialogProgressBG();
	dp.create('IPTV', 'Just A Second ...');
	
	if action == 'start':
	
		if server.serverOnline():
			xbmcgui.Dialog().notification(addonname, 'Server already started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO );
		else:
			server.startServer();
			time.sleep(5);
			if server.serverOnline():
				xbmcgui.Dialog().notification(addonname, 'Server started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO );
			else:
				xbmcgui.Dialog().notification(addonname, 'Server not started. Wait one moment and try again. ', xbmcgui.NOTIFICATION_ERROR );
				
	else:
		if server.serverOnline():
			server.stopServer();
			time.sleep(5);
			xbmcgui.Dialog().notification(addonname, 'Server stopped.', xbmcgui.NOTIFICATION_INFO );
		else:
Beispiel #2
0
elif mode[0] == 'play':
    playLevel()

elif mode[0] == 'server':
    port = addon.getSetting('server_port')

    action = args.get('action', None)
    action = action[0]

    dp = xbmcgui.DialogProgressBG()
    dp.create('IPTV', 'Just A Second ...')

    if action == 'start':

        if server.serverOnline():
            xbmcgui.Dialog().notification(
                addonname, 'Server already started.\nPort: ' + str(port),
                xbmcgui.NOTIFICATION_INFO)
        else:
            server.startServer()
            time.sleep(5)
            if server.serverOnline():
                xbmcgui.Dialog().notification(
                    addonname, 'Server started.\nPort: ' + str(port),
                    xbmcgui.NOTIFICATION_INFO)
            else:
                xbmcgui.Dialog().notification(
                    addonname,
                    'Server not started. Wait one moment and try again. ',
                    xbmcgui.NOTIFICATION_ERROR)