profile.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. syntax = "proto2";
  2. //TODO: answer ??? questions and saved_game format (zwift_profile.ksy)
  3. enum ActivityPrivacyType {
  4. PUBLIC = 0;
  5. PRIVATE = 1;
  6. FRIENDS = 2;
  7. }
  8. enum Sport {
  9. CYCLING = 0;
  10. RUNNING = 1;
  11. ROWING = 2;
  12. SPORT3 = 3;
  13. SPORT4 = 4;
  14. }
  15. enum PlayerType {
  16. PLAYERTYPE0 = 0;
  17. NORMAL = 1;
  18. PRO_CYCLIST = 2;
  19. ZWIFT_STAFF = 3;
  20. AMBASSADOR = 4;
  21. VERIFIED = 5;
  22. ZED = 6;
  23. ZAC = 7;
  24. PRO_TRIATHLETE = 8;
  25. PRO_RUNNER = 9;
  26. }
  27. enum PowerType {
  28. PT_UNKNOWN = -1;
  29. PT_VIRTUAL = 0;
  30. PT_METER = 1;
  31. }
  32. message PlayerProfile {
  33. optional int64 id = 1;
  34. optional int64 server_realm = 2;
  35. optional string email = 3;
  36. optional string first_name = 4;
  37. optional string last_name = 5;
  38. optional bool is_male = 6;
  39. optional string f7 = 7; //??? empty
  40. // no f8 exists
  41. optional uint32 weight_in_grams = 9;
  42. optional uint32 ftp = 10;
  43. optional uint32 f11 = 11; //??? empty, 0
  44. optional uint32 body_type = 12;
  45. optional uint32 hair_type = 13;
  46. optional uint32 facial_hair_type = 14;
  47. optional uint32 ride_helmet_type = 15;
  48. optional uint32 glasses_type = 16;
  49. optional uint32 ride_shoes_type = 17;
  50. optional uint32 ride_socks_type = 18;
  51. optional uint32 ride_gloves = 19;
  52. optional fixed32 ride_jersey = 20;
  53. optional fixed32 f21 = 21; //??? empty
  54. optional fixed32 bike_wheel_front = 22;
  55. optional fixed32 bike_wheel_rear = 23;
  56. optional fixed32 bike_frame = 24;
  57. optional fixed32 f25 = 25; //??? empty, 0
  58. optional fixed32 f26 = 26; //??? empty, 0
  59. optional fixed64 bike_frame_colour = 27;
  60. optional fixed64 f28 = 28; //??? empty, 0
  61. optional fixed64 f29 = 29; //??? empty, 0
  62. optional fixed64 f30 = 30; //??? empty, 0
  63. optional fixed64 f31 = 31; //??? empty, 0
  64. optional fixed64 f32 = 32; //??? empty, 0
  65. optional bytes saved_game = 33; //for format look at zwift_profile.ksy
  66. optional uint32 country_code = 34;
  67. optional uint32 total_distance_in_meters = 35;
  68. optional uint32 elevation_gain_in_meters = 36;
  69. optional uint32 time_ridden_in_minutes = 37;
  70. optional uint32 total_in_kom_jersey = 38;
  71. optional uint32 total_in_sprinters_jersey = 39;
  72. optional uint32 total_in_orange_jersey = 40;
  73. optional uint32 total_watt_hours = 41; // = calories * 0.3256381927080305
  74. optional uint32 height_in_millimeters = 42;
  75. optional string dob = 43;
  76. optional uint32 max_heart_rate = 44;
  77. optional bool connected_to_strava = 45;
  78. optional uint32 total_xp = 46;
  79. optional uint32 total_gold_drops = 47;
  80. optional PlayerType player_type = 48;
  81. optional uint32 achievement_level = 49;
  82. optional bool use_metric = 50;
  83. optional bool strava_premium = 51;
  84. optional PowerType power_source_model = 52;
  85. optional uint32 f53 = 53; //??? empty, 0
  86. optional uint32 f54 = 54; //??? empty, 0
  87. optional uint32 age = 55;
  88. optional fixed32 f56 = 56; //??? empty
  89. optional uint32 f57 = 57; //??? empty, 0
  90. optional string large_avatar_url = 58;
  91. optional fixed64 privacy_bits = 59;
  92. repeated ProfileEntitlement entitlements = 60;
  93. optional SocialFacts social_facts = 61;
  94. message SocialFacts {
  95. optional int64 profile_id = 1;
  96. optional int32 followers_count = 2;
  97. optional int32 followees_count = 3;
  98. optional int32 followees_in_common_with_logged_in_player = 4;
  99. optional FollowStatus follower_status_of_logged_in_player = 5;
  100. optional FollowStatus followee_status_of_logged_in_player = 6;
  101. optional bool is_favorite_of_logged_in_player = 7;
  102. }
  103. optional FollowStatus follow_status = 62;
  104. optional bool connected_to_training_peaks = 63;
  105. optional bool connected_to_todays_plan = 64;
  106. optional EnrolledProgram enrolled_program = 65;
  107. enum EnrolledProgram {
  108. ENROLLEDPROGRAM0 = 0;
  109. ZWIFT_ACADEMY = 1;
  110. ENROLLEDPROGRAM2 = 2;
  111. ENROLLEDPROGRAM3 = 3;
  112. ENROLLEDPROGRAM4 = 4;
  113. }
  114. optional string todayplan_url = 66;
  115. optional uint32 f67 = 67; //??? empty
  116. optional fixed32 run_shirt_type = 68;
  117. optional fixed32 run_shorts_type = 69;
  118. optional fixed32 run_shoes_type = 70;
  119. optional fixed32 run_socks_type = 71;
  120. optional fixed32 run_helmet_type = 72;
  121. optional fixed32 run_arm_accessory = 73;
  122. optional uint32 total_run_distance = 74;
  123. optional uint32 total_run_experience_points = 75;
  124. optional fixed32 f76 = 76; //??? empty
  125. optional fixed32 f77 = 77; //??? empty
  126. optional fixed32 f78 = 78; //??? empty
  127. optional fixed32 f79 = 79; //??? empty, 0
  128. optional uint32 f80 = 80; //??? empty, 0
  129. optional uint32 f81 = 81; //??? empty, 0
  130. optional Subscription subscription = 82;
  131. optional string mix_panel_distinct_id = 83;
  132. optional uint32 run_achievement_level = 84;
  133. optional uint32 total_run_time_in_minutes = 85;
  134. optional Sport sport = 86;
  135. optional uint32 utc_offset_in_minutes = 87;
  136. optional bool connected_to_under_armour = 88;
  137. optional string preferred_language = 89;
  138. optional uint32 hair_colour = 90;
  139. optional uint32 facial_hair_colour = 91;
  140. optional uint32 f92 = 92; //??? empty
  141. optional uint32 f93 = 93; //??? empty
  142. optional uint32 run_shorts_length = 94;
  143. optional uint32 f95 = 95; //??? empty
  144. optional uint32 run_socks_length = 96;
  145. optional uint32 f97 = 97; //??? empty
  146. optional uint32 ride_socks_length = 98;
  147. optional uint32 f99 = 99; //??? empty
  148. optional uint32 f100 = 100; //??? empty
  149. optional uint32 f101 = 101; //??? empty
  150. optional uint32 f102 = 102; //??? empty
  151. optional uint32 f103 = 103; //??? empty
  152. optional uint32 f104 = 104; //??? empty, 1
  153. optional bool connected_to_withings = 105;
  154. optional bool connected_to_fitbit = 106;
  155. // no 107 repeated bytes
  156. optional string launched_game_client = 108;
  157. optional int64 current_activity_id = 109;
  158. optional bool connected_to_garmin = 110;
  159. message Reminder {
  160. optional int64 f1 = 1;
  161. optional string f2 = 2;
  162. optional int64 f3 = 3;
  163. message ReminderProperty {
  164. optional int64 f1 = 1;
  165. optional string f2 = 2;
  166. optional string f3 = 3;
  167. }
  168. repeated ReminderProperty f4 = 4;
  169. }
  170. repeated Reminder reminders = 111;
  171. optional bool f112 = 112; //??? empty
  172. repeated Attribute private_attributes = 113;
  173. repeated Attribute public_attributes = 114;
  174. optional int32 total_run_calories = 115;
  175. optional int64 f116 = 116; //??? empty
  176. optional int32 run_time_1mi_in_seconds = 117;
  177. optional int32 run_time_5km_in_seconds = 118;
  178. optional int32 run_time_10km_in_seconds = 119;
  179. optional int32 run_time_half_marathon_in_seconds = 120;
  180. optional int32 run_time_full_marathon_in_seconds = 121;
  181. optional int32 f122 = 122; //??? empty
  182. enum CyclingOrganization {
  183. NO_CYCLING_LICENSE = 0;
  184. CYCLING_SOUTH_AFRICA = 1;
  185. CYCLING_AUSTRALIA = 2;
  186. CYCLING_NEW_ZEALAND = 3;
  187. }
  188. optional CyclingOrganization cycling_organization = 123;
  189. optional string f124 = 124; // LICENSE_NUMBER/E_NUMBER
  190. optional ActivityPrivacyType default_activity_privacy = 125;
  191. optional bool connected_to_runtastic = 126;
  192. repeated PropertyChange property_changes = 127;
  193. }
  194. message PlayerProfiles {
  195. repeated PlayerProfile profiles = 1;
  196. }
  197. message ProfileEntitlement {
  198. optional EntitlementType type = 1;
  199. enum EntitlementType {
  200. ENTITLEMENTTYPE0 = 0;
  201. RIDE = 1;
  202. RUN = 2;
  203. ROW = 3;
  204. USE = 4;
  205. }
  206. optional int64 id = 2; // always -1 when "RIDE"; increasing small value when "USE" (437, 438, 911, ..., 1229)
  207. optional ProfileEntitlementStatus status = 3;
  208. enum ProfileEntitlementStatus {
  209. ENTITLEMENTSTATUS0 = 0;
  210. EXPIRED = 1;
  211. ACTIVE = 2;
  212. CANCELED = 3;
  213. INACTIVE = 4;
  214. APPLIED_AS_SUBSCRIPTION_TRIAL_PERIOD = 5;
  215. }
  216. optional string period = 4; // 'P7D' = period of 7 days (Y, M also supported for year and month)
  217. optional uint32 begin_time_unix = 5; //when period started
  218. optional uint32 end_time_unix = 6; //when period ended
  219. optional uint32 kilometers = 7; //25 every month
  220. optional uint32 begin_total_distance = 8; //where every-month gift started
  221. optional uint32 end_total_distance = 9; //where every-month gift should end
  222. optional string source = 10; // for example, "strava.premium" ?
  223. optional Platform platform = 11; // legacy?
  224. enum Platform {
  225. PLATFORM_OSX = 0;
  226. PLATFORM_PC = 1;
  227. PLATFORM_IOS = 2;
  228. PLATFORM_ANDROID = 3;
  229. PLATFORM_TVOS = 4;
  230. PLATFORM5 = 5;
  231. PLATFORM6 = 6;
  232. }
  233. optional uint32 renewal_date_unix = 12; //when next 25km gift renewed
  234. optional bool new_trial_system = 13; //do not interrupt current track if trial ended
  235. repeated Platform platforms = 14;
  236. }
  237. message ProfileEntitlements {
  238. repeated ProfileEntitlement entitlements = 1;
  239. }
  240. enum FollowStatus {
  241. FOLLOWSTATUS0 = 0;
  242. UNKNOWN = 1;
  243. REQUESTS_TO_FOLLOW = 2;
  244. IS_FOLLOWING = 3;
  245. HAS_BEEN_DECLINED = 7;
  246. IS_BLOCKED = 4;
  247. NO_RELATIONSHIP = 5;
  248. SELF = 6;
  249. }
  250. message Subscription {
  251. optional Gateway gateway = 1;
  252. enum Gateway {
  253. BRAINTREE = 0;
  254. APPLE = 1;
  255. }
  256. optional SubscriptionStatus status = 2;
  257. enum SubscriptionStatus {
  258. NEW = 0;
  259. EXPIRED = 1;
  260. ACTIVE = 2;
  261. CANCELED = 3;
  262. PAST_DUE = 4;
  263. PENDING = 5;
  264. SUBERROR = 6;
  265. UNRECOGNIZED = 7;
  266. UNKNOWN = 8;
  267. ACTIVE_WITH_PAYMENT_FAILURE = 9;
  268. ABANDONED = 10;
  269. }
  270. }
  271. message PropertyChange {
  272. enum Id {
  273. TYPE0 = 0;
  274. DATE_OF_BIRTH = 1;
  275. GENDER = 2;
  276. }
  277. required Id property_name = 1;
  278. optional int32 change_count = 2;
  279. optional int32 max_changes = 3;
  280. }
  281. /*
  282. Attribute ID is crc32 of it's name. Examples:
  283. public
  284. 324889996=0x135D6D8C <MAGIC> (0)
  285. private
  286. -1575272099="TODAYS_SPORT_SELECT_TYPE" (CYCLIST)
  287. 1169650385="PLAYER_CACHE_BLOB" (000000)
  288. 1025311738="ONBOARD_CUSTOMIZATION_USER_TYPE_ZWIFT_GOAL" (GET IN SHAPE/TRAINING)
  289. -1482469514="LEVEL50" (1)
  290. 839250175="TRAINING_PLAN_DETAILS" ("")
  291. 1190707182="LAST_RATING_TIME" (1641574907)
  292. -702503934="XPTODROPSCONVERSIONDONE" (1)
  293. 2076353160="USERRIDECOUNT" (4)
  294. -2012319163="LAST_WORKOUT_HASH" (1007947233)
  295. -1001004453="SPORT_SELECT_TYPE" (CYCLIST)
  296. 1857228933="USAGE_HISTOGRAM_1" (0,...)
  297. 2004261226="DROPS_CURRENTSESSION" (0.0)
  298. 1318665884="USERPROFILE_STEERINGTUTORIALSHOWN" (1)
  299. 568968402="MOUNTAIN_TRAIL_STARTED" (7)
  300. -642877525="MOUNTAIN_TRAIL_COMPLETED" (5)
  301. -1414690690="USERPROFILE_STEERINGPAIRED" (1)
  302. -34579778="ONROAD_SURVEY_COMPLETED" (5)
  303. -1316403440="PACERBOTTUTORIAL" (1)
  304. */
  305. message Attribute {
  306. required int32 id = 1;
  307. optional int64 number_value = 2;
  308. optional float float_value = 3;
  309. optional string string_value = 5;
  310. }
  311. message AchievementEntry {
  312. required int32 id = 1;
  313. }
  314. message Achievements {
  315. repeated AchievementEntry achievements = 1;
  316. }
  317. message BestEffortPointMsg {
  318. required double power = 1;
  319. optional uint64 timestamp = 2;
  320. }
  321. message PowerCurveAggregationMsg {
  322. map<string, BestEffortPointMsg> watts = 1;
  323. map<string, BestEffortPointMsg> watts_per_kg = 2;
  324. }