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
Last revisionBoth sides next revision
web_apis [2021/06/07 09:46] Grabzweb_apis [2022/12/14 11:17] – Added tabs Karsten75
Line 1: Line 1:
 +{{page>Utils:main_tabs}}
 ====== Web APIs ====== ====== Web APIs ======
 ===== Map Browser ===== ===== Map Browser =====
Line 26: Line 27:
   * ''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 46:
  
 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 261:
 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.txt · Last modified: 2022/12/14 11:43 by Karsten75