-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGetPopupContent.php
More file actions
45 lines (39 loc) · 1.25 KB
/
GetPopupContent.php
File metadata and controls
45 lines (39 loc) · 1.25 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
<?php
include './Core/NetworkingLibraries.php';
include './Core/HTTPLibraries.php';
include './Core/CoreZoneModifiers.php';
$gameName = $_GET["gameName"];
if (!IsGameNameValid($gameName)) {
echo ("Invalid game name.");
exit;
}
$playerID = $_GET["playerID"];
$authKey = TryGet("authKey", "");
$folderPath = TryGet("folderPath", "");
$popupType = $_GET["popupType"];
$chainLinkIndex = TryGet("chainLinkIndex", "");
ob_start();
include './Core/UILibraries.php';
include './' . $folderPath . '/GamestateParser.php';
include './' . $folderPath . '/ZoneAccessors.php';
include './' . $folderPath . '/ZoneClasses.php';
include './' . $folderPath . '/GeneratedCode/GeneratedCardDictionaries.php';
ob_end_clean();
session_start();
ParseGamestate("./" . $folderPath . "/");
$cardSize = 120;
$params = explode("-", $popupType);
$popupType = $params[0];
switch ($popupType) {
default://Zone popups can be the default
$arr = &GetZone($popupType);
$popup = (count($arr) > 0 ? implode(",", $arr[0]->GetMacros()) : "") . "</>";
for($i=0; $i<count($arr); ++$i) {
if($i > 0) $popup .= "<|>";
$obj = $arr[$i];
ComputeVirtualProperties($obj);
$popup .= ClientRenderedCard($obj->CardID, cardJSON: json_encode($obj));
}
echo($popup);
break;
}