-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
raw_data.php
431 lines (388 loc) · 20.9 KB
/
raw_data.php
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
<?php
$timing['start'] = microtime(true);
include('config/config.php');
global $map, $fork;
// set content type
header('Content-Type: application/json');
$now = new DateTime();
$now->sub(new DateInterval('PT20S'));
$d = array();
$d["timestamp"] = $now->getTimestamp();
$swLat = !empty($_POST['swLat']) ? $_POST['swLat'] : 0;
$neLng = !empty($_POST['neLng']) ? $_POST['neLng'] : 0;
$swLng = !empty($_POST['swLng']) ? $_POST['swLng'] : 0;
$neLat = !empty($_POST['neLat']) ? $_POST['neLat'] : 0;
$oSwLat = !empty($_POST['oSwLat']) ? $_POST['oSwLat'] : 0;
$oSwLng = !empty($_POST['oSwLng']) ? $_POST['oSwLng'] : 0;
$oNeLat = !empty($_POST['oNeLat']) ? $_POST['oNeLat'] : 0;
$oNeLng = !empty($_POST['oNeLng']) ? $_POST['oNeLng'] : 0;
$lures = !empty($_POST['lures']) ? $_POST['lures'] : false;
$eventstops = !empty($_POST['eventstops']) ? $_POST['eventstops'] : false;
$rocket = !empty($_POST['rocket']) ? $_POST['rocket'] : false;
$raids = !empty($_POST['raids']) ? $_POST['raids'] : false;
$quests = !empty($_POST['quests']) ? $_POST['quests'] : false;
$quests_with_ar = (!empty($_POST['quests_with_ar']) && $_POST['quests_with_ar'] == "false") ? false : true;
$dustamount = isset($_POST['dustamount']) ? $_POST['dustamount'] : false;
$reloaddustamount = !empty($_POST['reloaddustamount']) ? $_POST['reloaddustamount'] : false;
$xpamount = isset($_POST['xpamount']) ? $_POST['xpamount'] : false;
$reloadxpamount = !empty($_POST['reloadxpamount']) ? $_POST['reloadxpamount'] : false;
$nestavg = isset($_POST['nestavg']) ? $_POST['nestavg'] : false;
$newportals = !empty($_POST['newportals']) ? $_POST['newportals'] : 0;
$minIv = isset($_POST['minIV']) ? intval($_POST['minIV']) : 0;
$prevMinIv = !empty($_POST['prevMinIV']) ? $_POST['prevMinIV'] : false;
$minLevel = isset($_POST['minLevel']) ? intval($_POST['minLevel']) : 0;
$prevMinLevel = !empty($_POST['prevMinLevel']) ? $_POST['prevMinLevel'] : false;
$exMinIv = !empty($_POST['exMinIV']) ? $_POST['exMinIV'] : '';
$bigKarp = (!empty($_POST['bigKarp']) && $_POST['bigKarp'] == 'true') ? true : false;
$tinyRat = (!empty($_POST['tinyRat']) && $_POST['tinyRat'] == 'true') ? true : false;
$zeroIv = (!empty($_POST['zeroIv']) && $_POST['zeroIv'] == 'true') ? true : false;
$hundoIv = (!empty($_POST['hundoIv']) && $_POST['hundoIv'] == 'true') ? true : false;
$xxs = (!empty($_POST['xxs']) && $_POST['xxs'] == 'true') ? true : false;
$xxl = (!empty($_POST['xxl']) && $_POST['xxl'] == 'true') ? true : false;
$independantPvpAndStats = (!empty($_POST['independantPvpAndStats']) && $_POST['independantPvpAndStats'] == 'true') ? true : false;
$minLLRank = isset($_POST['minLLRank']) ? intval($_POST['minLLRank']) : 0;
$prevMinLLRank = !empty($_POST['prevMinLLRank']) ? $_POST['prevMinLLRank'] : false;
$minGLRank = isset($_POST['minGLRank']) ? intval($_POST['minGLRank']) : 0;
$prevMinGLRank = !empty($_POST['prevMinGLRank']) ? $_POST['prevMinGLRank'] : false;
$minULRank = isset($_POST['minULRank']) ? intval($_POST['minULRank']) : 0;
$prevMinULRank = !empty($_POST['prevMinULRank']) ? $_POST['prevMinULRank'] : false;
$despawnTimeType = !empty($_POST['despawnTimeType']) ? $_POST['despawnTimeType'] : 0;
$pokemonGender = !empty($_POST['pokemonGender']) ? $_POST['pokemonGender'] : 0;
$missingIvOnly = (!empty($_POST['missingIvOnly']) && $_POST['missingIvOnly'] == 'true') ? true : false;
$lastpokemon = !empty($_POST['lastpokemon']) ? $_POST['lastpokemon'] : false;
$lastgyms = !empty($_POST['lastgyms']) ? $_POST['lastgyms'] : false;
$lastpokestops = !empty($_POST['lastpokestops']) ? $_POST['lastpokestops'] : false;
$lastlocs = !empty($_POST['lastslocs']) ? $_POST['lastslocs'] : false;
$lastspawns = !empty($_POST['lastspawns']) ? $_POST['lastspawns'] : false;
$lastnests = !empty($_POST['lastnests']) ? $_POST['lastnests'] : false;
$lastcommunities = !empty($_POST['lastcommunities']) ? $_POST['lastcommunities'] : false;
$lastportals = !empty($_POST['lastportals']) ? $_POST['lastportals'] : false;
$lastpois = !empty($_POST['lastpois']) ? $_POST['lastpois'] : false;
$exEligible = !empty($_POST['exEligible']) ? $_POST['exEligible'] : false;
$d["lastscanlocations"] = !empty($_POST['scanlocations']) ? $_POST['scanlocations'] : false;
$d["lastpokestops"] = !empty($_POST['pokestops']) ? $_POST['pokestops'] : false;
$d["lastgyms"] = !empty($_POST['gyms']) ? $_POST['gyms'] : false;
$d["lastslocs"] = !empty($_POST['scanned']) ? $_POST['scanned'] : false;
$d["lastspawns"] = !empty($_POST['spawnpoints']) ? $_POST['spawnpoints'] : false;
$d["lastpokemon"] = !empty($_POST['pokemon']) ? $_POST['pokemon'] : false;
$d["lastnests"] = !empty($_POST['nests']) ? $_POST['nests'] : false;
$d["lastcommunities"] = !empty($_POST['communities']) ? $_POST['communities'] : false;
$d["lastportals"] = !empty($_POST['portals']) ? $_POST['portals'] : false;
$d["lastpois"] = !empty($_POST['pois']) ? $_POST['pois'] : false;
$loadOverviewStats = !empty($_POST['loadOverviewStats']) ? $_POST['loadOverviewStats'] : false;
$loadPokemonStats = !empty($_POST['loadPokemonStats']) ? $_POST['loadPokemonStats'] : false;
$loadRewardStats = !empty($_POST['loadRewardStats']) ? $_POST['loadRewardStats'] : false;
$loadShinyStats = !empty($_POST['loadShinyStats']) ? $_POST['loadShinyStats'] : false;
if ($minIv < $prevMinIv || $minLevel < $prevMinLevel || $minLLRank < $prevMinLLRank || $minGLRank < $prevMinGLRank || $minULRank < $prevMinULRank) {
$lastpokemon = false;
}
$enc_id = !empty($_POST['encId']) ? $_POST['encId'] : null;
$timestamp = !empty($_POST['timestamp']) ? $_POST['timestamp'] : 0;
$useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
if (empty($swLat) || empty($swLng) || empty($neLat) || empty($neLng) || preg_match("/curl|libcurl/", $useragent)) {
http_response_code(403);
die();
}
if ($maxLatLng > 0 && ((($neLat - $swLat) > $maxLatLng) || (($neLng - $swLng) > $maxLatLng))) {
http_response_code(413);
die();
}
$validity = validateToken($_POST['token']);
if (!empty($validity)) {
switch ($validity) {
case 'invalid':
http_response_code(401);
break;
case 'no-id':
http_response_code(404);
break;
}
}
$debug['0_after_auth'] = microtime(true) - $timing['start'];
// init map
if (strtolower($map) === "rdm") {
$scanner = new \Scanner\RDM();
$stats = new \Stats\RDM();
} elseif (strtolower($map) === "golbat") {
$scanner = new \Scanner\Golbat();
$stats = new \Stats\Golbat();
} elseif (strtolower($map) === "rocketmap") {
if (strtolower($fork) === "mad") {
$scanner = new \Scanner\RocketMap_MAD();
$stats = new \Stats\RocketMap_MAD();
}
}
$manual = new \Manual\Manual();
$newarea = false;
if (($oSwLng < $swLng) && ($oSwLat < $swLat) && ($oNeLat > $neLat) && ($oNeLng > $neLng)) {
$newarea = false;
} elseif (($oSwLat != $swLat) && ($oSwLng != $swLng) && ($oNeLat != $neLat) && ($oNeLng != $neLng)) {
$newarea = true;
} else {
$newarea = false;
}
$d["oSwLat"] = $swLat;
$d["oSwLng"] = $swLng;
$d["oNeLat"] = $neLat;
$d["oNeLng"] = $neLng;
$ids = array();
$eids = array();
$reids = array();
$qpeids = array();
$qpreids = array();
$qieids = array();
$qireids = array();
$qeeids = array();
$qereids = array();
$qceids = array();
$qcreids = array();
$geids = array();
$greids = array();
$rbeids = array();
$rbreids = array();
$reeids = array();
$rereids = array();
$debug['1_before_functions'] = microtime(true) - $timing['start'];
global $noPokemon, $pokemonToExclude;
if (!$noPokemon) {
if ($d["lastpokemon"] == "true") {
$eids = !empty($_POST['eids']) ? explode(",", $_POST['eids']) : array();
if (count($pokemonToExclude)) {
$eids = array_unique(array_merge($eids, $pokemonToExclude));
}
if ($lastpokemon != 'true') {
$d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $minLLRank, $minGLRank, $minULRank, $exMinIv, $bigKarp, $tinyRat, $zeroIv, $hundoIv, $xxs, $xxl, $independantPvpAndStats, $despawnTimeType, $pokemonGender, $missingIvOnly, $swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $enc_id);
} else {
if ($newarea) {
$d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $minLLRank, $minGLRank, $minULRank, $exMinIv, $bigKarp, $tinyRat, $zeroIv, $hundoIv, $xxs, $xxl, $independantPvpAndStats, $despawnTimeType, $pokemonGender, $missingIvOnly, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $enc_id);
} else {
$d["pokemons"] = $scanner->get_active($eids, $minIv, $minLevel, $minLLRank, $minGLRank, $minULRank, $exMinIv, $bigKarp, $tinyRat, $zeroIv, $hundoIv, $xxs, $xxl, $independantPvpAndStats, $despawnTimeType, $pokemonGender, $missingIvOnly, $swLat, $swLng, $neLat, $neLng, $timestamp, 0, 0, 0, 0, $enc_id);
}
}
$d["preMinIV"] = $minIv;
$d["preMinLevel"] = $minLevel;
$d["preMinLLRank"] = $minLLRank;
$d["preMinGLRank"] = $minGLRank;
$d["preMinULRank"] = $minULRank;
if (!empty($_POST['reids'])) {
$reids = !empty($_POST['reids']) ? array_unique(explode(",", $_POST['reids'])) : array();
$reidsDiff = array_diff($reids, $eids);
if (count($reidsDiff)) {
$d["pokemons"] = array_merge($d["pokemons"], $scanner->get_active_by_id($reidsDiff, $minIv, $minLevel, $minLLRank, $minGLRank, $minULRank, $exMinIv, $bigKarp, $tinyRat, $zeroIv, $hundoIv, $xxs, $xxl, $independantPvpAndStats, $despawnTimeType, $pokemonGender, $missingIvOnly, $swLat, $swLng, $neLat, $neLng));
}
$d["reids"] = $reids;
}
}
}
$debug['2_after_pokemon'] = microtime(true) - $timing['start'];
global $noPokestops;
if (!$noPokestops) {
if ($d["lastpokestops"] == "true") {
$qpeids = !empty($_POST['qpeids']) ? explode(",", $_POST['qpeids']) : array();
$qieids = !empty($_POST['qieids']) ? explode(",", $_POST['qieids']) : array();
$qeeids = !empty($_POST['qeeids']) ? explode(",", $_POST['qeeids']) : array();
$qceids = !empty($_POST['qceids']) ? explode(",", $_POST['qceids']) : array();
$geids = !empty($_POST['geids']) ? explode(",", $_POST['geids']) : array();
if ($lastpokestops != "true") {
$d["pokestops"] = $scanner->get_stops($geids, $qpeids, $qeeids, $qceids, $qieids, $swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $lures, $eventstops, $rocket, $quests, $dustamount, $xpamount, $quests_with_ar);
} else {
if ($newarea) {
$d["pokestops"] = $scanner->get_stops($geids, $qpeids, $qeeids, $qceids, $qieids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $xpamount, $quests_with_ar);
} else {
$d["pokestops"] = $scanner->get_stops($geids, $qpeids, $qeeids, $qceids, $qieids, $swLat, $swLng, $neLat, $neLng, $timestamp, 0, 0, 0, 0, $lures, $eventstops, $rocket, $quests, $dustamount, $xpamount, $quests_with_ar);
}
}
if ($reloaddustamount == "true") {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
if ($reloadxpamount == "true") {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
if (!empty($_POST['qpreids'])) {
$qpreids = !empty($_POST['qpreids']) ? array_unique(explode(",", $_POST['qpreids'])) : array();
$qpreidsDiff = array_diff($qpreids, $qpeids);
if (count($qpreidsDiff)) {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
$d["qpreids"] = $qpreids;
}
if (!empty($_POST['qereids'])) {
$qereids = !empty($_POST['qereids']) ? array_unique(explode(",", $_POST['qereids'])) : array();
$qereidsDiff = array_diff($qereids, $qeeids);
if (count($qereidsDiff)) {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
$d["qereids"] = $qereids;
}
if (!empty($_POST['qcreids'])) {
$qcreids = !empty($_POST['qcreids']) ? array_unique(explode(",", $_POST['qcreids'])) : array();
$qcreidsDiff = array_diff($qcreids, $qceids);
if (count($qcreidsDiff)) {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
$d["qcreids"] = $qcreids;
}
if (!empty($_POST['qireids'])) {
$qireids = !empty($_POST['qireids']) ? array_unique(explode(",", $_POST['qireids'])) : array();
$qireidsDiff = array_diff($qireids, $qieids);
if (count($qireidsDiff)) {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
$d["qireids"] = $qireids;
}
if (!empty($_POST['greids'])) {
$greids = !empty($_POST['greids']) ? array_unique(explode(",", $_POST['greids'])) : array();
$greidsDiff = array_diff($greids, $geids);
if (count($greidsDiff)) {
$d["pokestops"] = array_merge($d["pokestops"], $scanner->get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids, $swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $lures, $eventstops, $rocket, $quests, $dustamount, $reloaddustamount, $xpamount, $reloadxpamount, $quests_with_ar));
}
$d["greids"] = $greids;
}
}
}
$debug['3_after_pokestops'] = microtime(true) - $timing['start'];
global $noGyms, $noRaids;
if (!$noGyms || !$noRaids) {
if ($d["lastgyms"] == "true" || $raids == "true") {
$gyms = $d["lastgyms"];
$rbeids = !empty($_POST['rbeids']) ? explode(",", $_POST['rbeids']) : array();
$reeids = !empty($_POST['reeids']) ? explode(",", $_POST['reeids']) : array();
if ($lastgyms != "true") {
$d["gyms"] = $scanner->get_gyms($rbeids, $reeids, $swLat, $swLng, $neLat, $neLng, $exEligible, 0, 0, 0, 0, 0, $raids, $gyms);
} else {
if ($newarea) {
$d["gyms"] = $scanner->get_gyms($rbeids, $reeids, $swLat, $swLng, $neLat, $neLng, $exEligible, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $raids, $gyms);
} else {
$d["gyms"] = $scanner->get_gyms($rbeids, $reeids, $swLat, $swLng, $neLat, $neLng, $exEligible, $timestamp, 0, 0, 0, 0, $raids, $gyms);
}
}
if (!empty($_POST['rbreids'])) {
$rbreids = !empty($_POST['rbreids']) ? array_unique(explode(",", $_POST['rbreids'])) : array();
$rbreidsDiff = array_diff($rbreids, $rbeids);
if (count($rbreidsDiff)) {
$d["gyms"] = array_merge($d["gyms"], $scanner->get_gyms($rbeids, $reeids, $swLat, $swLng, $neLat, $neLng, $exEligible, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $raids, $gyms));
}
$d["rbreids"] = $rbreids;
}
if (!empty($_POST['rereids'])) {
$rereids = !empty($_POST['rereids']) ? array_unique(explode(",", $_POST['rereids'])) : array();
$rereidsDiff = array_diff($rereids, $reeids);
if (count($rereidsDiff)) {
$d["gyms"] = array_merge($d["gyms"], $scanner->get_gyms($rbeids, $reeids, $swLat, $swLng, $neLat, $neLng, $exEligible, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $raids, $gyms));
}
$d["rereids"] = $rereids;
}
}
}
$debug['4_after_gyms'] = microtime(true) - $timing['start'];
global $noNests;
if (!$noNests) {
if ($d["lastnests"] == "true") {
if ($lastnests != "true") {
$d["nests"] = $manual->get_nests($swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $nestavg);
} else {
if ($newarea) {
$d["nests"] = $manual->get_nests($swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $nestavg);
} else {
$d["nests"] = $manual->get_nests($swLat, $swLng, $neLat, $neLng, time(), 0, 0, 0, 0, $nestavg);
}
}
}
}
$debug['5_after_nest'] = microtime(true) - $timing['start'];
global $noCommunity;
if (!$noCommunity) {
if ($d["lastcommunities"] == "true") {
if ($lastcommunities != "true") {
$d["communities"] = $manual->get_communities($swLat, $swLng, $neLat, $neLng);
} else {
if ($newarea) {
$d["communities"] = $manual->get_communities($swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng);
} else {
$d["communities"] = $manual->get_communities($swLat, $swLng, $neLat, $neLng, time());
}
}
}
}
$debug['6_after_community'] = microtime(true) - $timing['start'];
global $noPortals;
if (!$noPortals) {
if ($d["lastportals"] == "true") {
if ($lastportals != "true") {
$d["portals"] = $manual->get_portals($swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0, $newportals);
} else {
if ($newarea) {
$d["portals"] = $manual->get_portals($swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng, $newportals);
} else {
$d["portals"] = $manual->get_portals($swLat, $swLng, $neLat, $neLng, time(), 0, 0, 0, 0, $newportals);
}
}
}
}
$debug['7_after_portals'] = microtime(true) - $timing['start'];
global $noPoi;
if (!$noPoi) {
if ($d["lastpois"] == "true") {
if ($lastpois != "true") {
$d["pois"] = $manual->get_poi($swLat, $swLng, $neLat, $neLng, 0, 0, 0, 0, 0);
} else {
if ($newarea) {
$d["pois"] = $manual->get_poi($swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng);
} else {
$d["pois"] = $manual->get_poi($swLat, $swLng, $neLat, $neLng, time(), 0, 0, 0, 0);
}
}
}
}
$debug['8_after_poi'] = microtime(true) - $timing['start'];
global $noSpawnPoints;
if (!$noSpawnPoints) {
if ($d["lastspawns"] == "true") {
if ($lastspawns != "true") {
$d["spawnpoints"] = $scanner->get_spawnpoints($swLat, $swLng, $neLat, $neLng);
} else {
if ($newarea) {
$d["spawnpoints"] = $scanner->get_spawnpoints($swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng);
} else {
$d["spawnpoints"] = $scanner->get_spawnpoints($swLat, $swLng, $neLat, $neLng, $timestamp);
}
}
}
}
$debug['9_after_spawnpoints'] = microtime(true) - $timing['start'];
// there is no device information in Golbat's database
global $noLiveScanLocation;
if (!$noLiveScanLocation && strtolower($map) !== "golbat") {
if ($d["lastscanlocations"] == "true") {
if ($newarea) {
$d["scanlocations"] = $scanner->get_scanlocation($swLat, $swLng, $neLat, $neLng, 0, $oSwLat, $oSwLng, $oNeLat, $oNeLng);
} else {
$d["scanlocations"] = $scanner->get_scanlocation($swLat, $swLng, $neLat, $neLng, $timestamp);
}
}
}
$debug['10_after_devices'] = microtime(true) - $timing['start'];
if ($loadOverviewStats == "true") {
$d["overviewStats"] = $stats->get_overview_stats();
$d["teamStats"] = $stats->get_team_stats();
$d["pokestopStats"] = $stats->get_pokestop_stats();
$d["spawnpointStats"] = $stats->get_spawnpoint_stats();
}
if ($loadPokemonStats == "true") {
$d["pokemonStats"] = $stats->get_pokemon_stats();
}
if ($loadRewardStats == "true") {
$d["rewardStats"] = $stats->get_reward_stats();
}
if ($loadShinyStats == "true") {
$d["shinyStats"] = $stats->get_shiny_stats();
}
$d['token'] = refreshCsrfToken();
$debug['11_end'] = microtime(true) - $timing['start'];
if ($enableDebug == true) {
foreach ($debug as $k => $v) {
header("X-Debug-Time-" . $k . ": " . $v);
}
}
$jaysson = json_encode($d);
echo $jaysson;