-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathzzIndexKeyIndicators.php
More file actions
40 lines (35 loc) · 1.04 KB
/
zzIndexKeyIndicators.php
File metadata and controls
40 lines (35 loc) · 1.04 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
<?php
include_once './SWUDeck/GamestateParser.php';
include_once './SWUDeck/ZoneAccessors.php';
include_once './SWUDeck/ZoneClasses.php';
include_once './Database/ConnectionManager.php';
include_once './AccountFiles/AccountDatabaseAPI.php';
include_once "./AccountFiles/AccountSessionAPI.php";
$response = new stdClass();
$error = CheckLoggedInUserMod();
if($error !== "") {
$response->error = $error;
echo json_encode($response);
exit();
}
$conn = GetLocalMySQLConnection();
for($i=12192; $i<15927; ++$i) {
$gameName = $i;
$filepath = "./SWUDeck/Games/$gameName/";
$filename = "./SWUDeck/Games/$gameName/Gamestate.txt";
if (!file_exists($filepath) || !file_exists($filename)) {
continue;
}
ParseGamestate("./SWUDeck/");
$leaderZone = &GetLeader(1);
if(count($leaderZone) > 0) {
$leader = $leaderZone[0]->CardID;
SetAssetKeyIdentifier(1, $gameName, 1, $leader, $conn);
}
$baseZone = &GetBase(1);
if(count($baseZone) > 0) {
$base = $baseZone[0]->CardID;
SetAssetKeyIdentifier(1, $gameName, 2, $base, $conn);
}
}
?>