Repositories | Polyback | Log in to see private repositories


polyback-website / ac78c54296647694d1132210737d1561aac5f7d1 / download.php

2,090 bytes | root directory

<?php require $_SERVER['DOCUMENT_ROOT'].'/api/private/core.php';

// Download page for the Polygon Player (the bootstrapper that joins games from the site).

use pizzaboxer\ProjectPolygon\PageBuilder;
use pizzaboxer\ProjectPolygon\Polygon;

$dir = Polygon::GetSharedResource("assets/clients/bootstrapper");
$builds = [
	["Windows", "polyback-player.exe", "fab fa-windows", "Windows 10 or newer (64-bit)."],
	["Linux", "polyback-player", "fab fa-linux", "A fully static 64-bit binary: works on any distribution (glibc or musl)."],
];

$pageBuilder = new PageBuilder(["title" => "Download"]);
$pageBuilder->buildHeader();
?>
<h2 class="font-weight-normal">Download the <?= SITE_CONFIG["site"]["name"] ?> Player</h2>
<p>The player installs itself, keeps the game up to date and opens games when you click Play on the site.</p>
<div class="row">
<?php foreach ($builds as [$name, $file, $icon, $note]) { $available = file_exists("$dir/$file"); ?>
	<div class="col-md-6 mb-3">
		<div class="card h-100">
			<div class="card-body text-center">
				<h4 class="font-weight-normal"><i class="<?=$icon?>"></i> <?=$name?></h4>
				<p class="text-muted mb-3"><?=$note?></p>
				<?php if ($available) { ?>
				<a class="btn btn-success px-5" href="/client-releases/bootstrapper/<?=$file?>" download>Download for <?=$name?></a>
				<p class="small text-muted mt-2 mb-0">sha256 <?=substr(hash_file("sha256", "$dir/$file"), 0, 16)?>…</p>
				<?php } else { ?>
				<button class="btn btn-secondary px-5" disabled>Coming soon</button>
				<?php } ?>
			</div>
		</div>
	</div>
<?php } ?>
</div>
<h4 class="font-weight-normal mt-3">Installing</h4>
<ul>
	<li><b>Windows:</b> run <code>polyback-player.exe</code> once. It installs for your account and registers itself for the Play button.</li>
	<li><b>Linux:</b> <code>chmod +x polyback-player &amp;&amp; ./polyback-player</code> once. It installs to <code>~/.local/share/polyback-player</code> and registers the <code>polyback-player://</code> link handler.</li>
</ul>
<p>After that, click <b>Play</b> on any game.</p>
<?php $pageBuilder->buildFooter(); ?>