User Tools

Site Tools


web_apis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
web_apis [2021/06/07 09:45] – Added missing values Grabzweb_apis [2022/12/14 11:43] (current) – top links Karsten75
Line 1: Line 1:
 +{{page>utils:top_links}}
 +<WRAP centeralign>
 ====== Web APIs ====== ====== Web APIs ======
 +</WRAP>
 +{{page>Utils:main_tabs}}
 +
 ===== Map Browser ===== ===== Map Browser =====
 Creeper World 1 and 2 do not have an easily readable map browser API and can only be accessed here: Creeper World 1 and 2 do not have an easily readable map browser API and can only be accessed here:
Line 21: Line 26:
   * ''t'' - ''int'' - Map upload UNIX timestamp, divided by 1000.   * ''t'' - ''int'' - Map upload UNIX timestamp, divided by 1000.
   * ''p'' - ''int'' - Forum thread ID (can be used to build URL).   * ''p'' - ''int'' - Forum thread ID (can be used to build URL).
-  * ''u'' - ''int'' - Thumbnail image size+  * ''u'' - ''int'' - Thumbnail image size  (length).
 ==== CW4 values ==== ==== CW4 values ====
   * ''b'' - ''int'' - Current map thumbs count.   * ''b'' - ''int'' - Current map thumbs count.
   * ''s'' - ''string'' - Current map tags, delimited by commas.   * ''s'' - ''string'' - Current map tags, delimited by commas.
   * ''o'' - ''int'' - Map objectives. Base 10 representation of available objectives in binary format. See [[web_apis#parsing_the_cw4_objectives_value|Parsing the CW4 objectives value]] for more details.   * ''o'' - ''int'' - Map objectives. Base 10 representation of available objectives in binary format. See [[web_apis#parsing_the_cw4_objectives_value|Parsing the CW4 objectives value]] for more details.
-  * ''v'' - ''int'' - Version number. Determines from what game version the map was uploaded. Presumably this is only incremented if an update with significant 4RPL additions is made, so older versions of the game cannot attempt to play them. Version 1.0 of the game did not have this system and will be able to play any map though.+  * ''v'' - ''int'' - Version number. Determines from which game version the map was uploaded. Presumably this is only incremented if an update with significant 4RPL additions is made, so older versions of the game cannot attempt to play them. Version 1.0 of the game did not have this system and will be able to play any map though
 +  * ''z'' - ''string'' - Discord forum thread ID for the specified map, on the Knuckle Cracker Discord server.
 ==== CW3 and PF values ==== ==== CW3 and PF values ====
   * ''e'' - ''string'' - Map description.   * ''e'' - ''string'' - Map description.
Line 44: Line 50:
  
 Below is a list of available parameters to the score query APIs: Below is a list of available parameters to the score query APIs:
-  * ''userfilter'' - Filter by user name. Leave empty for no user filter.+  * ''userfilter'' - Filter by user name. Leave empty for no user filter. In Particle Fleet, filtering by user name still shows all scores, but highlights 
   * ''groupfilter'' - Filter by group name. Leave empty for no group filter.   * ''groupfilter'' - Filter by group name. Leave empty for no group filter.
 +  * ''timefilter'' 
 +    * CW3: 0, 1 or 2. 0 - All Time. 1 - 3 days. 2 - 1 week.
 +    * PF: 0 or 1. 0 - All. 1 - Month. 
 +  * ''sort'' - "score" or "time". Applicable to games that have a score. Sort by either best score or best time.
 The following arguments are exclusive, i.e. only use one of these at a time, as applicable: The following arguments are exclusive, i.e. only use one of these at a time, as applicable:
   * ''customID'' - Custom map ID. Needed to query non-DMD custom maps.   * ''customID'' - Custom map ID. Needed to query non-DMD custom maps.
Line 255: Line 265:
 Example JavaScript code for parsing the objectives value: Example JavaScript code for parsing the objectives value:
 <code JavaScript> <code JavaScript>
-let objectives = 7;+let = 7;
  
-let Custom =  (>> 5 & 1) != 0; //0 +let Custom =  (>> 5 & 1) != 0; //false 
-let Collect = (>> 4 & 1) != 0; //0 +let Collect = (>> 4 & 1) != 0; //false 
-let Hold =    (>> 3 & 1) != 0; //0 +let Hold =    (>> 3 & 1) != 0; //false 
-let Reclaim = (>> 2 & 1) != 0; //1 +let Reclaim = (>> 2 & 1) != 0; //true 
-let Totems =  (>> 1 & 1) != 0; //1 +let Totems =  (>> 1 & 1) != 0; //true 
-let Nullify = (>> 0 & 1) != 0; //1+let Nullify = (>> 0 & 1) != 0; //true
  
 //Conclusion: Map has Nullify, Totems and Reclaim objectives //Conclusion: Map has Nullify, Totems and Reclaim objectives
 </code> </code>
web_apis.1623073513.txt.gz · Last modified: 2021/06/07 09:45 by Grabz