From 566f4ab06b19ff9dbb6ff7d74948a237a637d2a9 Mon Sep 17 00:00:00 2001 From: cdemer <123950591+cdemer@users.noreply.github.com> Date: Mon, 30 Jan 2023 09:19:13 -0300 Subject: [PATCH] Update to Zwift 1.0.107342 Add Scotland events Fix get_partial_profile for ghosts Still need to update variants.txt and game_info.txt --- README.md | 12 ++++++------ .../Zwift_Updates_Root/ZwiftMac_ver_cur.xml | 10 +--------- .../Zwift_Updates_Root/Zwift_ver_cur.xml | 10 +--------- zwift_offline.py | 16 ++++++++++++++-- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index ff3c4fa..9b6f5d8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ There are three ways with which to install and run zoffline depending on your pl
Simplest (Windows only) To install zoffline on Windows: -* Download the latest zoffline release from https://github.com/zoffline/zwift-offline/releases +* Download the latest zoffline release from https://github.com/zoffline/zwift-offline/releases/latest * If you want the pace partners, download the source code package and extract the ``pace_partners`` directory to the same folder zoffline is in. * Run the downloaded zoffline.exe * Once run, zoffline will create a ``storage`` directory in the same folder it's in to store your Zwift progress. @@ -95,10 +95,10 @@ zoffline can be installed on the same machine as Zwift or another local machine.
Windows Instructions * Install Zwift - * If your Zwift version is 1.0.106405, you're all set. + * If your Zwift version is 1.0.107342, you're all set. * If Zwift is not installed, install it before installing zoffline. - * If your Zwift version is newer than 1.0.106405 and zoffline is running from source: copy ``C:\Program Files (x86)\Zwift\Zwift_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file. - * If your Zwift version is newer than 1.0.106405 and zoffline is not running from source: wait for zoffline to be updated. + * If your Zwift version is newer than 1.0.107342 and zoffline is running from source: copy ``C:\Program Files (x86)\Zwift\Zwift_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file. + * If your Zwift version is newer than 1.0.107342 and zoffline is not running from source: wait for zoffline to be updated. * __NOTE:__ instead of performing the steps below you can instead just run the __configure_client__ script from https://github.com/zoffline/zwift-offline/releases/tag/zoffline_helper * On your Windows machine running Zwift, copy the following files in this repo to a known location: * [ssl/cert-zwift-com.p12](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.p12) @@ -123,9 +123,9 @@ to generate your own certificates and do the same.
macOS Instructions * Install Zwift - * If your Zwift version is 1.0.106405, you're all set. + * If your Zwift version is 1.0.107342, you're all set. * If Zwift is not installed, install it before installing zoffline. - * If your Zwift version is newer than 1.0.106405: copy ``~/Library/Application Support/Zwift/ZwiftMac_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file. + * If your Zwift version is newer than 1.0.107342: copy ``~/Library/Application Support/Zwift/ZwiftMac_ver_cur.xml`` to zoffline's ``cdn/gameassets/Zwift_Updates_Root/`` overwriting the existing file. * On your Mac machine running Zwift, copy the following files in this repo to a known location: * [ssl/cert-zwift-com.p12](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.p12) * [ssl/cert-zwift-com.pem](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.pem) diff --git a/cdn/gameassets/Zwift_Updates_Root/ZwiftMac_ver_cur.xml b/cdn/gameassets/Zwift_Updates_Root/ZwiftMac_ver_cur.xml index 1e50abb..1a08b0c 100644 --- a/cdn/gameassets/Zwift_Updates_Root/ZwiftMac_ver_cur.xml +++ b/cdn/gameassets/Zwift_Updates_Root/ZwiftMac_ver_cur.xml @@ -1,9 +1 @@ - + diff --git a/cdn/gameassets/Zwift_Updates_Root/Zwift_ver_cur.xml b/cdn/gameassets/Zwift_Updates_Root/Zwift_ver_cur.xml index b4b3daf..3c8d1e1 100644 --- a/cdn/gameassets/Zwift_Updates_Root/Zwift_ver_cur.xml +++ b/cdn/gameassets/Zwift_Updates_Root/Zwift_ver_cur.xml @@ -1,9 +1 @@ - + diff --git a/zwift_offline.py b/zwift_offline.py index 7d11710..73fbf9d 100644 --- a/zwift_offline.py +++ b/zwift_offline.py @@ -348,7 +348,8 @@ courses_lookup = { 13: 'Makuri Islands', 14: 'France', 15: 'Paris', - 16: 'Gravel Mountain' # event specific + 16: 'Gravel Mountain', # event specific + 17: 'Scotland' # event specific } tree = ET.parse('%s/cdn/gameassets/GameDictionary.xml' % SCRIPT_DIR) @@ -407,6 +408,12 @@ def get_partial_profile(player_id): profile = global_pace_partners[player_id].profile elif player_id in global_bots.keys(): profile = global_bots[player_id].profile + elif player_id > 10000000: + g_id = math.floor(player_id / 10000000) + p_id = player_id - g_id * 10000000 + partial_profile.first_name = '' + partial_profile.last_name = time_since(global_ghosts[p_id].play[g_id-1].states[0]) + return partial_profile else: #Read from disk profile_file = '%s/%s/profile.bin' % (STORAGE_DIR, player_id) @@ -1115,7 +1122,12 @@ def api_per_session_info(): return info.SerializeToString(), 200 def get_events(limit, sport): - events_list = [('2022 Bambino Fondo', 3368626651, 6), + events_list = [('City and the Sgurr', 4107749591, 17), + ('Glasgow Crit Circuit', 3765339356, 17), + ('Loch Loop', 742057576, 17), + ('Rolling Highlands', 46799750, 17), + ('The Muckle Yin', 3662705581, 17), + ('2022 Bambino Fondo', 3368626651, 6), ('2022 Medio Fondo', 2900074211, 6), ('2022 Gran Fondo', 1327147942, 6), ('Alpe du Zwift Downhill', 1480439148, 6),