diff --git a/account.php b/account.php
index 358fb2b..3f238c4 100644
--- a/account.php
+++ b/account.php
@@ -25,6 +25,7 @@ $user = SessionManager::get();
Home
Game
+ Leaderboard
Account
diff --git a/database.sql b/database.sql
index 2160a61..27d0a9d 100644
--- a/database.sql
+++ b/database.sql
@@ -9,8 +9,8 @@ flush privileges;
use mar;
-- create tables
-create table mar_user
-(
+create table mar_user (
+
username varchar(20) not null
primary key,
password tinytext not null,
@@ -18,3 +18,13 @@ create table mar_user
tokenTime datetime null,
floppyData mediumblob null
);
+
+create table mar_vault_clear (
+ id INTEGER AUTO_INCREMENT PRIMARY KEY,
+ username VARCHAR(20) NOT NULL,
+ clear_time INTEGER NOT NULL,
+ vault_id VARCHAR(20),
+
+ FOREIGN KEY (username) REFERENCES mar_user(username),
+ CONSTRAINT mar_vault_clear_uc_1 UNIQUE (username, vault_id)
+)
diff --git a/game.php b/game.php
index 9202576..9adc94e 100644
--- a/game.php
+++ b/game.php
@@ -50,6 +50,7 @@ if (isset($user)) {
Home
Play
+ Leaderboard
Account
diff --git a/index.php b/index.php
index 806cf7d..e980728 100644
--- a/index.php
+++ b/index.php
@@ -39,6 +39,7 @@ $user = SessionManager::get();
Home
Play
+ Leaderboard
Account
diff --git a/leaderboard.php b/leaderboard.php
new file mode 100644
index 0000000..e7f2722
--- /dev/null
+++ b/leaderboard.php
@@ -0,0 +1,151 @@
+
+
+
+
+
+ Server List - Much Assembly Required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Leaderboard
+
+
+
+
+ Player
+ Completed vaults
+
+
+
+ prepare("SELECT username, count(username) as clears FROM mar_vault_clear GROUP BY username ORDER BY clears DESC ");
+ $stmt->execute();
+ $users = $stmt->fetchAll();
+
+ foreach ($users as $user) {
+ echo "";
+ echo "$user[0] ";
+ echo "$user[1] ";
+
+ echo " ";
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/login.php b/login.php
index 7244ff3..9d42f53 100644
--- a/login.php
+++ b/login.php
@@ -34,6 +34,7 @@ $user = SessionManager::get();
Home
Play
+ Leaderboard
Account
diff --git a/mar/app.js b/mar/app.js
index 011006c..cb75827 100644
--- a/mar/app.js
+++ b/mar/app.js
@@ -368,12 +368,12 @@ var Debug = /** @class */ (function () {
}
Debug.setTileAt = function (x, y, newTile) {
mar.client.sendDebugCommand({ t: "debug", command: "setTileAt", x: x, y: y, newTile: newTile,
- worldX: mar.client.worldX, worldY: mar.client.worldY });
+ worldX: mar.client.worldX, worldY: mar.client.worldY, dimension: mar.client.dimension });
mar.client.requestTerrain(); //Reload terrain
};
Debug.createWorld = function (x, y, dimension) {
mar.client.sendDebugCommand({ t: "debug", command: "createWorld", worldX: x, worldY: y, dimension: dimension });
- mar.client.requestTerrain(); //Reload terrain
+ window.setTimeout(mar.client.requestTerrain, 250);
};
Debug.createWorldHex = function (x, y, dimension) {
mar.client.sendDebugCommand({ t: "debug", command: "createWorld",
@@ -420,6 +420,9 @@ var Debug = /** @class */ (function () {
mar.client.sendDebugCommand({ t: "debug", command: "spawnObj", data: data,
worldX: mar.client.worldX, worldY: mar.client.worldY, dimension: mar.client.dimension });
};
+ Debug.comPortMsg = function (objectId, message) {
+ mar.client.sendDebugCommand({ t: "debug", command: "comPortMsg", objectId: objectId, message: message });
+ };
return Debug;
}());
DEBUG = false; // todo remove
diff --git a/mar/mar.ts b/mar/mar.ts
index d01e577..9b6ccb9 100644
--- a/mar/mar.ts
+++ b/mar/mar.ts
@@ -115,14 +115,14 @@ class Debug {
public static setTileAt(x, y, newTile) {
mar.client.sendDebugCommand({t:"debug", command: "setTileAt", x: x, y: y, newTile: newTile,
- worldX: mar.client.worldX, worldY: mar.client.worldY});
+ worldX: mar.client.worldX, worldY: mar.client.worldY, dimension: mar.client.dimension});
mar.client.requestTerrain(); //Reload terrain
}
public static createWorld(x, y, dimension) {
mar.client.sendDebugCommand({t:"debug", command: "createWorld", worldX: x, worldY: y, dimension:dimension});
- mar.client.requestTerrain(); //Reload terrain
+ window.setTimeout(mar.client.requestTerrain, 250)
}
public static createWorldHex(x, y, dimension) {
@@ -180,6 +180,10 @@ class Debug {
worldX: mar.client.worldX, worldY: mar.client.worldY, dimension: mar.client.dimension});
}
+ public static comPortMsg(objectId, message) {
+ mar.client.sendDebugCommand({t:"debug", command: "comPortMsg", objectId: objectId, message: message});
+ }
+
}
DEBUG = false; // todo remove
diff --git a/servers.php b/servers.php
index 69be47d..0e190ae 100644
--- a/servers.php
+++ b/servers.php
@@ -29,6 +29,43 @@ $user = SessionManager::get();
src: url("assets/fonts/FSEX301-L2.ttf");
}
+ 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;
+ }
+
@@ -38,7 +75,8 @@ $user = SessionManager::get();
Home
- Play
+ Play
+ Leaderboard
Account
@@ -62,57 +100,16 @@ $user = SessionManager::get();
-
-
-
-
Server list
+
Server List
+
Name
Description
-
-
+
+
";
@@ -123,6 +120,8 @@ $user = SessionManager::get();
}
?>
+
+