Added server list

This commit is contained in:
simon 2018-01-02 20:41:41 -05:00
parent 40afaf3d9e
commit d4732d8946
6 changed files with 164 additions and 7 deletions

View File

@ -14,7 +14,7 @@ if (isset($user)) {
<!DOCTYPE HTML>
<html>
<head>
<title>Official Game Server</title>
<title><?php echo MAR_SERVER_NAME ?></title>
<meta name="description" content="Offical Much Assembly Required game server page">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
@ -48,7 +48,7 @@ if (isset($user)) {
<nav id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<li class="current"><a href="game.php">Game</a></li>
<li class="current"><a href="servers.php">Play</a></li>
<li>
<a href="#">Account</a>
<ul>

View File

@ -10,5 +10,12 @@ define("MAR_ADDRESS", "ws://localhost:8887");
define("MAR_TICK_LENGTH", 1000);
define("MAR_SERVER_NAME", "Official MAR server");
//Servers displayed in the servers tab
define("SERVER_LIST", array(
array("<b>Official MAR Server</b>", "https://muchassemblyrequired.com/game.php", "Official Game server. Should be the most up-to-date"),
array("mlaga97's alternative server", "http://muchassemblyrequired.mlaga97.space/game.php", "<i>none</i>"),
array("Jaggernaut's backup server", "http://jaggernaut.ca/game.php", "<i>none</i>"),
));
//Plugins
//Version

View File

@ -38,7 +38,7 @@ $user = SessionManager::get();
<nav id="nav">
<ul>
<li class="current"><a href="index.php">Home</a></li>
<li><a href="game.php">Game</a></li>
<li><a href="servers.php">Play</a></li>
<li>
<a href="#">Account</a>
<ul>

View File

@ -33,7 +33,7 @@ $user = SessionManager::get();
<nav id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="game.php">Game</a></li>
<li><a href="servers.php">Play</a></li>
<li class="current">
<a href="#">Account</a>
<ul>

View File

@ -4,10 +4,14 @@
src: url("./fonts/FSEX301-L2.ttf");
}
#tabs {
padding-left: 20px;
padding-right: 10px;
}
.container {
width: 100%;
}
#game {
@ -23,7 +27,7 @@
#editor {
margin: 1em 0 1em 1em;
height: 30em;
height: 35em;
box-shadow: rgba(46, 94, 80, 0.45) 0ex 0ex 2ex;
}

146
servers.php Normal file
View File

@ -0,0 +1,146 @@
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once "include/SessionManager.php";
$user = SessionManager::get();
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Server List - Much Assembly Required</title>
<meta charset="utf-8"/>
<meta name="description"
content="Much Assembly Required is a game where you can program your robot's microprocessor in x86-like assembly language in a procedurally generated universe">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--[if lte IE 8]>
<script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.min.css"/>
<!--[if lte IE 8]>
<link rel="stylesheet" href="assets/css/ie8.min.css"/><![endif]-->
<style>
@font-face {
font-family: 'fixedsys';
src: url("./mar/fonts/FSEX301-L2.ttf");
}
</style>
</head>
<body class="homepage">
<!-- Nav -->
<nav id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<li class="current"><a href="servers.php">Play</a></li>
<li>
<a href="#">Account</a>
<ul>
<?php if ($user) { ?>
<li><a href="account.php"><?php echo $user["username"] ?></a></li>
<li><a href="logout.re.php">Logout</a></li>
<?php } else { ?>
<li><a href="login.php">login</a></li>
<?php } ?>
</ul>
</li>
</ul>
</nav>
<div id="page-wrapper">
<?php // include "header.inc.html" ?>
<!-- Main -->
<div id="main-wrapper">
<div id="main" class="container">
<div class="12u">
<style>
table {
margin: 0 0 2.25em 0;
width: 100%;
border-collapse: collapse;
border-spacing: 0;
}
table tbody tr {
border: solid 2px #f4f4f4;
border-left: 0;
border-right: 0;
}
table tbody tr:nth-child(2n + 1) {
background-color: #fafafa;
}
table td {
padding: 0.75em 0.75em;
}
table th {
color: #777;
font-size: 0.9em;
font-weight: 700;
padding: 0 0.75em 0.75em 0.75em;
text-align: left;
}
table thead {
border-bottom: solid 4px #e4e4e4;
}
table tfoot {
border-top: solid 4px #e4e4e4;
}
</style>
<h2>Server list</h2>
<table id="serverList">
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<?php
foreach (SERVER_LIST as $server) {
echo "<tr>";
echo "<td><a class='button' href='$server[1]'>$server[0]</a></td>";
echo "<td>$server[2]</td>";
echo "</tr>";
}
?>
</table>
</div>
</div>
</div>
<?php //include "footer.inc.html" ?>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.dropotron.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.min.js"></script>
<!--[if lte IE 8]>
<script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.min.js"></script>
</body>
</html>