diff --git a/public/css/dk.css b/public/css/dk.css
index fc47fec..9d3457f 100644
--- a/public/css/dk.css
+++ b/public/css/dk.css
@@ -8,7 +8,11 @@ html {
}
body {
- background-image: url('/img/background.jpg');
+ background-image: url('/img/backgrounds/classic.jpg');
+
+ &.skin-1 {
+ background-image: url('/img/backgrounds/snowstorm.jpg');
+ }
}
div#game-container {
diff --git a/public/img/background.jpg b/public/img/backgrounds/classic.jpg
similarity index 100%
rename from public/img/background.jpg
rename to public/img/backgrounds/classic.jpg
diff --git a/public/img/backgrounds/snowstorm.jpg b/public/img/backgrounds/snowstorm.jpg
new file mode 100644
index 0000000..01e17df
Binary files /dev/null and b/public/img/backgrounds/snowstorm.jpg differ
diff --git a/src/actions/install.php b/src/actions/install.php
index 9cbfdb5..d9bbe92 100644
--- a/src/actions/install.php
+++ b/src/actions/install.php
@@ -41,6 +41,8 @@ function first()
*/
function second()
{
+ if (file_exists('../database.db')) unlink('../database.db');
+
echo "
Dragon Knight InstallationDragon Knight Installation: Page Two
";
$query = db()->exec(<<' : 'Error creating Babble Box table.';
+ echo table_status_msg($query === true, 'Babble', 'create');
$query = db()->exec(<<' : 'Error creating Control table.';
+ echo table_status_msg($query === true, 'Control', 'create');
- $query = db()->exec("INSERT INTO control VALUES (1, 'Dragon Knight', 250, 1, {$_SERVER['SERVER_NAME']}, 'noreply@'.{$_SERVER['SERVER_NAME']}, 'Mage', 'Warrior', 'Paladin', 1, 1, 1, 1);");
+ $query = db()->query("INSERT INTO control VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", [
+ 1, 'Dragon Knight', 250, 1, $_SERVER['SERVER_NAME'], 'noreply@'.$_SERVER['SERVER_NAME'],
+ 'Mage', 'Warrior', 'Paladin', 1, 1, 1, 1
+ ]);
- echo $query === true ? 'Control table populated.
' : 'Error populating Control table.';
+ echo table_status_msg($query !== false, 'Control', 'populate');
$query = db()->exec(<<' : 'Error creating Drops table.';
+ echo table_status_msg($query === true, 'Drops', 'create');
$query = db()->exec(<<' : 'Error populating Drops table.';
+ echo table_status_msg($query === true, 'Drops', 'populate');
$query = db()->exec(<<' : 'Error creating Forum table.';
+ echo table_status_msg($query === true, 'Forum', 'create');
$query = db()->exec(<<' : 'Error creating Items table.';
+ echo table_status_msg($query === true, 'Items', 'create');
$query = db()->exec(<<' : 'Error populating Items table.';
+ echo table_status_msg($query === true, 'Drops', 'populate');
$query = db()->exec(<<' : 'Error creating Levels table.';
+ echo table_status_msg($query === true, 'Levels', 'create');
$query = db()->exec(<<' : 'Error populating Levels table.';
+ echo table_status_msg($query === true, 'Levels', 'populate');
$query = db()->exec(<<' : 'Error creating Monsters table.';
+ echo table_status_msg($query === true, 'Monsters', 'create');
$query = db()->exec(<<' : 'Error populating Monsters table.';
+ echo table_status_msg($query === true, 'Monsters', 'populate');
$query = db()->exec(<<' : 'Error creating News table.';
+ echo table_status_msg($query === true, 'News', 'create');
$query = db()->exec("INSERT INTO news (content) VALUES ('This is the first news post. Please use the admin control panel to add another one and make this one go away.');");
- echo $query === true ? 'News table populated.
' : 'Error populating News table.';
+ echo table_status_msg($query === true, 'News', 'populate');
$query = db()->exec(<<' : 'Error creating Spells table.';
+ echo table_status_msg($query === true, 'Spells', 'create');
$query = db()->exec(<<' : 'Error populating Spells table.';
+ echo table_status_msg($query === true, 'Spells', 'populate');
$query = db()->exec(<<' : 'Error creating Towns table.';
+ echo table_status_msg($query === true, 'Towns', 'create');
$query = db()->exec(<<' : 'Error populating Towns table.';
+ echo table_status_msg($query === true, 'Towns', 'populate');
$query = db()->exec(<<' : 'Error creating Users table.';
+ echo table_status_msg($query === true, 'Users', 'create');
$time = round((microtime(true) - START), 4);
echo "
Database setup complete in $time seconds.
Click here to continue with installation.";
@@ -691,7 +697,7 @@ function fourth()
$form = $form['data'];
if (db()->query(
- "INSERT INTO users (username, password, email, verify, charclass, authlevel) VALUES (?, ?, ?, 1, ?, 1)",
+ "INSERT INTO users (username, password, email, verify, charclass, authlevel) VALUES (?, ?, ?, 'g2g', ?, 1)",
[$form['username'], password_hash($form['password'], PASSWORD_ARGON2ID), $form['email'], $form['charclass']]
) === false) {
exit("Failed to create user.");
@@ -742,3 +748,17 @@ function fifth()