Skip to content

Commit

Permalink
Update user storage
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnapalm committed Sep 7, 2024
1 parent 4e49bd0 commit 1712bb0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions protobuf/user_storage.proto
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
syntax = "proto2";

message UserStorage {
optional GameSettings game_settings = 2;
optional Attributes attributes = 2;
}

message GameSettings {
optional Attributes f22 = 22;
message Attributes {
optional GameSettings game_settings = 22;
}

message Attributes {
message GameSettings {
optional float f2 = 2;
optional int32 f3 = 3;
optional int32 f4 = 4;
optional int32 f5 = 5;
optional int32 f6 = 6;
optional int32 f7 = 7;
optional int32 leaderboards = 3;
optional int32 power_meter_slot0 = 4;
optional int32 power_meter_slot1 = 5;
optional int32 power_meter_slot2 = 6;
optional int32 power_meter_slot3 = 7;
}
12 changes: 6 additions & 6 deletions protobuf/user_storage_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions zwift_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3674,10 +3674,10 @@ def api_player_profile_user_game_storage_attributes():
return '', 202
ret = user_storage_pb2.UserStorage()
n = int(request.args.get('n'))
if n in user_storage.game_settings.DESCRIPTOR.fields_by_number:
field = user_storage.game_settings.DESCRIPTOR.fields_by_number[n].name
if user_storage.game_settings.HasField(field):
getattr(ret.game_settings, field).CopyFrom(getattr(user_storage.game_settings, field))
if n in user_storage.attributes.DESCRIPTOR.fields_by_number:
field = user_storage.attributes.DESCRIPTOR.fields_by_number[n].name
if user_storage.attributes.HasField(field):
getattr(ret.attributes, field).CopyFrom(getattr(user_storage.attributes, field))
return ret.SerializeToString(), 200


Expand Down

0 comments on commit 1712bb0

Please sign in to comment.