Skip to content

Commit

Permalink
Revert "Update zwift_offline.py"
Browse files Browse the repository at this point in the history
This reverts commit 18d0771.
  • Loading branch information
oldnapalm committed Jan 7, 2024
1 parent 18d0771 commit b93ec36
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions zwift_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,28 +1271,6 @@ def api_users_login():
response.expiration = 70
with open(os.path.join(SCRIPT_DIR, "economy_config.txt")) as f:
Parse(f.read(), response.economy_config)
try:
profile = profile_pb2.PlayerProfile()
profile_file = '%s/%s/profile.bin' % (STORAGE_DIR, current_user.player_id)
with open(profile_file, 'rb') as f:
profile.ParseFromString(f.read())
current_level = profile.achievement_level // 100
new_leveling = True
for level in response.economy_config.cycling_levels:
if level.xp > profile.total_xp:
if level.level > current_level + 1:
new_leveling = False
break
if not new_leveling:
for level in response.economy_config.cycling_levels:
if level.level == current_level:
profile.total_xp = level.xp
profile.f128 = level.xp
with open(profile_file, 'wb') as f:
f.write(profile.SerializeToString())
break
except:
pass
return response.SerializeToString(), 200


Expand Down

0 comments on commit b93ec36

Please sign in to comment.