-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgacha_pull.php
More file actions
30 lines (29 loc) · 1.09 KB
/
Copy pathgacha_pull.php
File metadata and controls
30 lines (29 loc) · 1.09 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
<?php
require_once __DIR__ . '/config.php';
require_once __DIR__ . '/core/Database.php';
require_once __DIR__ . '/init_check.php';
require_once __DIR__ . '/core/Session.php';
require_once __DIR__ . '/core/TokenSystem.php';
require_once __DIR__ . '/core/StockEngine.php';
require_once __DIR__ . '/core/GachaEngine.php';
require_once __DIR__ . '/core/TradingEngine.php';
require_once __DIR__ . '/core/PoolEngine.php';
require_once __DIR__ . '/core/QuestEngine.php';
require_once __DIR__ . '/core/MarketEngine.php';
require_once __DIR__ . '/adapters/manager.php';
Session::start();
require_once __DIR__ . '/core/AutoJob.php';
AutoJob::run();
Session::requireAuth();
header('Content-Type: application/json; charset=utf-8');
$input = json_decode(file_get_contents('php://input'), true) ?? [];
$type = $input['type'] ?? 'single';
$poolId = (int)($input['pool_id'] ?? 0);
if ($poolId > 0) {
// Pull from specific pool
$result = GachaEngine::pullFromPool(Session::userId(), $type, $poolId);
} else {
$result = GachaEngine::pull(Session::userId(), $type);
}
echo json_encode($result, JSON_UNESCAPED_UNICODE);
exit;