Files
legonzaur 1827797bca Update v3 server routes
Committed by Legonzaur on behalf of nathan.tienyou@viacesi.fr
2023-09-07 18:01:12 +02:00

511 lines
13 KiB
YAML

openapi: 3.0.2
info:
version: '3.0'
title: ToneAPI
description: |-
Stats tracking API for Titanfall 2 Northstar
All query params can be negated using `!`. Example : (`https://tone.sleepycat.date/v2/client/gamemodes?gamemode=!sns`)
contact:
name: Legonzaur
url: 'https://github.com/Legonzaur'
license:
url: 'https://unlicense.org/'
name: The Unlicense
servers:
- url: 'https://toneapi.ovh/v3'
paths:
/servers:
post:
tags:
- server
summary: Test Authentication
description: Used to test auth
operationId: server-auth-test
responses:
'200':
description: OK
'401':
$ref: '#/components/responses/Invalid-Auth'
security:
- Auth_Token: []
servers:
- url: 'https://tone.sleepycat.date/v3'
/servers/match:
post:
tags:
- server
summary: Create a match
description: Allows a Northstar server to create a match on the database
operationId: server-match-create
requestBody:
description: ''
content:
application/json:
schema:
type: object
properties:
server_name:
type: string
x-stoplight:
id: wjy89zlbesgsg
game_map:
type: string
x-stoplight:
id: pg5fzotd8lyxw
gamemode:
type: string
x-stoplight:
id: xh2lhokfc24eb
air_accel:
type: boolean
x-stoplight:
id: jcpfrheglszl0
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
match:
type: integer
'400':
$ref: '#/components/responses/Bad-Request'
'401':
$ref: '#/components/responses/Invalid-Auth'
'500':
$ref: '#/components/responses/Internal-Server-Error'
security:
- Auth_Token: []
servers:
- url: 'https://tone.sleepycat.date/v3'
'/servers/match/{match_id}/close':
post:
tags:
- server
summary: Close a match
description: Close the match and save statistics
operationId: server-match-close
requestBody:
description: ''
content:
application/json:
schema:
type: object
properties:
'[string] player_id':
type: object
x-stoplight:
id: 3q3o0pwulezj2
properties:
weapons:
type: object
x-stoplight:
id: 0gsa5enmd4uzm
properties:
'[string] weaponID':
$ref: '#/components/schemas/MatchCloseWeaponData'
titans:
type: object
x-stoplight:
id: o36gf0e9j9gsh
properties:
'[string] titanID':
$ref: '#/components/schemas/MatchCloseWeaponData'
stats:
type: object
x-stoplight:
id: h5i5dfb3zdlk1
properties:
distance:
$ref: '#/components/schemas/matchClosePlayerStats'
time:
$ref: '#/components/schemas/matchClosePlayerStats'
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
match:
type: integer
'400':
$ref: '#/components/responses/Bad-Request'
'401':
$ref: '#/components/responses/Invalid-Auth'
'500':
$ref: '#/components/responses/Internal-Server-Error'
security:
- Auth_Token: []
servers:
- url: 'https://tone.sleepycat.date/v3'
x-stoplight:
id: 4jc5qvqwxlsue
parameters:
- schema:
type: integer
name: match_id
in: path
required: true
'/servers/player/{player_id}/connect':
parameters:
- schema:
type: string
name: player_id
in: path
required: true
put:
summary: Player username update
operationId: server-player-connect
responses:
'201':
description: Created
x-stoplight:
id: 50hgv66l3d4z6
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
type: string
x-stoplight:
id: 0fm9gzrvmia6j
match_id:
type: number
x-stoplight:
id: 062q6ygb5k5il
/servers/kill:
post:
tags:
- server
summary: Kill
description: Allows a Northstar server to record kills on the database
operationId: server-kill
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Kill'
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
id:
type: string
'400':
$ref: '#/components/responses/Bad-Request'
'401':
$ref: '#/components/responses/Invalid-Auth'
'403':
description: |-
Match ID invalid.
Use /servers/match to create a match.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
'409':
description: Match is already closed
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
'500':
$ref: '#/components/responses/Internal-Server-Error'
security:
- Auth_Token: []
servers:
- url: 'https://tone.sleepycat.date/v3'
tags:
- name: client
description: Routes accessibles by everyone
- name: server
description: Routes accessibles only to server owners
components:
parameters:
server:
name: server
in: query
description: Fetch data for specific server
required: false
schema:
type: string
example: fvnkhead's 3v3
player:
name: player
in: query
description: Fetch data for specific player
required: false
schema:
type: integer
example: 1005930844007
weapon:
name: weapon
in: query
description: Fetch data for specific weapon
required: false
schema:
type: string
example: epg
map:
name: map
in: query
description: Fetch data for specific map
required: false
schema:
type: string
example: lf_stacks
gamemode:
name: gamemode
in: query
description: Fetch data for specific gamemode
required: false
schema:
type: string
example: aitdm
host:
name: host
in: query
description: Fetch data for specific host
required: false
schema:
type: integer
example: 1
securitySchemes:
Auth_Token:
type: http
scheme: bearer
responses:
Invalid-Auth:
description: Your token is probably invalid
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
Bad-Request:
description: Request body is invalid
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
Internal-Server-Error:
description: Internal Server Error
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
msg:
type: string
data:
type: string
schemas:
'[number] host_id':
type: string
example: Fvnkhead
'[string] server_name':
type: object
properties:
deaths:
type: integer
kills:
type: integer
max_distance:
type: integer
total_distance:
type: integer
host:
type: integer
'[string] weapon_id':
type: object
properties:
deaths:
type: integer
description: Number of deaths caused by this weapon
kills:
type: integer
max_distance:
type: integer
total_distance:
type: integer
deaths_while_equipped:
type: integer
description: Number of deaths while this weapon is equipped
'[number] player_id':
type: object
properties:
deaths:
type: integer
kills:
type: integer
max_distance:
type: integer
total_distance:
type: integer
username:
type: string
title: ''
KillData:
type: object
title: Killdata
properties:
deaths:
$ref: '#/components/schemas/deaths'
kills:
$ref: '#/components/schemas/kills'
max_kill_distance:
$ref: '#/components/schemas/max_kill_distance'
avg_kill_distance:
$ref: '#/components/schemas/avg_kill_distance'
deaths:
type: integer
kills:
type: integer
max_kill_distance:
type: integer
avg_kill_distance:
type: number
Kill:
type: object
title: Kill
properties:
game_time:
type: number
player_count:
type: integer
match_id:
type: integer
cause_of_death:
type: string
distance:
type: number
victim:
$ref: '#/components/schemas/PlayerKillData'
attacker:
$ref: '#/components/schemas/PlayerKillData'
PlayerKillData:
type: object
title: PlayerKillData
properties:
velocity:
type: number
loadout:
type: object
properties:
ordnance:
$ref: '#/components/schemas/WeaponKillData'
secondary:
$ref: '#/components/schemas/WeaponKillData'
primary:
$ref: '#/components/schemas/WeaponKillData'
tactical:
$ref: '#/components/schemas/WeaponKillData'
anti_titan:
$ref: '#/components/schemas/WeaponKillData'
passive1:
type: string
passive2:
type: string
current_weapon:
$ref: '#/components/schemas/WeaponKillData'
state:
type: string
titan:
type: string
id:
type: integer
cloaked:
type: boolean
WeaponKillData:
type: object
title: WeaponKillData
properties:
mods:
type: integer
id:
type: string
matchClosePlayerStats:
title: MatchClosePlayerMoveStats
x-stoplight:
id: 27jz52i808ffl
type: object
properties:
ground:
type: number
x-stoplight:
id: p101zel4w57ir
air:
type: number
x-stoplight:
id: 2xlck0xditzhl
wall:
type: number
x-stoplight:
id: awqcjkwqze40a
MatchCloseWeaponData:
title: MatchCloseWeaponData
x-stoplight:
id: gjyyzzkrcr59f
type: object
properties:
shotsFired:
type: integer
x-stoplight:
id: c9wlafwbpe6u0
shotsHit:
type: integer
x-stoplight:
id: 9kfnkdw5amlnr
shotsCrit:
type: integer
x-stoplight:
id: bn76zlry7bbe2
shotsHeadshot:
type: integer
x-stoplight:
id: aglqqfxyhpawi
shotsRichochet:
type: integer
x-stoplight:
id: 8mwo5nidybzyc
playtime:
type: number
x-stoplight:
id: z0tzic1srfe29