<?php $version = "1.0.0.0";

$Hostname = "";
$Port = "";
$WalletToken = "";
$userId = "";
$gameId = "";
$casinoId = "";

if(isset($_REQUEST["WalletToken"]))
{
	$WalletToken = substr(json_encode($_REQUEST["WalletToken"]), 1, -1);
}

if(isset($_REQUEST["userId"]))
{
	$userId = strval($_REQUEST["userId"]);
}

if(isset($_REQUEST["gameId"]))
{
	$gameId = strval($_REQUEST["gameId"]);
}

if(isset($_REQUEST["casinoId"]))
{
	$casinoId = intval($_REQUEST["casinoId"]);
}

if(isset($_REQUEST["currency"]))
{
	 $currency = substr(json_encode($_REQUEST["currency"]), 1, -1);
	 $serverTable = file_get_contents("../ServerTable.json");
	 $serverTable = json_decode($serverTable, 1);
	
	if(isset($serverTable[$currency]))
	{
		$tokens = explode(":",$serverTable[$currency][0]);
		$Hostname = $tokens[0];
		$Port = $tokens[1];
	}
	else
	{
		$Hostname = "www.valko72.com";
        $Port = 6403;
	}
}
else 
{
	if(isset($_REQUEST["Hostname"]))
	{
		$Hostname = substr(json_encode($_REQUEST["Hostname"]), 1, -1);
	}

	if(isset($_REQUEST["Port"]))
	{
		$Port = intval($_REQUEST["Port"]);
	}
}

?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>R5 Break The Lines</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
    <link rel="shortcut icon" href="./images/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="css/labs.css" />
    <script src="./js/phaser.js?<?php echo $version?>"></script>
    <script src="./src/Long.js?<?php echo $version?>"></script>
    <script src="./src/Constants.js?<?php echo $version?>"></script>
    <script src="./src/GameSocket.js?<?php echo $version?>"></script>
    <script src="./src/Console.js?<?php echo $version?>"></script>
    <script src="./src/AnimatedAmount.js?<?php echo $version?>"></script>
    <script src="./src/Button.js?<?php echo $version?>"></script>
    <script src="./src/Checkbox.js?<?php echo $version?>"></script>
	<script src="./src/SceneButton.js?<?php echo $version?>"></script>
	<script src="./src/SceneButtonEx.js?<?php echo $version?>"></script>
	<script src="./src/SpriteEx.js?<?php echo $version?>"></script>
	<script src="./src/SceneLogo.js?<?php echo $version?>"></script>
	<script src="./src/SceneJackpots.js?<?php echo $version?>"></script>
	<script src="./src/ScenePaytable.js?<?php echo $version?>"></script>
	<script src="./src/SceneSettings.js?<?php echo $version?>"></script>
	<script src="./src/SceneSettingsMobile.js?<?php echo $version?>"></script>
	<script src="./src/SceneBar.js?<?php echo $version?>"></script>
	<script src="./src/SceneTotalWin.js?<?php echo $version?>"></script>
	<script src="./src/SceneCashbackWin.js?<?php echo $version?>"></script>
	<script src="./src/SceneJackpotWin.js?<?php echo $version?>"></script>
	<script src="./src/SceneError.js?<?php echo $version?>"></script>
    <script src="./src/Reel.js?<?php echo $version?>"></script>
    <script src="./src/Stars.js?<?php echo $version?>"></script> 
    <script src="./src/CustomSound.js?<?php echo $version?>"></script> 
    <script src="./src/ReelManager.js?<?php echo $version?>"></script>
    <script src="./src/SceneMain.js?<?php echo $version?>"></script>
    <script src="./src/Icon.js?<?php echo $version?>"></script>
    <script src="./src/SceneIcon.js?<?php echo $version?>"></script>
    <script src="./src/SceneLobby.js?<?php echo $version?>"></script>
    <script src="./src/SceneLobbyBar.js?<?php echo $version?>"></script>
</head>
<body>
	<input type="hidden" id="Hostname" value="<?php echo $Hostname?>">
	<input type="hidden" id="Port" value="<?php echo $Port?>">
	<input type="hidden" id="WalletToken" value="<?php echo $WalletToken?>">
	<input type="hidden" id="gameId" value="<?php echo $gameId?>">
	<input type="hidden" id="userId" value="<?php echo $userId?>">
	<input type="hidden" id="casinoId" value="<?php echo $casinoId?>">

	<div id="game"></div>
	<script src="./src/SceneStart.js?<?php echo $version?>"></script>

</body>
</html>