Ejemplo n.º 1
0
udpserver_thread.start()

rithreadevent = threading.Event()
ri = threading.Thread(target=remove_inactive)
ri.start()

load_pace_partners()
ppthreadevent = threading.Event()
pp = threading.Thread(target=play_pace_partners)
pp.start()

load_bots()
botthreadevent = threading.Event()
bot = threading.Thread(target=play_bots)
bot.start()

if os.path.isfile(DISCORD_CONFIG_FILE):
    from discord_bot import DiscordThread
    discord = DiscordThread(DISCORD_CONFIG_FILE)
else:

    class DummyDiscord():
        def send_message(self, msg, sender_id=None):
            pass

    discord = DummyDiscord()

zwift_offline.run_standalone(online, global_pace_partners, global_bots,
                             ghosts_enabled, save_ghost, player_update_queue,
                             discord)
Ejemplo n.º 2
0
        global MAP_OVERRIDE
        path_end = self.path.rsplit('/', 1)[1]
        if path_end in [
                'INNSBRUCK', 'LONDON', 'NEWYORK', 'RICHMOND', 'WATOPIA',
                'YORKSHIRE'
        ]:
            MAP_OVERRIDE = path_end
            self.send_response(302)
            self.send_header('Location', 'https://secure.zwift.com/ride')
            self.end_headers()
            return
        if MAP_OVERRIDE and self.path == '/gameassets/MapSchedule_v2.xml':
            self.send_response(200)
            self.send_header('Content-type', 'text/xml')
            self.end_headers()
            self.wfile.write(
                '<MapSchedule><appointments><appointment map="%s" start="%s"/></appointments><VERSION>1</VERSION></MapSchedule>'
                % (MAP_OVERRIDE, datetime.now().strftime("%Y-%m-%dT00:01-04")))
            MAP_OVERRIDE = None
            return
        SimpleHTTPRequestHandler.do_GET(self)


SocketServer.ThreadingTCPServer.allow_reuse_address = True
httpd = SocketServer.ThreadingTCPServer(('', 80), CDNHandler)
zoffline_thread = threading.Thread(target=httpd.serve_forever)
zoffline_thread.daemon = True
zoffline_thread.start()

zwift_offline.run_standalone()
Ejemplo n.º 3
0
def start():
    zwift_offline.run_standalone()