diff --git a/docs/openapi.md b/docs/openapi.md index 471a678..ac0ea52 100644 --- a/docs/openapi.md +++ b/docs/openapi.md @@ -1,5 +1,5 @@ --- -title: OpenAPI v1.0 +title: ToneAPI v1.0 language_tabs: - javascript: JavaScript language_clients: @@ -14,41 +14,41 @@ headingLevel: 2 -

OpenAPI v1.0

+

ToneAPI v1.0

> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu. +Stats tracking API for Titanfall 2 Northstar + Base URLs: * https://tone.sleepycat.date/v1 +Web: Legonzaur +License: The Unlicense + # Authentication - HTTP Authentication, scheme: basic -

Default

+

Default

-## post-servers-register +## get-server-list - + > Code samples ```javascript -const inputBody = '{ - "name": "string", - "description": "string", - "auth_port": 8081 -}'; + const headers = { - 'Content-Type':'application/json', 'Accept':'application/json' }; -fetch('https://tone.sleepycat.date/v1/servers/register', +fetch('https://tone.sleepycat.date/v1/client/servers', { - method: 'POST', - body: inputBody, + method: 'GET', + headers: headers }) .then(function(res) { @@ -59,64 +59,357 @@ fetch('https://tone.sleepycat.date/v1/servers/register', ``` -`POST /servers/register` +`GET /client/servers` -Register a server on Tone API. -The server needs to be online on masterserver and reacheable by Tone. +*List of servers* -> Body parameter - -```json -{ - "name": "string", - "description": "string", - "auth_port": 8081 -} -``` - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|body|body|object|false|none| -|» name|body|string|true|The name of your server as it appears on Northstar| -|» description|body|string|true|The description of your server as it appears on Northstar| -|» auth_port|body|integer(uri)|true|In most cases, this is the IP address of your server with the TCP port you forwarded| +An array containing the list of servers as objects > Example responses -> 201 Response +> OK ```json -{ - "id": 0, - "token": "string" -} +[ + { + "id": 1, + "name": "fvnknoots 7v7" + } +] ``` -

Responses

+

Responses

|Status|Meaning|Description|Schema| |---|---|---|---| -|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|Created|Inline| -|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Forbidden|None| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| -

Response Schema

+

Response Schema

-Status Code **201** +Status Code **200** |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|» id|integer|false|none|none| -|» token|string|false|none|none| +|» Server|object|false|none|none| +|»» id|integer|false|none|none| +|»» name|string|false|none|none| -

server

+## get-client-weapons -Everything about servers + + +> Code samples + +```javascript + +const headers = { + 'Accept':'application/json' +}; + +fetch('https://tone.sleepycat.date/v1/client/weapons', +{ + method: 'GET', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); + +``` + +`GET /client/weapons` + +*Statistics for all weapons* + +A JSON Object with weapon IDs as key and weapon data as value + +> Body parameter + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|server|query|number|false|Fetch data for specific server| +|player|query|number|false|Fetch data for specific player| + +> Example responses + +> OK + +```json +{ + "hemlock": { + "max_kill_distance": 0, + "avg_kill_distance": 0, + "kills": 0 + }, + "lstar": { + "max_kill_distance": 0, + "avg_kill_distance": 0, + "kills": 0 + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| + +

Response Schema

+ +Status Code **200** + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» hemlock|object|false|none|none| +|»» max_kill_distance|integer|false|none|none| +|»» avg_kill_distance|number|false|none|none| +|»» kills|integer|false|none|none| + + + +## get-client-weapons-weaponId + + + +> Code samples + +```javascript + +const headers = { + 'Accept':'application/json' +}; + +fetch('https://tone.sleepycat.date/v1/client/weapons/{weaponId}', +{ + method: 'GET', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); + +``` + +`GET /client/weapons/{weaponId}` + +*Statistics for a single weapon* + +Data for a specific weapon + +> Body parameter + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|server|query|number|false|Fetch data for specific server| +|player|query|number|false|Fetch data for specific player| +|weaponId|path|string|true|ID of a weapon| + +> Example responses + +> 200 Response + +```json +{ + "max_kill_distance": 0, + "avg_kill_distance": 0, + "kills": 0 +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| + +

Response Schema

+ +Status Code **200** + +*Weapon* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» max_kill_distance|integer|false|none|none| +|» avg_kill_distance|number|false|none|none| +|» kills|integer|false|none|none| + + + +## get-client-players + + + +> Code samples + +```javascript + +const headers = { + 'Accept':'application/json' +}; + +fetch('https://tone.sleepycat.date/v1/client/players', +{ + method: 'GET', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); + +``` + +`GET /client/players` + +*Statistics for all players* + +A JSON Object with player IDs as key and player data as value + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|weapon|query|string|false|Fetch data for specific weapon| +|server|query|number|false|Fetch data for specific server| + +> Example responses + +> OK + +```json +{ + "2250125460": { + "name": "Legonzaur", + "deaths": 0, + "kills": 0, + "max_kill_distance": 0, + "avg_kill_distance": 0 + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| + +

Response Schema

+ +Status Code **200** + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» 2250125460|object|false|none|none| +|»» name|string|false|none|none| +|»» deaths|integer|false|none|none| +|»» kills|integer|false|none|none| +|»» max_kill_distance|integer|false|none|none| +|»» avg_kill_distance|number|false|none|none| + + + +## get-client-players-playerId + + + +> Code samples + +```javascript + +const headers = { + 'Accept':'application/json' +}; + +fetch('https://tone.sleepycat.date/v1/client/players/{playerId}', +{ + method: 'GET', + + headers: headers +}) +.then(function(res) { + return res.json(); +}).then(function(body) { + console.log(body); +}); + +``` + +`GET /client/players/{playerId}` + +*Statistics for a single player* + +Data for a specific player + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|server|query|number|false|Fetch data for specific server| +|weapon|query|string|false|Fetch data for specific weapon| +|playerId|path|string|true|ID of a player| + +> Example responses + +> 200 Response + +```json +{ + "name": "Legonzaur", + "deaths": 0, + "kills": 0, + "max_kill_distance": 0, + "avg_kill_distance": 0 +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| + +

Response Schema

+ +Status Code **200** + +*Player* + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|» name|string|false|none|none| +|» deaths|integer|false|none|none| +|» kills|integer|false|none|none| +|» max_kill_distance|integer|false|none|none| +|» avg_kill_distance|number|false|none|none| + + ## post-servers-serverId @@ -147,7 +440,7 @@ Used to test auth |Name|In|Type|Required|Description| |---|---|---|---|---| -|serverId|path|string|true|none| +|serverId|path|string|true|ID of the server|

Responses

@@ -269,8 +562,42 @@ Allows a Northstar server to record kills on the database |Name|In|Type|Required|Description| |---|---|---|---|---| -|body|body|[Kill](#schemakill)|false|none| -|serverId|path|string|true|none| +|body|body|object|false|none| +|» id|body|integer|false|none| +|» server|body|string|false|none| +|» tone_version|body|string|false|none| +|» match_id|body|string|false|none| +|» game_mode|body|string|false|none| +|» map|body|string|false|none| +|» game_time|body|string(time)|false|none| +|» player_count|body|integer|false|none| +|» attacker_name|body|string|false|none| +|» attacker_id|body|integer|false|none| +|» attacker_current_weapon|body|string|false|none| +|» attacker_current_weapon_mods|body|integer|false|none| +|» attacker_weapon_1|body|string|false|none| +|» attacker_weapon_1_mods|body|integer|false|none| +|» attacker_weapon_2|body|string|false|none| +|» attacker_weapon_2_mods|body|integer|false|none| +|» attacker_weapon_3|body|string|false|none| +|» attacker_weapon_3_mods|body|integer|false|none| +|» attacker_offhand_weapon_1|body|integer|false|none| +|» attacker_offhand_weapon_2|body|integer|false|none| +|» victim_name|body|string|false|none| +|» victim_id|body|integer|false|none| +|» victim_current_weapon|body|string|false|none| +|» victim_current_weapon_mods|body|integer|false|none| +|» victim_weapon_1|body|string|false|none| +|» victim_weapon_1_mods|body|integer|false|none| +|» victim_weapon_2|body|string|false|none| +|» victim_weapon_2_mods|body|integer|false|none| +|» victim_weapon_3|body|string|false|none| +|» victim_weapon_3_mods|body|integer|false|none| +|» victim_offhand_weapon_1|body|integer|false|none| +|» victim_offhand_weapon_2|body|integer|false|none| +|» cause_of_death|body|string|true|none| +|» distance|body|number|false|none| +|serverId|path|string|true|ID of the server|

Responses

@@ -285,1166 +612,6 @@ To perform this operation, you must be authenticated by means of one of the foll Auth_Token -

weapon

- -Everything about weapons - -## get-weapon-list - - - -> Code samples - -```javascript - -const headers = { - 'Accept':'application/json' -}; - -fetch('https://tone.sleepycat.date/v1/weapons/', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - -`GET /weapons/` - -*List Weapons* - -> Example responses - -> 200 Response - -```json -[ - { - "id": "string", - "name": "Kraber", - "description": "string", - "image": "https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png" - } -] -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| - -

Response Schema

- -Status Code **200** - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|[[Weapon](#schemaweapon)]|false|none|none| -|» Weapon|[Weapon](#schemaweapon)|false|none|none| -|»» id|[WeaponID](#schemaweaponid)|true|none|none| -|»» name|string|false|none|none| -|»» description|string|false|none|none| -|»» image|string(uri)|false|none|none| - - - -

map

- -Everything about maps - -## get-map-list - - - -> Code samples - -```javascript - -const headers = { - 'Accept':'application/json' -}; - -fetch('https://tone.sleepycat.date/v1/maps/', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - -`GET /maps/` - -*List Maps* - -> Example responses - -> 200 Response - -```json -[ - { - "id": "string", - "name": "Angel City", - "description": "string", - "image": "https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg" - } -] -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| - -

Response Schema

- -Status Code **200** - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|[[Map](#schemamap)]|false|none|none| -|» Map|[Map](#schemamap)|false|none|none| -|»» id|[MapID](#schemamapid)|true|none|none| -|»» name|string|false|none|none| -|»» description|string|false|none|none| -|»» image|string(uri)|false|none|none| - - - -

client

- -## get-server-list - - - -> Code samples - -```javascript - -const headers = { - 'Accept':'application/json' -}; - -fetch('https://tone.sleepycat.date/v1/client/servers/', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - -`GET /client/servers/` - -*Get Server list* - -> Example responses - -> 200 Response - -```json -[ - { - "id": 1, - "name": "fvnknoots 7v7" - } -] -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| - -

Response Schema

- -Status Code **200** - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|*anonymous*|[[Server](#schemaserver)]|false|none|none| -|» Server|[Server](#schemaserver)|false|none|none| -|»» id|integer|false|none|none| -|»» name|string|false|none|none| - - - -## get-player-list-for-server - - - -> Code samples - -```javascript - -const headers = { - 'Accept':'application/json' -}; - -fetch('https://tone.sleepycat.date/v1/client/servers/{serverId}/players', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - -`GET /client/servers/{serverId}/players` - -*List Players for Server* - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|serverId|path|string|true|none| - -> Example responses - -> OK - -```json -{ - "2250487322": { - "kills": "16", - "deaths": "3" - }, - "2264540539": { - "kills": "0", - "deaths": "3" - }, - "2275398718": { - "kills": "28", - "deaths": "36" - }, - "2279483655": { - "kills": "124", - "deaths": "80" - }, - "2293751643": { - "kills": "88", - "deaths": "122" - }, - "2317053736": { - "kills": "3", - "deaths": "6" - }, - "2365696799": { - "kills": "69", - "deaths": "64" - }, - "2369053412": { - "kills": "1", - "deaths": "4" - }, - "2372259449": { - "kills": "2", - "deaths": "8" - }, - "2383354003": { - "kills": "8", - "deaths": "8" - }, - "2394254742": { - "kills": "31", - "deaths": "19" - }, - "2420152141": { - "kills": "52", - "deaths": "34" - }, - "2434511212": { - "kills": "2", - "deaths": "9" - }, - "2459505766": { - "kills": "31", - "deaths": "17" - }, - "2480498234": { - "kills": "60", - "deaths": "26" - }, - "2547349226": { - "kills": "2", - "deaths": "1" - }, - "2651468854": { - "kills": "37", - "deaths": "27" - }, - "2789001756": { - "kills": "1", - "deaths": "3" - }, - "2793671940": { - "kills": "1", - "deaths": "10" - }, - "2808303632": { - "kills": "9", - "deaths": "14" - }, - "1004339478890": { - "kills": "209", - "deaths": "75" - }, - "1009631167271": { - "kills": "152", - "deaths": "79" - }, - "1010859553275": { - "kills": "152", - "deaths": "95" - }, - "1013394101159": { - "kills": "146", - "deaths": "157" - }, - "1008532828425": { - "kills": "120", - "deaths": "160" - }, - "1005930844007": { - "kills": "116", - "deaths": "71" - }, - "1008777336129": { - "kills": "113", - "deaths": "62" - }, - "1006452683408": { - "kills": "89", - "deaths": "118" - }, - "1009306948106": { - "kills": "79", - "deaths": "77" - }, - "1001539583158": { - "kills": "77", - "deaths": "54" - }, - "1008553404453": { - "kills": "74", - "deaths": "41" - }, - "1000785195758": { - "kills": "71", - "deaths": "97" - }, - "1012146561597": { - "kills": "70", - "deaths": "67" - }, - "1008048039568": { - "kills": "69", - "deaths": "43" - }, - "1006792160784": { - "kills": "64", - "deaths": "84" - }, - "1000243552229": { - "kills": "64", - "deaths": "82" - }, - "1002847919723": { - "kills": "63", - "deaths": "42" - }, - "1006547511738": { - "kills": "59", - "deaths": "29" - }, - "1008296544768": { - "kills": "56", - "deaths": "63" - }, - "1010475004425": { - "kills": "53", - "deaths": "28" - }, - "1009683708233": { - "kills": "53", - "deaths": "127" - }, - "1007916824452": { - "kills": "52", - "deaths": "38" - }, - "1005789878582": { - "kills": "50", - "deaths": "41" - }, - "1000208553932": { - "kills": "48", - "deaths": "40" - }, - "1011886375716": { - "kills": "47", - "deaths": "27" - }, - "1010766135749": { - "kills": "45", - "deaths": "56" - }, - "1009353300588": { - "kills": "44", - "deaths": "18" - }, - "1000563596599": { - "kills": "44", - "deaths": "47" - }, - "1008076070452": { - "kills": "42", - "deaths": "33" - }, - "1000170397365": { - "kills": "41", - "deaths": "33" - }, - "1007384912695": { - "kills": "41", - "deaths": "55" - }, - "1009289344839": { - "kills": "40", - "deaths": "91" - }, - "1002547370637": { - "kills": "40", - "deaths": "21" - }, - "1008848730302": { - "kills": "40", - "deaths": "78" - }, - "1002965199684": { - "kills": "39", - "deaths": "40" - }, - "1008704914497": { - "kills": "38", - "deaths": "21" - }, - "1000680732650": { - "kills": "38", - "deaths": "21" - }, - "1009020277340": { - "kills": "37", - "deaths": "43" - }, - "1009001081875": { - "kills": "37", - "deaths": "57" - }, - "1002862920668": { - "kills": "34", - "deaths": "26" - }, - "1007927614255": { - "kills": "34", - "deaths": "61" - }, - "1007344081350": { - "kills": "32", - "deaths": "54" - }, - "1000689836348": { - "kills": "30", - "deaths": "24" - }, - "1002365588355": { - "kills": "28", - "deaths": "32" - }, - "1000599975674": { - "kills": "28", - "deaths": "18" - }, - "1009981913274": { - "kills": "26", - "deaths": "16" - }, - "1003950824662": { - "kills": "26", - "deaths": "13" - }, - "1000474582791": { - "kills": "26", - "deaths": "32" - }, - "1007213425353": { - "kills": "26", - "deaths": "44" - }, - "1009295548275": { - "kills": "25", - "deaths": "41" - }, - "1007246486495": { - "kills": "23", - "deaths": "26" - }, - "1012332759108": { - "kills": "22", - "deaths": "21" - }, - "1004355057125": { - "kills": "21", - "deaths": "54" - }, - "1010246320749": { - "kills": "21", - "deaths": "23" - }, - "1009763674601": { - "kills": "19", - "deaths": "21" - }, - "1000991748686": { - "kills": "19", - "deaths": "14" - }, - "1003495333189": { - "kills": "19", - "deaths": "32" - }, - "1012863344924": { - "kills": "19", - "deaths": "28" - }, - "1005030069502": { - "kills": "18", - "deaths": "24" - }, - "1011188414213": { - "kills": "17", - "deaths": "13" - }, - "1006943687079": { - "kills": "17", - "deaths": "28" - }, - "1000314539111": { - "kills": "17", - "deaths": "13" - }, - "1007803613856": { - "kills": "12", - "deaths": "19" - }, - "1006068335533": { - "kills": "12", - "deaths": "16" - }, - "1009495187105": { - "kills": "10", - "deaths": "6" - }, - "1009388895366": { - "kills": "9", - "deaths": "41" - }, - "1007511112791": { - "kills": "8", - "deaths": "11" - }, - "1004230608953": { - "kills": "7", - "deaths": "6" - }, - "1009058558981": { - "kills": "7", - "deaths": "8" - }, - "1009752496386": { - "kills": "7", - "deaths": "35" - }, - "1007983554545": { - "kills": "7", - "deaths": "4" - }, - "1012165044680": { - "kills": "6", - "deaths": "4" - }, - "1011679847131": { - "kills": "6", - "deaths": "11" - }, - "1009810188385": { - "kills": "6", - "deaths": "6" - }, - "1003340724325": { - "kills": "5", - "deaths": "2" - }, - "1000250176837": { - "kills": "4", - "deaths": "4" - }, - "1006902817643": { - "kills": "4", - "deaths": "8" - }, - "1000436348239": { - "kills": "4", - "deaths": "3" - }, - "1011584031432": { - "kills": "4", - "deaths": "6" - }, - "1013302746779": { - "kills": "4", - "deaths": "10" - }, - "1002319733641": { - "kills": "3", - "deaths": "8" - }, - "1008766563524": { - "kills": "3", - "deaths": "5" - }, - "1010590824824": { - "kills": "3", - "deaths": "6" - }, - "1014450712715": { - "kills": "3", - "deaths": "15" - }, - "1011819105616": { - "kills": "3", - "deaths": "11" - }, - "1013339742185": { - "kills": "3", - "deaths": "11" - }, - "1007720444069": { - "kills": "3", - "deaths": "6" - }, - "1010050271094": { - "kills": "3", - "deaths": "9" - }, - "1008220179508": { - "kills": "3", - "deaths": "17" - }, - "1008335546916": { - "kills": "3", - "deaths": "7" - }, - "1008176168711": { - "kills": "3", - "deaths": "10" - }, - "1007793002161": { - "kills": "3", - "deaths": "14" - }, - "1009137965834": { - "kills": "2", - "deaths": "9" - }, - "1012089978411": { - "kills": "2", - "deaths": "10" - }, - "1003566577430": { - "kills": "2", - "deaths": "9" - }, - "1006446444857": { - "kills": "2", - "deaths": "1" - }, - "1009129948330": { - "kills": "2", - "deaths": "2" - }, - "1009320303734": { - "kills": "2", - "deaths": "4" - }, - "1011425349538": { - "kills": "2", - "deaths": "7" - }, - "1000082780513": { - "kills": "2", - "deaths": "28" - }, - "1009059593350": { - "kills": "2", - "deaths": "12" - }, - "1008930859124": { - "kills": "2", - "deaths": "3" - }, - "1011062416507": { - "kills": "2", - "deaths": "15" - }, - "1008322047749": { - "kills": "1", - "deaths": "5" - }, - "1010909176351": { - "kills": "1", - "deaths": "3" - }, - "1009015699732": { - "kills": "1", - "deaths": "9" - }, - "1010938099750": { - "kills": "1", - "deaths": "10" - }, - "1009920857596": { - "kills": "1", - "deaths": "3" - }, - "1001248580325": { - "kills": "1", - "deaths": "2" - }, - "1003395331672": { - "kills": "1", - "deaths": "0" - }, - "1008850794164": { - "kills": "1", - "deaths": "1" - }, - "1002970526901": { - "kills": "1", - "deaths": "10" - }, - "1009585427210": { - "kills": "0", - "deaths": "7" - }, - "1010044829720": { - "kills": "0", - "deaths": "2" - }, - "1010302326976": { - "kills": "0", - "deaths": "2" - }, - "1011336094869": { - "kills": "0", - "deaths": "1" - }, - "1010890839674": { - "kills": "0", - "deaths": "2" - }, - "1003009344333": { - "kills": "0", - "deaths": "2" - }, - "1010690831586": { - "kills": "0", - "deaths": "1" - }, - "1012016676172": { - "kills": "0", - "deaths": "3" - }, - "1010958615370": { - "kills": "0", - "deaths": "1" - }, - "1010804831845": { - "kills": "0", - "deaths": "4" - }, - "1014036958511": { - "kills": "0", - "deaths": "5" - }, - "1013377950364": { - "kills": "0", - "deaths": "3" - }, - "1003516913859": { - "kills": "0", - "deaths": "2" - }, - "1005317405570": { - "kills": "0", - "deaths": "1" - }, - "1010373048502": { - "kills": "0", - "deaths": "1" - }, - "1000319933061": { - "kills": "0", - "deaths": "2" - }, - "1013284789566": { - "kills": "0", - "deaths": "4" - }, - "1000180555075": { - "kills": "0", - "deaths": "5" - }, - "1004519819956": { - "kills": "0", - "deaths": "1" - }, - "1008082281599": { - "kills": "0", - "deaths": "2" - }, - "1009413737635": { - "kills": "0", - "deaths": "1" - }, - "1003853474628": { - "kills": "0", - "deaths": "4" - }, - "1013146253403": { - "kills": "0", - "deaths": "5" - }, - "1010845289697": { - "kills": "0", - "deaths": "4" - }, - "1007170712677": { - "kills": "0", - "deaths": "3" - }, - "1011747811565": { - "kills": "0", - "deaths": "3" - }, - "1008770977823": { - "kills": "0", - "deaths": "1" - }, - "1006338144987": { - "kills": "0", - "deaths": "1" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| - -

Response Schema

- -Status Code **200** - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|» [id]|object|false|none|none| -|»» kills|integer|false|none|none| -|»» deaths|integer|false|none|none| -|»» last_seen|string(date-time)|false|none|none| -|»» first_seen|string(date-time)|false|none|none| -|»» max_kill_distance|number|false|none|none| -|»» avg_kill_distance|number|false|none|none| - - - -## get-weapons-report-for-server - - - -> Code samples - -```javascript - -const headers = { - 'Accept':'application/json' -}; - -fetch('https://tone.sleepycat.date/v1/client/servers/{serverId}/weapons', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - -`GET /client/servers/{serverId}/weapons` - -*Get Weapon report for server* - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|serverId|path|string|true|none| - -> Example responses - -> OK - -```json -{ - "sniper": { - "kills": "1180", - "avg_kill_distance": "806", - "max_kill_distance": "3454" - }, - "wingman_n": { - "kills": "831", - "avg_kill_distance": "608", - "max_kill_distance": "2834" - }, - "mastiff": { - "kills": "425", - "avg_kill_distance": "318", - "max_kill_distance": "1570" - }, - "epg": { - "kills": "386", - "avg_kill_distance": "468", - "max_kill_distance": "3023" - }, - "semipistol": { - "kills": "196", - "avg_kill_distance": "370", - "max_kill_distance": "1104" - }, - "thermite_grenade": { - "kills": "142", - "avg_kill_distance": "469", - "max_kill_distance": "1472" - }, - "softball": { - "kills": "139", - "avg_kill_distance": "435", - "max_kill_distance": "1303" - }, - "doubletake": { - "kills": "136", - "avg_kill_distance": "852", - "max_kill_distance": "2618" - }, - "shotgun_pistol": { - "kills": "135", - "avg_kill_distance": "439", - "max_kill_distance": "1419" - }, - "wingman": { - "kills": "98", - "avg_kill_distance": "473", - "max_kill_distance": "1854" - }, - "shotgun": { - "kills": "87", - "avg_kill_distance": "311", - "max_kill_distance": "745" - }, - "pilot_emptyhanded": { - "kills": "65", - "avg_kill_distance": "44", - "max_kill_distance": "115" - }, - "defender": { - "kills": "62", - "avg_kill_distance": "1070", - "max_kill_distance": "3835" - }, - "satchel": { - "kills": "54", - "avg_kill_distance": "503", - "max_kill_distance": "1047" - }, - "grenade_sonar": { - "kills": "43", - "avg_kill_distance": "491", - "max_kill_distance": "1205" - }, - "smr": { - "kills": "27", - "avg_kill_distance": "490", - "max_kill_distance": "1405" - }, - "grenade_electric_smoke": { - "kills": "8", - "avg_kill_distance": "527", - "max_kill_distance": "987" - }, - "human_execution": { - "kills": "4", - "avg_kill_distance": "45", - "max_kill_distance": "71" - }, - "fall": { - "kills": "1", - "avg_kill_distance": "876", - "max_kill_distance": "876" - }, - "arc_launcher": { - "kills": "1", - "avg_kill_distance": "454", - "max_kill_distance": "454" - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| - -

Response Schema

- -Status Code **200** - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|» [weaponID]|object|false|none|none| -|»» kills|integer|false|none|none| -|»» avg_kill_distance|number|false|none|none| -|»» max_kill_distance|number|false|none|none| - - - -## get-player-on-server - - - -> Code samples - -```javascript - -const headers = { - 'Accept':'application/json' -}; - -fetch('https://tone.sleepycat.date/v1/client/servers/{serverId}/players/{playerId}/weapons', -{ - method: 'GET', - - headers: headers -}) -.then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); -}); - -``` - -`GET /client/servers/{serverId}/players/{playerId}/weapons` - -*Get Player report for Server* - -

Parameters

- -|Name|In|Type|Required|Description| -|---|---|---|---|---| -|playerId|path|integer|true|none| -|serverId|path|integer|true|none| - -> Example responses - -> 200 Response - -```json -{ - "[weaponID]": { - "kills": 0, - "deaths": 0, - "max_kill_distance": 0, - "avg_kill_distance": 0 - } -} -``` - -

Responses

- -|Status|Meaning|Description|Schema| -|---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|OK|Inline| -|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found|None| - -

Response Schema

- -Status Code **200** - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|» [weaponID]|[PrefferedWeapon](#schemaprefferedweapon)|false|none|none| -|»» kills|integer|false|none|none| -|»» deaths|integer|false|none|none| -|»» max_kill_distance|integer|false|none|none| -|»» avg_kill_distance|integer|false|none|none| - - - # Schemas

Player

@@ -1456,10 +623,11 @@ This operation does not require authentication ```json { - "id": 0, "name": "Legonzaur", - "opt-out": false, - "hide_TOS": false + "deaths": 0, + "kills": 0, + "max_kill_distance": 0, + "avg_kill_distance": 0 } ``` @@ -1470,10 +638,11 @@ Player |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|id|[PlayerID](#schemaplayerid)|true|none|none| |name|string|false|none|none| -|opt-out|boolean|false|none|If set to true, kills and deaths about this user won't be sent to the database| -|hide_TOS|boolean|false|none|If set to true, TOS will be hidden when player joins a server| +|deaths|integer|false|none|none| +|kills|integer|false|none|none| +|max_kill_distance|integer|false|none|none| +|avg_kill_distance|number|false|none|none|

Weapon

@@ -1484,10 +653,9 @@ Player ```json { - "id": "string", - "name": "Kraber", - "description": "string", - "image": "https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png" + "max_kill_distance": 0, + "avg_kill_distance": 0, + "kills": 0 } ``` @@ -1498,38 +666,9 @@ Weapon |Name|Type|Required|Restrictions|Description| |---|---|---|---|---| -|id|[WeaponID](#schemaweaponid)|true|none|none| -|name|string|false|none|none| -|description|string|false|none|none| -|image|string(uri)|false|none|none| - -

Map

- - - - - - -```json -{ - "id": "string", - "name": "Angel City", - "description": "string", - "image": "https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg" -} - -``` - -Map - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|id|[MapID](#schemamapid)|true|none|none| -|name|string|false|none|none| -|description|string|false|none|none| -|image|string(uri)|false|none|none| +|max_kill_distance|integer|false|none|none| +|avg_kill_distance|number|false|none|none| +|kills|integer|false|none|none|

Server

@@ -1643,182 +782,3 @@ Kill |cause_of_death|string|true|none|none| |distance|number|false|none|none| -

PlayerID

- - - - - - -```json -0 - -``` - -PlayerId - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|PlayerId|integer|false|none|none| - -

WeaponID

- - - - - - -```json -"string" - -``` - -WeaponID - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|WeaponID|string|false|none|none| - -

MapID

- - - - - - -```json -"string" - -``` - -MapID - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|MapID|string|false|none|none| - -

PrefferredServer

- - - - - - -```json -{ - "server": { - "id": 1, - "name": "fvnknoots 7v7" - }, - "killCount": 4988, - "deathCount": 4671 -} - -``` - -PrefferredServer - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|server|[Server](#schemaserver)|false|none|none| -|killCount|integer|false|none|none| -|deathCount|integer|false|none|none| - -

PrefferedWeapon

- - - - - - -```json -{ - "kills": 0, - "deaths": 0, - "max_kill_distance": 0, - "avg_kill_distance": 0 -} - -``` - -PrefferedWeapon - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|kills|integer|false|none|none| -|deaths|integer|false|none|none| -|max_kill_distance|integer|false|none|none| -|avg_kill_distance|integer|false|none|none| - -

PrefferedMap

- - - - - - -```json -{ - "map": { - "id": "string", - "name": "Angel City", - "description": "string", - "image": "https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg" - }, - "killCount": 0, - "deathCount": 0 -} - -``` - -PrefferedMap - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|map|[Map](#schemamap)|false|none|none| -|killCount|integer|false|none|none| -|deathCount|integer|false|none|none| - -

TopPlayers

- - - - - - -```json -{ - "player": { - "id": 0, - "name": "Legonzaur", - "opt-out": false, - "hide_TOS": false - }, - "kill_count": 0, - "death_count": 0 -} - -``` - -TopPlayers - -### Properties - -|Name|Type|Required|Restrictions|Description| -|---|---|---|---|---| -|player|[Player](#schemaplayer)|false|none|none| -|kill_count|integer|false|none|none| -|death_count|integer|false|none|none| - diff --git a/package-lock.json b/package-lock.json index 741ef18..a83eeee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "Stat_Tracker_Server", + "name": "ToneAPI_backend", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/reference/OpenAPI.yml b/reference/OpenAPI.yml index 07200db..cfb5a31 100644 --- a/reference/OpenAPI.yml +++ b/reference/OpenAPI.yml @@ -1,26 +1,20 @@ openapi: 3.0.2 -x-stoplight: - id: gr7tm5a03g740 info: - title: OpenAPI + title: ToneAPI version: '1.0' + contact: + name: Legonzaur + url: 'https://github.com/Legonzaur' + license: + name: The Unlicense + url: 'https://unlicense.org/' + description: 'Stats tracking API for Titanfall 2 Northstar ' servers: - url: 'https://tone.sleepycat.date/v1' -tags: - - name: player - description: Everything about players - - name: server - description: Everything about servers - - name: weapon - description: Everything about weapons - - name: map - description: Everything about maps paths: - /weapons/: + /client/servers: get: - summary: List Weapons - tags: - - weapon + summary: List of servers responses: '200': description: OK @@ -29,47 +23,26 @@ paths: schema: type: array items: - $ref: '#/components/schemas/Weapon' - operationId: get-weapon-list - description: '' - x-internal: true - /maps/: - get: - summary: List Maps - tags: - - map - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Map' - operationId: get-map-list - x-internal: true - /client/servers/: - get: - summary: Get Server list - tags: - - client - responses: - '200': - description: OK - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Server' + title: Server + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: fvnknoots 7v7 + examples: + Example 1: + value: + - id: 1 + name: fvnknoots 7v7 operationId: get-server-list + description: An array containing the list of servers as objects parameters: [] - '/client/servers/{serverId}/players': + /client/weapons: get: - summary: List Players for Server - tags: - - client + summary: Statistics for all weapons responses: '200': description: OK @@ -78,729 +51,215 @@ paths: schema: type: object properties: - '[id]': + hemlock: + title: Weapon type: object - x-stoplight: - id: i0tm5lw98u34e properties: + max_kill_distance: + type: integer + avg_kill_distance: + type: number kills: type: integer - x-stoplight: - id: qclba81i7vkc7 + examples: + Example 1: + value: + hemlock: + max_kill_distance: 0 + avg_kill_distance: 0 + kills: 0 + lstar: + max_kill_distance: 0 + avg_kill_distance: 0 + kills: 0 + operationId: get-client-weapons + parameters: + - name: server + in: query + required: false + schema: + type: number + example: 2 + description: Fetch data for specific server + - name: player + in: query + required: false + schema: + type: number + example: 1005930844007 + description: Fetch data for specific player + requestBody: + content: {} + description: A JSON Object with weapon IDS as keys and weapon data as value + description: A JSON Object with weapon IDs as key and weapon data as value + parameters: [] + '/client/weapons/{weaponId}': + parameters: + - schema: + type: string + example: epg + name: weaponId + in: path + required: true + description: ID of a weapon + get: + summary: Statistics for a single weapon + operationId: get-client-weapons-weaponId + requestBody: + content: {} + parameters: + - name: server + in: query + required: false + schema: + type: number + example: 2 + description: Fetch data for specific server + - name: player + in: query + required: false + schema: + type: number + example: 1005930844007 + description: Fetch data for specific player + description: Data for a specific weapon + responses: + '200': + description: OK + content: + application/json: + schema: + title: Weapon + type: object + properties: + max_kill_distance: + type: integer + x-stoplight: + id: npckmqv4zdoje + avg_kill_distance: + type: number + x-stoplight: + id: 8plgr96gp1ke8 + kills: + type: integer + x-stoplight: + id: pha6hu1qjfsgk + /client/players: + get: + summary: Statistics for all players + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + '2250125460': + title: Player + type: object + properties: + name: + type: string + example: Legonzaur deaths: type: integer - x-stoplight: - id: hjd0pspfmfxi9 - last_seen: - type: string - x-stoplight: - id: 2t122mb6uvsdr - format: date-time - first_seen: - type: string - x-stoplight: - id: xlhtx3nbfvbl0 - format: date-time - max_kill_distance: - type: number - x-stoplight: - id: 2zvmxjuuk4m04 - avg_kill_distance: - type: number - x-stoplight: - id: 6x852k2av6biq - examples: - Example 1: - value: - '2250487322': - kills: '16' - deaths: '3' - '2264540539': - kills: '0' - deaths: '3' - '2275398718': - kills: '28' - deaths: '36' - '2279483655': - kills: '124' - deaths: '80' - '2293751643': - kills: '88' - deaths: '122' - '2317053736': - kills: '3' - deaths: '6' - '2365696799': - kills: '69' - deaths: '64' - '2369053412': - kills: '1' - deaths: '4' - '2372259449': - kills: '2' - deaths: '8' - '2383354003': - kills: '8' - deaths: '8' - '2394254742': - kills: '31' - deaths: '19' - '2420152141': - kills: '52' - deaths: '34' - '2434511212': - kills: '2' - deaths: '9' - '2459505766': - kills: '31' - deaths: '17' - '2480498234': - kills: '60' - deaths: '26' - '2547349226': - kills: '2' - deaths: '1' - '2651468854': - kills: '37' - deaths: '27' - '2789001756': - kills: '1' - deaths: '3' - '2793671940': - kills: '1' - deaths: '10' - '2808303632': - kills: '9' - deaths: '14' - '1004339478890': - kills: '209' - deaths: '75' - '1009631167271': - kills: '152' - deaths: '79' - '1010859553275': - kills: '152' - deaths: '95' - '1013394101159': - kills: '146' - deaths: '157' - '1008532828425': - kills: '120' - deaths: '160' - '1005930844007': - kills: '116' - deaths: '71' - '1008777336129': - kills: '113' - deaths: '62' - '1006452683408': - kills: '89' - deaths: '118' - '1009306948106': - kills: '79' - deaths: '77' - '1001539583158': - kills: '77' - deaths: '54' - '1008553404453': - kills: '74' - deaths: '41' - '1000785195758': - kills: '71' - deaths: '97' - '1012146561597': - kills: '70' - deaths: '67' - '1008048039568': - kills: '69' - deaths: '43' - '1006792160784': - kills: '64' - deaths: '84' - '1000243552229': - kills: '64' - deaths: '82' - '1002847919723': - kills: '63' - deaths: '42' - '1006547511738': - kills: '59' - deaths: '29' - '1008296544768': - kills: '56' - deaths: '63' - '1010475004425': - kills: '53' - deaths: '28' - '1009683708233': - kills: '53' - deaths: '127' - '1007916824452': - kills: '52' - deaths: '38' - '1005789878582': - kills: '50' - deaths: '41' - '1000208553932': - kills: '48' - deaths: '40' - '1011886375716': - kills: '47' - deaths: '27' - '1010766135749': - kills: '45' - deaths: '56' - '1009353300588': - kills: '44' - deaths: '18' - '1000563596599': - kills: '44' - deaths: '47' - '1008076070452': - kills: '42' - deaths: '33' - '1000170397365': - kills: '41' - deaths: '33' - '1007384912695': - kills: '41' - deaths: '55' - '1009289344839': - kills: '40' - deaths: '91' - '1002547370637': - kills: '40' - deaths: '21' - '1008848730302': - kills: '40' - deaths: '78' - '1002965199684': - kills: '39' - deaths: '40' - '1008704914497': - kills: '38' - deaths: '21' - '1000680732650': - kills: '38' - deaths: '21' - '1009020277340': - kills: '37' - deaths: '43' - '1009001081875': - kills: '37' - deaths: '57' - '1002862920668': - kills: '34' - deaths: '26' - '1007927614255': - kills: '34' - deaths: '61' - '1007344081350': - kills: '32' - deaths: '54' - '1000689836348': - kills: '30' - deaths: '24' - '1002365588355': - kills: '28' - deaths: '32' - '1000599975674': - kills: '28' - deaths: '18' - '1009981913274': - kills: '26' - deaths: '16' - '1003950824662': - kills: '26' - deaths: '13' - '1000474582791': - kills: '26' - deaths: '32' - '1007213425353': - kills: '26' - deaths: '44' - '1009295548275': - kills: '25' - deaths: '41' - '1007246486495': - kills: '23' - deaths: '26' - '1012332759108': - kills: '22' - deaths: '21' - '1004355057125': - kills: '21' - deaths: '54' - '1010246320749': - kills: '21' - deaths: '23' - '1009763674601': - kills: '19' - deaths: '21' - '1000991748686': - kills: '19' - deaths: '14' - '1003495333189': - kills: '19' - deaths: '32' - '1012863344924': - kills: '19' - deaths: '28' - '1005030069502': - kills: '18' - deaths: '24' - '1011188414213': - kills: '17' - deaths: '13' - '1006943687079': - kills: '17' - deaths: '28' - '1000314539111': - kills: '17' - deaths: '13' - '1007803613856': - kills: '12' - deaths: '19' - '1006068335533': - kills: '12' - deaths: '16' - '1009495187105': - kills: '10' - deaths: '6' - '1009388895366': - kills: '9' - deaths: '41' - '1007511112791': - kills: '8' - deaths: '11' - '1004230608953': - kills: '7' - deaths: '6' - '1009058558981': - kills: '7' - deaths: '8' - '1009752496386': - kills: '7' - deaths: '35' - '1007983554545': - kills: '7' - deaths: '4' - '1012165044680': - kills: '6' - deaths: '4' - '1011679847131': - kills: '6' - deaths: '11' - '1009810188385': - kills: '6' - deaths: '6' - '1003340724325': - kills: '5' - deaths: '2' - '1000250176837': - kills: '4' - deaths: '4' - '1006902817643': - kills: '4' - deaths: '8' - '1000436348239': - kills: '4' - deaths: '3' - '1011584031432': - kills: '4' - deaths: '6' - '1013302746779': - kills: '4' - deaths: '10' - '1002319733641': - kills: '3' - deaths: '8' - '1008766563524': - kills: '3' - deaths: '5' - '1010590824824': - kills: '3' - deaths: '6' - '1014450712715': - kills: '3' - deaths: '15' - '1011819105616': - kills: '3' - deaths: '11' - '1013339742185': - kills: '3' - deaths: '11' - '1007720444069': - kills: '3' - deaths: '6' - '1010050271094': - kills: '3' - deaths: '9' - '1008220179508': - kills: '3' - deaths: '17' - '1008335546916': - kills: '3' - deaths: '7' - '1008176168711': - kills: '3' - deaths: '10' - '1007793002161': - kills: '3' - deaths: '14' - '1009137965834': - kills: '2' - deaths: '9' - '1012089978411': - kills: '2' - deaths: '10' - '1003566577430': - kills: '2' - deaths: '9' - '1006446444857': - kills: '2' - deaths: '1' - '1009129948330': - kills: '2' - deaths: '2' - '1009320303734': - kills: '2' - deaths: '4' - '1011425349538': - kills: '2' - deaths: '7' - '1000082780513': - kills: '2' - deaths: '28' - '1009059593350': - kills: '2' - deaths: '12' - '1008930859124': - kills: '2' - deaths: '3' - '1011062416507': - kills: '2' - deaths: '15' - '1008322047749': - kills: '1' - deaths: '5' - '1010909176351': - kills: '1' - deaths: '3' - '1009015699732': - kills: '1' - deaths: '9' - '1010938099750': - kills: '1' - deaths: '10' - '1009920857596': - kills: '1' - deaths: '3' - '1001248580325': - kills: '1' - deaths: '2' - '1003395331672': - kills: '1' - deaths: '0' - '1008850794164': - kills: '1' - deaths: '1' - '1002970526901': - kills: '1' - deaths: '10' - '1009585427210': - kills: '0' - deaths: '7' - '1010044829720': - kills: '0' - deaths: '2' - '1010302326976': - kills: '0' - deaths: '2' - '1011336094869': - kills: '0' - deaths: '1' - '1010890839674': - kills: '0' - deaths: '2' - '1003009344333': - kills: '0' - deaths: '2' - '1010690831586': - kills: '0' - deaths: '1' - '1012016676172': - kills: '0' - deaths: '3' - '1010958615370': - kills: '0' - deaths: '1' - '1010804831845': - kills: '0' - deaths: '4' - '1014036958511': - kills: '0' - deaths: '5' - '1013377950364': - kills: '0' - deaths: '3' - '1003516913859': - kills: '0' - deaths: '2' - '1005317405570': - kills: '0' - deaths: '1' - '1010373048502': - kills: '0' - deaths: '1' - '1000319933061': - kills: '0' - deaths: '2' - '1013284789566': - kills: '0' - deaths: '4' - '1000180555075': - kills: '0' - deaths: '5' - '1004519819956': - kills: '0' - deaths: '1' - '1008082281599': - kills: '0' - deaths: '2' - '1009413737635': - kills: '0' - deaths: '1' - '1003853474628': - kills: '0' - deaths: '4' - '1013146253403': - kills: '0' - deaths: '5' - '1010845289697': - kills: '0' - deaths: '4' - '1007170712677': - kills: '0' - deaths: '3' - '1011747811565': - kills: '0' - deaths: '3' - '1008770977823': - kills: '0' - deaths: '1' - '1006338144987': - kills: '0' - deaths: '1' - operationId: get-player-list-for-server - parameters: - - name: serverId - in: path - required: true - schema: - type: string - '/client/servers/{serverId}/weapons': - get: - summary: Get Weapon report for server - tags: - - client - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - x-examples: - Example 1: - doubletake: '119' - arc_launcher: '1' - mastiff: '359' - softball: '137' - wingman: '87' - invalid: '20' - grenade_sonar: '30' - semipistol: '177' - grenade_electric_smoke: '12' - sniper: '1104' - shotgun_pistol: '94' - shotgun: '66' - frag_grenade: '1' - smr: '27' - fall: '1' - epg: '265' - human_execution: '4' - pilot_emptyhanded: '65' - defender: '62' - thermite_grenade: '150' - satchel: '64' - wingman_n: '620' - properties: - '[weaponID]': - x-stoplight: - id: errxxb306byhf - type: object - properties: kills: type: integer - x-stoplight: - id: tbll8rypmptlm + max_kill_distance: + type: integer avg_kill_distance: type: number - x-stoplight: - id: njeuvklvfz71x - max_kill_distance: - type: number - x-stoplight: - id: j5w0u047enoaj examples: Example 1: value: - sniper: - kills: '1180' - avg_kill_distance: '806' - max_kill_distance: '3454' - wingman_n: - kills: '831' - avg_kill_distance: '608' - max_kill_distance: '2834' - mastiff: - kills: '425' - avg_kill_distance: '318' - max_kill_distance: '1570' - epg: - kills: '386' - avg_kill_distance: '468' - max_kill_distance: '3023' - semipistol: - kills: '196' - avg_kill_distance: '370' - max_kill_distance: '1104' - thermite_grenade: - kills: '142' - avg_kill_distance: '469' - max_kill_distance: '1472' - softball: - kills: '139' - avg_kill_distance: '435' - max_kill_distance: '1303' - doubletake: - kills: '136' - avg_kill_distance: '852' - max_kill_distance: '2618' - shotgun_pistol: - kills: '135' - avg_kill_distance: '439' - max_kill_distance: '1419' - wingman: - kills: '98' - avg_kill_distance: '473' - max_kill_distance: '1854' - shotgun: - kills: '87' - avg_kill_distance: '311' - max_kill_distance: '745' - pilot_emptyhanded: - kills: '65' - avg_kill_distance: '44' - max_kill_distance: '115' - defender: - kills: '62' - avg_kill_distance: '1070' - max_kill_distance: '3835' - satchel: - kills: '54' - avg_kill_distance: '503' - max_kill_distance: '1047' - grenade_sonar: - kills: '43' - avg_kill_distance: '491' - max_kill_distance: '1205' - smr: - kills: '27' - avg_kill_distance: '490' - max_kill_distance: '1405' - grenade_electric_smoke: - kills: '8' - avg_kill_distance: '527' - max_kill_distance: '987' - human_execution: - kills: '4' - avg_kill_distance: '45' - max_kill_distance: '71' - fall: - kills: '1' - avg_kill_distance: '876' - max_kill_distance: '876' - arc_launcher: - kills: '1' - avg_kill_distance: '454' - max_kill_distance: '454' - operationId: get-weapons-report-for-server - parameters: [] - x-internal: false + '2250125460': + name: Legonzaur + deaths: 0 + kills: 0 + max_kill_distance: 0 + avg_kill_distance: 0 + operationId: get-client-players + parameters: + - name: weapon + in: query + required: false + schema: + type: string + example: epg + description: Fetch data for specific weapon + - name: server + in: query + required: false + schema: + type: number + example: 2 + description: Fetch data for specific server + description: A JSON Object with player IDs as key and player data as value + '/client/players/{playerId}': parameters: - - name: serverId - in: path - required: true - schema: + - schema: type: string - '/client/servers/{serverId}/players/{playerId}': - parameters: - - name: playerId + name: playerId in: path required: true - schema: - type: integer - - name: serverId - in: path - required: true - schema: - type: integer + description: ID of a player get: - summary: Get Player report for Server - tags: - - client - responses: - '200': - $ref: '#/components/responses/Player-server-report' - '404': - description: Not Found - operationId: get-player-on-server - '/client/servers/{serverId}/players/{playerId}/weapons': - parameters: - - name: playerId - in: path - required: true - schema: - type: integer - - name: serverId - in: path - required: true - schema: - type: integer - get: - summary: Get Player report for Server - tags: - - client + summary: Statistics for a single player responses: '200': description: OK content: application/json: schema: + title: Player type: object properties: - '[weaponID]': - $ref: '#/components/schemas/PrefferedWeapon' + name: + type: string + example: Legonzaur + deaths: + type: integer x-stoplight: - id: 8gibksi8tvjm4 - '404': - description: Not Found - operationId: get-player-on-server + id: xhi261df7kcqo + kills: + type: integer + x-stoplight: + id: ofjpw5sevnf64 + max_kill_distance: + type: integer + x-stoplight: + id: qjqm0t2n6o93p + avg_kill_distance: + type: number + x-stoplight: + id: y0i5i1eja7v84 + operationId: get-client-players-playerId + parameters: + - name: server + in: query + required: false + schema: + type: number + example: 2 + description: Fetch data for specific server + - name: weapon + in: query + required: false + schema: + type: string + example: epg + description: Fetch data for specific weapon + description: Data for a specific player '/servers/{serverId}': parameters: - - $ref: '#/components/parameters/serverId' + - schema: + type: string + example: '2' + name: serverId + in: path + required: true + description: ID of the server post: summary: '' operationId: post-servers-serverId @@ -812,62 +271,9 @@ paths: description: Used to test auth security: - Auth_Token: [] - tags: - - server - /servers/register: - post: - summary: '' - operationId: post-servers-register - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - id: - type: integer - token: - type: string - '403': - description: Forbidden - requestBody: - content: - application/json: - schema: - type: object - properties: - name: - type: string - description: The name of your server as it appears on Northstar - description: - type: string - description: The description of your server as it appears on Northstar - auth_port: - type: integer - format: uri - example: 8081 - description: 'In most cases, this is the IP address of your server with the TCP port you forwarded' - x-stoplight: - id: r9pi7wq6mp6tm - minimum: 0 - maximum: 65535 - required: - - name - - description - - auth_port - description: '' - description: |- - Register a server on Tone API. - The server needs to be online on masterserver and reacheable by Tone. - THIS IS CURRENTLY DISABLED. WAIT FOR SAFE I/O - x-internal: true '/servers/{serverId}/kills': post: summary: Post kills - tags: - - server operationId: post-kills responses: '201': @@ -884,75 +290,152 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Kill' + title: Kill + type: object + properties: + id: + type: integer + readOnly: true + server: + type: string + readOnly: true + tone_version: + type: string + match_id: + type: string + game_mode: + type: string + map: + type: string + game_time: + type: string + format: time + player_count: + type: integer + attacker_name: + type: string + attacker_id: + type: integer + attacker_current_weapon: + type: string + attacker_current_weapon_mods: + type: integer + attacker_weapon_1: + type: string + attacker_weapon_1_mods: + type: integer + attacker_weapon_2: + type: string + attacker_weapon_2_mods: + type: integer + attacker_weapon_3: + type: string + attacker_weapon_3_mods: + type: integer + attacker_offhand_weapon_1: + type: integer + attacker_offhand_weapon_2: + type: integer + victim_name: + type: string + victim_id: + type: integer + victim_current_weapon: + type: string + victim_current_weapon_mods: + type: integer + victim_weapon_1: + type: string + victim_weapon_1_mods: + type: integer + victim_weapon_2: + type: string + victim_weapon_2_mods: + type: integer + victim_weapon_3: + type: string + victim_weapon_3_mods: + type: integer + victim_offhand_weapon_1: + type: integer + victim_offhand_weapon_2: + type: integer + cause_of_death: + type: string + distance: + type: number + required: + - cause_of_death description: '' parameters: - - $ref: '#/components/parameters/serverId' + - schema: + type: string + example: '2' + name: serverId + in: path + required: true + description: ID of the server components: schemas: Player: title: Player x-stoplight: - id: be41fcacb2693 + id: c9lv0bwq7hdx7 type: object + x-examples: + Example 1: + name: Legonzaur + deaths: 0 + kills: 0 + max_kill_distance: 0 + avg_kill_distance: 0 properties: - id: - $ref: '#/components/schemas/PlayerID' name: type: string example: Legonzaur - opt-out: - type: boolean - default: false - description: 'If set to true, kills and deaths about this user won''t be sent to the database' - hide_TOS: - type: boolean - default: false - description: 'If set to true, TOS will be hidden when player joins a server' - required: - - id + deaths: + type: integer + x-stoplight: + id: xhi261df7kcqo + kills: + type: integer + x-stoplight: + id: ofjpw5sevnf64 + max_kill_distance: + type: integer + x-stoplight: + id: qjqm0t2n6o93p + avg_kill_distance: + type: number + x-stoplight: + id: y0i5i1eja7v84 Weapon: title: Weapon x-stoplight: - id: 7zc6t20eh3pcc + id: l8j4cdsuxxrx0 type: object + x-examples: + Example 1: + max_kill_distance: 0 + avg_kill_distance: 0 + kills: 0 properties: - id: - $ref: '#/components/schemas/WeaponID' - name: - type: string - example: Kraber - description: - type: string - image: - type: string - format: uri - example: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png' - required: - - id - Map: - title: Map - x-stoplight: - id: hoh2m6pr6gli7 - type: object - properties: - id: - $ref: '#/components/schemas/MapID' - name: - type: string - example: Angel City - description: - type: string - image: - type: string - format: uri - example: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg' - required: - - id + max_kill_distance: + type: integer + x-stoplight: + id: npckmqv4zdoje + avg_kill_distance: + type: number + x-stoplight: + id: 8plgr96gp1ke8 + kills: + type: integer + x-stoplight: + id: pha6hu1qjfsgk Server: title: Server x-stoplight: - id: hjfwmi2ae419o + id: g45919da0b3rc type: object properties: id: @@ -964,7 +447,7 @@ components: Kill: title: Kill x-stoplight: - id: a9q2tvsts3z32 + id: 8w7qpo5dz7fo9 type: object x-examples: Example 1: @@ -1076,281 +559,34 @@ components: type: number required: - cause_of_death - PlayerID: - title: PlayerId - x-stoplight: - id: 9icavmq5bgsqp - type: integer - WeaponID: - title: WeaponID - x-stoplight: - id: p92aomkxku2po - type: string - maxLength: 50 - MapID: - title: MapID - x-stoplight: - id: zoazw8eoi7qwr - type: string - maxLength: 50 - PrefferredServer: - title: PrefferredServer - x-stoplight: - id: xok1i1668gx6o - type: object - properties: - server: - $ref: '#/components/schemas/Server' - killCount: - type: integer - example: 4988 - deathCount: - type: integer - example: 4671 - PrefferedWeapon: - title: PrefferedWeapon - x-stoplight: - id: b52mxxdsbv1wx - type: object - properties: - kills: - type: integer - x-stoplight: - id: thiudrlmaghe0 - deaths: - type: integer - x-stoplight: - id: ptc32dgqrnh6c - max_kill_distance: - type: integer - x-stoplight: - id: v2ppgf9ogdayj - avg_kill_distance: - type: integer - x-stoplight: - id: yjxzjb8ap9cpi - PrefferedMap: - title: PrefferedMap - x-stoplight: - id: 17kjfi5wu6f4h - type: object - properties: - map: - $ref: '#/components/schemas/Map' - killCount: - type: integer - deathCount: - type: integer - TopPlayers: - title: TopPlayers - x-stoplight: - id: rsl4jqpvwunah - type: object - properties: - player: - $ref: '#/components/schemas/Player' - kill_count: - type: integer - death_count: - type: integer securitySchemes: Auth_Token: type: http scheme: basic parameters: - serverId: - name: serverId - in: path - required: true + server: + name: server + in: query + required: false + schema: + type: number + example: 2 + description: Fetch data for specific server + player: + name: player + in: query + required: false + schema: + type: number + example: 1005930844007 + description: Fetch data for specific player + weapon: + name: weapon + in: query + required: false schema: type: string - playerId: - name: playerId - in: path - required: true - schema: - type: string - responses: - Server-report: - description: OK - content: - application/json: - schema: - type: object - properties: - server: - $ref: '#/components/schemas/Server' - total_kills: - type: integer - first_record: - type: string - format: date-time - last_record: - type: string - format: date-time - most_used_weapons: - type: array - items: - $ref: '#/components/schemas/PrefferedWeapon' - preffered_maps: - type: array - items: - $ref: '#/components/schemas/PrefferedMap' - top_players: - type: array - maxItems: 5 - items: - $ref: '#/components/schemas/TopPlayers' - Player-server-report: - description: OK - content: - application/json: - schema: - type: object - properties: - kills: - type: integer - description: Number of kills of the user in this server - x-stoplight: - id: 7e1sj7qgzklj1 - deaths: - type: integer - description: Number of deaths of the user in this server - x-stoplight: - id: 4d4oy7nv32o0q - first_time_seen: - type: string - format: date-time - x-stoplight: - id: e8yjr6c67n1nc - last_time_seen: - type: string - format: date-time - x-stoplight: - id: xgrbrju5f2lyc - max_kill_distance: - type: number - x-stoplight: - id: qqqfcfqcy028d - avg_kill_distance: - type: number - x-stoplight: - id: rxhly8blndl4v - weapons: - type: object - x-stoplight: - id: t92oo7w7hu9kf - properties: - '[weaponId]': - $ref: '#/components/schemas/PrefferedWeapon' - x-stoplight: - id: oxpzriozk4s16 - examples: - Example 1: - value: - last_seen: 'Mon Mar 13 2023 13:42:15 GMT+0100 (heure normale d’Europe centrale)' - max_kill_distance: '1160' - avg_kill_distance: '400.5000000000000000' - first_seen: 'Mon Mar 13 2023 13:30:13 GMT+0100 (heure normale d’Europe centrale)' - deaths: '21' - kills: '22' - weapons: - epg: - kills: '21' - deaths: '8' - avg_kill_distance: '395' - max_kill_distance: '1160' - thermite_grenade: - kills: '1' - deaths: '0' - avg_kill_distance: '505' - max_kill_distance: '505' - mastiff: - kills: '0' - deaths: '5' - avg_kill_distance: '0' - max_kill_distance: '0' - wingman_n: - kills: '0' - deaths: '8' - avg_kill_distance: '0' - max_kill_distance: '0' - Player-report: - description: OK - content: - application/json: - schema: - type: object - properties: - player: - $ref: '#/components/schemas/Player' - preferred_servers: - type: array - maxItems: 5 - items: - $ref: '#/components/schemas/PrefferredServer' - total_kills: - type: integer - description: Number of kills of the user in the entire database - total_deaths: - type: integer - description: Number of kills of the user in the entire database - first_record: - type: string - format: date-time - last_record: - type: string - format: date-time - most_used_weapons: - type: array - maxItems: 5 - items: - $ref: '#/components/schemas/PrefferedWeapon' - preferred_maps: - type: array - maxItems: 5 - items: - $ref: '#/components/schemas/PrefferedMap' - furthest_kill_distance: - type: number - average_kill_distance: - type: number - examples: - Example 1: - value: - player: - id: 0 - name: Legonzaur - opt-out: false - hide_TOS: false - preferred_servers: - - server: - id: '1' - name: fvnknoots 7v7 - killCount: 4988 - deathCount: 4671 - total_kills: 0 - total_deaths: 0 - first_record: '2019-08-24T14:15:22Z' - last_record: '2019-08-24T14:15:22Z' - most_used_weapons: - - weapon: - id: 0 - internal: mp_weapon_sniper - name: Kraber - description: string - image: 'https://static.wikia.nocookie.net/titanfall_gamepedia/images/8/8b/Icon_kraber.png' - killCount: 0 - deathCount: 0 - preferred_maps: - - map: - id: 0 - internal: mp_angel_city - name: Angel City - description: string - image: 'https://media.contentapi.ea.com/content/dam/eacom/en-us/common/articles-tf2-welcome-header.jpg.adapt.320w.jpg' - killCount: 0 - deathCount: 0 - furthest_kill_distance: 0 - average_kill_distance: 0 + example: epg + description: Fetch data for specific weapon + responses: {} examples: {}