1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Seaony\ValorantApi\Endpoints; |
4
|
|
|
|
5
|
|
|
trait CurrentGameEndpoints |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* Get the current game match ID for the provided player |
9
|
|
|
* |
10
|
|
|
* @param string $shard |
11
|
|
|
* @param string $region |
12
|
|
|
* @param string $puuid |
13
|
|
|
* |
14
|
|
|
* @return mixed |
15
|
|
|
*/ |
16
|
|
|
public function currentGamePlayer(string $shard, string $region, string $puuid) |
17
|
|
|
{ |
18
|
|
|
return $this->request('GET', "https://glz-{$region}-1.{$shard}.a.pvp.net/core-game/v1/players/{$puuid}"); |
|
|
|
|
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Get the current game match info |
23
|
|
|
* |
24
|
|
|
* @param string $shard |
25
|
|
|
* @param string $region |
26
|
|
|
* @param string $currentGameMatchId |
27
|
|
|
* |
28
|
|
|
* @return mixed|\Psr\Http\Message\ResponseInterface |
29
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
30
|
|
|
*/ |
31
|
|
|
public function currentGameMatch(string $shard, string $region, string $currentGameMatchId) |
32
|
|
|
{ |
33
|
|
|
return $this->request('GET', "https://glz-{$region}-1.{$shard}.a.pvp.net/core-game/v1/matches/{$currentGameMatchId}"); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @param string $shard |
38
|
|
|
* @param string $region |
39
|
|
|
* @param string $currentGameMatchId |
40
|
|
|
* |
41
|
|
|
* @return mixed|\Psr\Http\Message\ResponseInterface |
42
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
43
|
|
|
*/ |
44
|
|
|
public function currentGameLoadouts(string $shard, string $region, string $currentGameMatchId) |
45
|
|
|
{ |
46
|
|
|
return $this->request('GET', "https://glz-{$region}-1.{$shard}.a.pvp.net/core-game/v1/matches/{$currentGameMatchId}/loadouts"); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Quits the current game |
51
|
|
|
* |
52
|
|
|
* @param string $shard |
53
|
|
|
* @param string $region |
54
|
|
|
* @param string $puuid |
55
|
|
|
* @param string $currentGameMatchId |
56
|
|
|
* |
57
|
|
|
* @return mixed|\Psr\Http\Message\ResponseInterface |
58
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
59
|
|
|
*/ |
60
|
|
|
public function currentGameQuit(string $shard, string $region, string $puuid, string $currentGameMatchId) |
61
|
|
|
{ |
62
|
|
|
return $this->request('POST', "https://glz-{$region}-1.{$shard}.a.pvp.net/core-game/v1/players/{$puuid}/disassociate/{$currentGameMatchId}"); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
} |