This repository was archived by the owner on Oct 25, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathcheck.php
More file actions
121 lines (103 loc) · 3.28 KB
/
Copy pathcheck.php
File metadata and controls
121 lines (103 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
/**
* Created by PhpStorm.
* User: rayder
* Date: 8/24/18
* Time: 2:59 PM
*/
require_once __DIR__.'/vendor/autoload.php';
use Swgoh\ApiClient;
$config = json_decode(file_get_contents(__DIR__.'/config.json'));
$apiConfig = array(
'username' => $config->username,
'password' => $config->password,
'datadir' => __DIR__.'/storage',
'cache_enable' => true,
'cache_expire_remove' => true,
'log_enable' => true,
'log_level' => 'DEBUG',
'log_verbose' => true,
'disable_projects' => true,
'force_api' => true,
'force_cache' => false,
'lang' => 'eng_en',
'query_timeout' => 600,
);
$client = new ApiClient($apiConfig);
/* Data */
$send = 0;
if ( $send ) {
$payload = null;
$collections = array(
'abilityList', 'battleEnvironmentsList', 'battleTargetingRuleList', 'categoryList',
'challengeList', 'challengeStyleList', 'effectList', 'environmentCollectionList',
'equipmentList', 'eventSamplingList', 'guildExchangeItemList', 'guildRaidList',
'helpEntryList', 'materialList', 'playerTitleList', 'powerUpBundleList',
'raidConfigList', 'recipeList', 'requirementList', 'skillList',
'starterGuildList', 'statModList', 'statModSetList', 'statProgressionList',
'tableList', 'targetingSetList', 'territoryBattleDefinitionList', 'territoryWarDefinitionList',
'unitsList', 'unlockAnnouncementDefinitionList', 'warDefinitionList', 'xpTableList'
);
$collections = array('unitsList');
$payload = null;
$data = array();
foreach ($collections as $collection) {
// $collection = 'abilityList';
$data[$collection] = $client->getData($collection, $payload);
}
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Battless */
$send = 0;
if ( $send ) {
$data = $client->getBattles();
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Events */
$send = 0;
if ( $send ) {
$data = $client->getEvents();
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Squads */
$send = 0;
if ( $send ) {
$data = $client->getSquads();
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Zetas */
$send = 0;
if ( $send ) {
$data = $client->getZetas();
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Players */
$send = 1;
if ( $send ) {
$players = [199538349];
$players = [199538349, 421862889, 421862890];
$payload = null;
$data = $client->getPlayers($players, $payload);
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Units */
$send = 0;
if ( $send ) {
$players = [199538349];
$payload = null;
$data = $client->getPlayersUnits($players, $payload);
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}
/* Guilds */
$send = 0;
if ( $send ) {
$payload = array(
'roster' => true,
'units' => false,
'mods' => false,
);
$payload = null;
$players = [421862889, 421862890];
$data = $client->getGuilds($players, $payload);
file_put_contents('dev.json', json_encode($data, JSON_PRETTY_PRINT));
}