EddyMataGallos

Querying N++'s server

Feb 17th, 2020 (edited)
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. Sample queries:
  2.  
  3. /prod/steam/query_levels?app_id=230270&steam_id=76561198025195712&user_id=162041&steam_auth=&qt=7&mode=0&page=0&player_id=0
  4. /prod/steam/search/levels?app_id=230270&steam_id=76561198025195712&user_id=162041&steam_auth=&search=enr&mode=0&page=0&player_id=0
  5.  
  6. My own query:
  7.  
  8. https://dojo.nplusplus.ninja/prod/steam/query_levels?steam_id=76561198031272062&steam_auth=&qt=7&mode=0&page=0
  9.  
  10. \\ --- Queries ---
  11.  
  12. +---------------+------------------------------------------------------------+
  13. | NAME | DESCRIPTION |
  14. +---------------+------------------------------------------------------------+
  15. | get_scores | Returns leaderboard data for a specific level. |
  16. | get_replay | Returns replay data for a specific run. |
  17. | query_levels | Returns a list of userlevels from a specific tab and page. |
  18. | search/levels | Returns a list of userlevel results for a specific search. |
  19. +---------------+------------------------------------------------------------+
  20.  
  21. \\ --- Parameters ---
  22.  
  23. Not all parameters are valid for all queries, or mean the same in that case.
  24.  
  25. +---------------+-------------------------------------------------------------------------------+
  26. | NAME | DESCRIPTION |
  27. +---------------+-------------------------------------------------------------------------------+
  28. | app_id | |
  29. | steam_id | Obligatory. Must contain the SteamID64 of an active N++ player. |
  30. | steam_auth | Obligatory. Can be left empty. |
  31. | user_id | |
  32. | level_id | |
  33. | replay_id | |
  34. | player_id | |
  35. | qt | Query type. Specifies the leaderboard (get_scores) or the tab (query_levels). |
  36. | mode | Specifies the playing mode (solo, coop, race). |
  37. | page | Specifies the page of results of the query |
  38. +---------------+-------------------------------------------------------------------------------+
  39.  
  40. \\ --- Page ---
  41.  
  42. * This controls what page of results from the specified category to show.
  43. * It goes in decreasing chronological order.
  44. * It's limited to 500 maps per page.
  45. * This way, all maps could be queried.
  46. * If there's a single page, changing this number doesn't do anything, but if there're more pages, surpassing the limit will return an empty page.
  47.  
  48. \\ --- Modes ---
  49.  
  50. 0 Solo
  51. 1 Coop
  52. 2 Race
  53.  
  54. \\ --- Categories (qt) ---
  55.  
  56. Default value: 0 (which doesn't exist).
  57.  
  58. --- Before this, none exist ---
  59. 07 Best
  60. 08 Featured
  61. 09 Top Weekly
  62. 10 Newest
  63. 11 Hardest
  64. 12 Made by me, sorted by ++'s (verify)
  65. 13 Made by me, sorted by Date (verify)
  66. 14 Favourited, sorted by Date (verify)
  67. 15 Favourited, sorted by ++'s (verify)
  68. 16 ?
  69. 17 --- DOESN'T EXIST ---
  70. 18 Made by friends, sorted by Date
  71. 19 Made by friends, sorted by ++'s
  72. 20 --- DOESN'T EXIST ---
  73. 21 Favourited by friends
  74. 22 Tracked by friends, sorted by Date
  75. 23 Tracked by friends, sorted by Rank
  76. 24 Tracked by friends, sorted by Rank, with Score
  77. 25 Tracked by friends, sorted by Rank, without Score
  78. 26 Tracked by me
  79. 27 --- DOESN'T EXIST ---
  80. 28 --- DOESN'T EXIST ---
  81. 29 --- DOESN'T EXIST ---
  82. 30 Following, sorted by Date
  83. 31 Following, sorted by ++'s
  84. --- Repetitions? ---
  85. 32 Made by me, sorted by ++'s
  86. 33 Made by me, sorted by Date
  87. 34 ?
  88. 35 Tracked by me
  89. --- After this, none seem to exist---
  90.  
  91.  
  92. \\ --- Format of data ---
  93.  
  94. File = Header (32 bytes) + Map Headers (n * 44 bytes) + Map Data Blocks.
  95.  
  96. Notes:
  97. * n is the number of maps.
  98. * There is one map data block for each map header.
  99. * Each query, and thus page, seems to be limited at 500 results.
  100. * All 4 byte integers are little endian.
  101. * For unknown fields, possible values are in parenthesis.
  102.  
  103. +---------------------------+
  104. | HEADER (48 bytes) |
  105. +---------------------------+
  106. | # of bytes - Description |
  107. +---------------------------+
  108. | 16 - Date of update |
  109. | 04 - Nº of maps |
  110. | 04 - Page |
  111. | 04 - ? (0) |
  112. | 04 - Category |
  113. | 04 - Mode |
  114. | 04 - ? (1200, once 5) |
  115. | 04 - ? (500, once 25) |
  116. | 04 - ? (0, once 5) |
  117. +---------------------------+
  118. | MAP HEADER (44 bytes) |
  119. +---------------------------+
  120. | # of bytes - Description |
  121. +---------------------------+
  122. | 04 - Map ID |
  123. | 04 - User ID |
  124. | 16 - Author name (padded) |
  125. | 04 - Number of ++'s |
  126. | 16 - Date |
  127. +---------------------------+
  128. | MAP DATA |
  129. +---------------------------+
  130. | # of bytes - Description |
  131. +---------------------------+
  132. | 04 - Size of block |
  133. | 02 - ? | (maybe some integrity check, or some object count)
  134. | ## - zlib-compressed data |
  135. +---------------------------+
Add Comment
Please, Sign In to add comment