Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
web_apis [2021/06/07 09:48] – Fixes Grabz | web_apis [2022/12/14 11:17] – Added tabs Karsten75 |
---|
| {{page>Utils:main_tabs}} |
====== Web APIs ====== | ====== Web APIs ====== |
===== Map Browser ===== | ===== Map Browser ===== |
* ''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 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. | * ''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. |
| |
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. |
Example JavaScript code for parsing the objectives value: | Example JavaScript code for parsing the objectives value: |
<code JavaScript> | <code JavaScript> |
let b = 7; | let o = 7; |
| |
let Custom = (b >> 5 & 1) != 0; //0 | let Custom = (o >> 5 & 1) != 0; //false |
let Collect = (b >> 4 & 1) != 0; //0 | let Collect = (o >> 4 & 1) != 0; //false |
let Hold = (b >> 3 & 1) != 0; //0 | let Hold = (o >> 3 & 1) != 0; //false |
let Reclaim = (b >> 2 & 1) != 0; //1 | let Reclaim = (o >> 2 & 1) != 0; //true |
let Totems = (b >> 1 & 1) != 0; //1 | let Totems = (o >> 1 & 1) != 0; //true |
let Nullify = (b >> 0 & 1) != 0; //1 | let Nullify = (o >> 0 & 1) != 0; //true |
| |
//Conclusion: Map has Nullify, Totems and Reclaim objectives | //Conclusion: Map has Nullify, Totems and Reclaim objectives |
</code> | </code> |