Skip to content

Commit

Permalink
Merge branch 'zoffline:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnapalm authored Dec 3, 2024
2 parents f80335b + 65d887f commit 82b1705
Show file tree
Hide file tree
Showing 120 changed files with 191 additions and 116 deletions.
89 changes: 40 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

zoffline enables the use of [Zwift](http://zwift.com) offline by acting as a partial implementation of a Zwift server. By default zoffline is only for a single player. See [Step 6: Enable Multiplayer](#step-6-optional-enable-multiplayer) for how to enable support for multiple users/profiles.

zoffline also offers riding against ghosts (your previous rides). Enable this feature by checking "Enable ghosts" in zoffline's launcher. See [Ghosts and bots](#ghosts-and-bots) for extra details.
zoffline also offers riding against ghosts (your previous rides). Enable this feature by checking "Enable ghosts" in zoffline's launcher. See [Ghosts, Bots and RoboPacers](#ghosts-bots-and-robopacers) for extra details.

Additionally, zoffline's launcher allows selecting a specific map to ride on without mucking about with config files.

Expand All @@ -17,7 +17,6 @@ There are three ways with which to install and run zoffline depending on your pl
To install zoffline on Windows:

* Download the latest zoffline release from https://github.com/zoffline/zwift-offline/releases/latest
* If you want the RoboPacers, download the source code package and extract the ``pace_partners`` directory to the same folder zoffline is in.
* If you are not running zoffline on the same PC that Zwift is running: create a ``server-ip.txt`` file in the ``storage`` directory containing the IP address of the PC running zoffline.
* 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.
Expand Down Expand Up @@ -97,10 +96,10 @@ zoffline can be installed on the same machine as Zwift or another local machine.
<details><summary>Windows Instructions</summary>

* Install Zwift
* If your Zwift version is 1.0.136426, you're all set.
* If your Zwift version is 1.0.136993, you're all set.
* If Zwift is not installed, install it before installing zoffline.
* If your Zwift version is newer than 1.0.136426 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.136426 and zoffline is not running from source: wait for zoffline to be updated.
* If your Zwift version is newer than 1.0.136993 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.136993 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/oldnapalm/zoffline-helper/releases/latest
* 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)
Expand All @@ -125,9 +124,9 @@ to generate your own certificates and do the same.
<details><summary>macOS Instructions</summary>

* Install Zwift
* If your Zwift version is 1.0.136426, you're all set.
* If your Zwift version is 1.0.136993, you're all set.
* If Zwift is not installed, install it before installing zoffline.
* If your Zwift version is newer than 1.0.136426: 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.136993: 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 file [ssl/cert-zwift-com.pem](https://github.com/zoffline/zwift-offline/raw/master/ssl/cert-zwift-com.pem) in this repo to a known location.
* Open Keychain Access, select "System" under "Keychains", select "Certificates" under "Category"
* Click "File - Import Items..." and import cert-zwift-com.pem
Expand Down Expand Up @@ -218,7 +217,7 @@ gender). Your profile can be further customized and changed via the in game
menu (e.g. name, nationality, weight change, etc).

To obtain your current profile:
* __NOTE:__ instead of performing the steps below you can instead use the "Settings - Zwift" button in the launcher window (Windows and macOS only).
* __NOTE:__ instead of performing the steps below you can instead use the "Settings - Zwift" button in the launcher window (if using Android, access ``https://<zoffline_ip>/profile/zoffline/``).
* Ensure zoffline is disabled.
* Run ``scripts/get_profile.py -u <your_zwift_username>``
* Or, if using the Windows zoffline.exe version without Python installed you can run ``get_profile.exe`` obtained from https://github.com/oldnapalm/zoffline-helper/releases/latest in place of ``scripts/get_profile.py``
Expand All @@ -228,9 +227,9 @@ To obtain your current profile:

</details>

### Step 4 [OPTIONAL]: Upload activities to Strava
### Step 4 [OPTIONAL]: Upload activities

<details><summary>Expand</summary>
<details><summary>Strava</summary>

* Get CLIENT_ID and CLIENT_SECRET from https://www.strava.com/settings/api
* __NOTE:__ instead of performing the steps below you can instead set the authorization callback domain of your API application to ``launcher.zwift.com`` and use the "Settings - Strava" button in the launcher window (Windows and macOS only).
Expand All @@ -243,39 +242,27 @@ To obtain your current profile:

</details>

### Step 5 [OPTIONAL]: Upload activities to Garmin Connect

<details><summary>Expand</summary>
<details><summary>Garmin Connect</summary>

* If running from source, install garth: ``pip install garth``
* If needed, create a file ``garmin_domain.txt`` in the ``storage`` directory containing the domain
* For China use ``garmin.cn``
* __NOTE:__ instead of performing the step below you can instead use the "Settings - Garmin" button in the launcher window to enter your credentials (Windows and macOS only).
* Create a file ``garmin_credentials.txt`` in the ``storage/1`` directory containing your login credentials
```
<username>
<password>
```
* Note: this is not secure. Only do this if you are comfortable with your login credentials being stored in a clear text file.
* Use the "Settings - Garmin" button in the launcher window to enter your credentials (if using Android, access ``https://<zoffline_ip>/garmin/zoffline/``).
* If your account has multi-factor authentication, run the script ``garmin_auth.py`` and move the resulting ``garth`` folder (saved in whatever directory you ran ``garmin_auth.py`` in) into the ``storage/1`` directory.
* Or, if using the Windows zoffline.exe version without Python installed you can run ``garmin_auth.exe`` obtained from https://github.com/oldnapalm/zoffline-helper/releases/latest instead.
* If testing, ride at least 300 meters, shorter activities won't be uploaded.

</details>

### Step 6 [OPTIONAL]: Enable multiplayer
<details><summary>Intervals.icu</summary>

<details><summary>Expand</summary>

To enable support for multiple users perform the steps below:

* Create a ``multiplayer.txt`` file in the ``storage`` directory.
* If you are not running zoffline on the same PC that Zwift is running: create a ``server-ip.txt`` file in the ``storage`` directory containing the IP address of the PC running zoffline.
* TCP ports 80, 443, 3025 and UDP port 3024 will need to be open on the PC running zoffline if its running remotely.
* Start Zwift and create an account.
* This account will only exist on your zoffline server and has no relation with your actual Zwift account.
* Use the "Settings - Intervals" button in the launcher window to enter your credentials (if using Android, access ``https://<zoffline_ip>/intervals/zoffline/``).
* Copy "Athlete ID" and "API Key" from https://intervals.icu/settings under "Developer Settings".
* If testing, ride at least 300 meters, shorter activities won't be uploaded.

</details>

### Step 7 [OPTIONAL]: Install Zwift Companion App
### Step 5 [OPTIONAL]: Install Zwift Companion App

<details><summary>Android (non-rooted device)</summary>

Expand Down Expand Up @@ -313,6 +300,20 @@ To enable support for multiple users perform the steps below:

</details>

### Step 6 [OPTIONAL]: Enable multiplayer

<details><summary>Expand</summary>

To enable support for multiple users perform the steps below:

* Create a ``multiplayer.txt`` file in the ``storage`` directory.
* If you are not running zoffline on the same PC that Zwift is running: create a ``server-ip.txt`` file in the ``storage`` directory containing the IP address of the PC running zoffline.
* TCP ports 80, 443, 3025 and UDP port 3024 will need to be open on the PC running zoffline if its running remotely.
* Start Zwift and create an account.
* This account will only exist on your zoffline server and has no relation with your actual Zwift account.

</details>

### Extra optional steps

<details><summary>Expand</summary>
Expand All @@ -337,29 +338,27 @@ To enable support for multiple users perform the steps below:
```
</details>

### Ghosts and bots
### Ghosts, Bots and RoboPacers

<details><summary>Expand</summary>

#### Ghosts
<details><summary>Ghosts</summary>

* Enable this feature by checking "Enable ghosts" in zoffline's launcher.
* If you are running Zwift on Android, create a file ``enable_ghosts.txt`` inside the ``storage`` folder.
* If multiplayer is enabled, access ``https://<zoffline_ip>/login/``, check "Enable ghosts" and click "Start Zwift" to save the option.
* Enable this feature by checking "Enable ghosts" in zoffline's launcher (if using Android, access ``https://<zoffline_ip>/user/zoffline/``, check "Enable ghosts" and click "Start Zwift" to save the option).
* When you save an activity, the ghost will be saved in ``storage/<player_id>/ghosts/<world>/<route>``. Next time you ride the same route, the ghost will be loaded.
* Type ``.regroup`` in chat to regroup the ghosts.
* Equipment can be customized by creating a file ``ghost_profile.txt`` inside the ``storage`` folder. The script ``find_equip.py`` can be used to populate this file.
</details>

#### Bots
<details><summary>Bots</summary>

* Create a file ``enable_bots.txt`` inside the ``storage`` folder to load ghosts as bots, they will keep riding around regardless of the route you are riding.
* Optionally, ``enable_bots.txt`` can contain a multiplier value (be careful, if the resulting number of bots is too high, it may cause performance issues or not work at all).
* Names, nationalities and equipment can be customized by creating a file ``bot.txt`` inside the ``storage`` folder. The script ``get_pro_names.py`` can be used to populate this file.
* If you want some random bots, check [this repository](https://github.com/oldnapalm/zoffline-bots).
</details>

#### RoboPacers (formerly known as Pace Partners)
<details><summary>RoboPacers</summary>

* RoboPacers are ghosts saved using a power simulator.
* RoboPacers are ghosts saved using a power simulator, you can find some in [this repository](https://github.com/oldnapalm/zoffline-bots).
* The ghost must be recorded using update frequency of 1 second (default is 3 seconds).
* The activity must start and finish at the same position and speed, otherwise the bot won't loop smoothly.
* The profile must contain a unique player ID and the route ID, so that when you join the bot you take the same turns at intersections.
Expand Down Expand Up @@ -393,14 +392,6 @@ To enable support for multiple users perform the steps below:
* To unlock all equipment, create a file ``unlock_all_equipment.txt`` instead.
</details>

### Upload activities to Intervals.icu

<details><summary>Expand</summary>

* To upload activities to Intervals.icu, use the "Settings - Intervals" button in the launcher window to enter your credentials (if using Android, access https://secure.zwift.com/intervals/zoffline/).
* Copy "Athlete ID" and "API Key" from https://intervals.icu/settings under "Developer Settings".
</details>

## Community Discord server and Strava club

Please join the community supported [Discord](https://discord.gg/GMdn8F8) server and [Strava](https://www.strava.com/clubs/zoffline) club.
Expand Down
2 changes: 1 addition & 1 deletion cdn/gameassets/Zwift_Updates_Root/ZwiftMac_ver_cur.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<Zwift version="1.0.136426" sversion="1.78.0 (136426)" gbranch="rc/1.78.0" gcommit="ea90091a68e3498d7c3868e1942d05a4b98cc092" GAME_URL="https://us-or-rly101.zwift.com" manifest="ZwiftMac_1.0.136426_1f0353f0_manifest.xml" manifest_checksum="340630008" ver_cur_checksum="575640861"/>
<Zwift version="1.0.136993" sversion="1.79.0 (136993)" gbranch="rc/1.79.0" gcommit="6f789e75d791d1f247fa64409f43ca12da8f0750" GAME_URL="https://us-or-rly101.zwift.com" manifest="ZwiftMac_1.0.136993_8445ede7_manifest.xml" manifest_checksum="1456927617" ver_cur_checksum="-1942102335"/>
2 changes: 1 addition & 1 deletion cdn/gameassets/Zwift_Updates_Root/Zwift_ver_cur.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<Zwift version="1.0.136426" sversion="1.78.0 (136426)" gbranch="rc/1.78.0" gcommit="ea90091a68e3498d7c3868e1942d05a4b98cc092" GAME_URL="https://us-or-rly101.zwift.com" manifest="Zwift_1.0.136426_1f0353f0_manifest.xml" manifest_checksum="236577452" ver_cur_checksum="-883372303"/>
<Zwift version="1.0.136993" sversion="1.79.0 (136993)" gbranch="rc/1.79.0" gcommit="6f789e75d791d1f247fa64409f43ca12da8f0750" GAME_URL="https://us-or-rly101.zwift.com" manifest="Zwift_1.0.136993_8445ede7_manifest.xml" manifest_checksum="1172895730" ver_cur_checksum="-1335063587"/>
5 changes: 5 additions & 0 deletions cdn/static/web/launcher/garmin.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ <h4 class="text-shadow">Logged in as {{ username }}</h4>
{% if uname or passw %}
<a href="/delete/garmin_credentials.bin" class="btn btn-sm btn-danger">Remove credentials</a>
{% endif %}
{% if token %}
<a href="/delete/garth/oauth1_token.json" class="btn btn-sm btn-danger">Remove authorization</a>
{% elif uname and passw %}
<a href="{{ url_for('garmin_auth') }}" class="btn btn-sm btn-secondary">Authorize</a>
{% endif %}
</div>
</div>
<div class="row">
Expand Down
4 changes: 4 additions & 0 deletions data/climbs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
"name": "Mt. Hamilton (31.3 km / 1259 m)",
"road": "10036"
},
{
"name": "Norton Summit (8.7 km / 363 m)",
"road": "10039"
},
{
"name": "Old La Honda (5.6 km / 395 m)",
"road": "10018"
Expand Down
7 changes: 7 additions & 0 deletions data/events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@
"course": 17,
"sport": 0
},
{
"name": "Scotland - Outer Scotland",
"route": 2826340040,
"distance": 11361.5,
"course": 17,
"sport": 0
},
{
"name": "Watopia - Big Loop Reverse",
"route": 4107844490,
Expand Down
12 changes: 10 additions & 2 deletions data/game_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
9439966,
9506232,
16032183,
40090128,
202102819,
216566426,
248687448,
Expand Down Expand Up @@ -80,6 +79,7 @@
2462854936,
2529465619,
2546356403,
2631621268,
2638087379,
2638837937,
2656884789,
Expand All @@ -91,6 +91,7 @@
2763919224,
2803157511,
2828152591,
2859073480,
2896909333,
2930635682,
2937771968,
Expand Down Expand Up @@ -427,6 +428,7 @@
307186134,
310916269,
311012497,
314926535,
315634460,
321508751,
326883871,
Expand Down Expand Up @@ -664,6 +666,7 @@
1198454936,
1214754061,
1216459015,
1217780981,
1233478884,
1235387122,
1236323268,
Expand Down Expand Up @@ -1308,6 +1311,7 @@
3909717131,
3917484491,
3924535277,
3925895941,
3926835792,
3928901190,
3930390045,
Expand Down Expand Up @@ -2263,7 +2267,11 @@
"270": 2698009951,
"271": 4199497144,
"272": 2644664789,
"273": 3068694512
"273": 3068694512,
"274": 2826340040,
"275": 4159356920,
"276": 3262665065,
"277": 2062126722
},
"body_types_male": [
2130,
Expand Down
2 changes: 1 addition & 1 deletion data/game_info.txt

Large diffs are not rendered by default.

Loading

0 comments on commit 82b1705

Please sign in to comment.