From 323d5f440816ae5e2fa785d4ed4e629e40c6bced Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Wed, 2 Jun 2021 17:57:56 +1200 Subject: [PATCH] Fix some crashes --- Horse Isle Server/HorseIsleServer/Server/Database.cs | 2 +- WebInterface/game-site/config.php | 2 +- WebInterface/master-site/crosserver.php | 7 ++----- WebInterface/master-site/web/header.php | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Horse Isle Server/HorseIsleServer/Server/Database.cs b/Horse Isle Server/HorseIsleServer/Server/Database.cs index 908b4ac..b98ff4f 100755 --- a/Horse Isle Server/HorseIsleServer/Server/Database.cs +++ b/Horse Isle Server/HorseIsleServer/Server/Database.cs @@ -5060,7 +5060,7 @@ namespace HISP.Server using (MySqlConnection db = new MySqlConnection(ConnectionString)) { db.Open(); - if (CheckUserExist(id)) + if (CheckUserExtExists(id)) { MySqlCommand sqlCommand = db.CreateCommand(); sqlCommand.CommandText = "UPDATE UserExt SET Money=@money WHERE Id=@id"; diff --git a/WebInterface/game-site/config.php b/WebInterface/game-site/config.php index 882fbc2..cd555f0 100755 --- a/WebInterface/game-site/config.php +++ b/WebInterface/game-site/config.php @@ -12,7 +12,7 @@ $dbhost = '127.0.0.1'; # Should be set to the same value on all game sites and the master site. # NOTE: if someone knows this secret they can login to ANYONES account # Ideally, this would be a random string of numbers, letters and symbols like 20 characters long T-T -$hmac_secret = "!!NOTSET!!"; +$hmac_secret = "!!NOTSET!!"; $master_site = "http://server.islehorse.com"; # Password for /web/admin $admin_portal_password = "!!NOTSET!!"; diff --git a/WebInterface/master-site/crosserver.php b/WebInterface/master-site/crosserver.php index e816ff8..ed5c5b2 100644 --- a/WebInterface/master-site/crosserver.php +++ b/WebInterface/master-site/crosserver.php @@ -4,7 +4,6 @@ function getNoPlayersOnlineInServer($database) { include('dbconfig.php'); $dbname = $database; - $connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'"); $onlineUsers = mysqli_query($connect, "SELECT COUNT(1) FROM OnlineUsers"); return $onlineUsers->fetch_row()[0]; @@ -14,7 +13,6 @@ function getNoSubbedPlayersOnlineInServer($database) { include('dbconfig.php'); $dbname = $database; - $connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'"); $onlineSubscribers = mysqli_query($connect, "SELECT COUNT(1) FROM OnlineUsers WHERE Subscribed = 'YES'"); return $onlineSubscribers->fetch_row()[0]; @@ -24,7 +22,6 @@ function getNoModPlayersOnlineInServer($database) { include('dbconfig.php'); $dbname = $database; - $connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'"); $onlineModerators = mysqli_query($connect, "SELECT COUNT(1) FROM OnlineUsers WHERE Moderator = 'YES' OR Admin='YES'"); return $onlineModerators->fetch_row()[0]; @@ -47,7 +44,7 @@ function userid_exists(string $database, string $userid) include('dbconfig.php'); $dbname = $database; $connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'"); - $stmt = $connect->prepare("SELECT COUNT(1) FROM Users WHERE Id=?"); + $stmt = $connect->prepare("SELECT COUNT(1) FROM Users WHERE Id=?"); $stmt->bind_param("i", $userid); $stmt->execute(); $result = $stmt->get_result(); @@ -110,4 +107,4 @@ function getNoModPlayersOnlineGlobal() } -?> \ No newline at end of file +?> diff --git a/WebInterface/master-site/web/header.php b/WebInterface/master-site/web/header.php index 1bc77a6..8cdbba0 100644 --- a/WebInterface/master-site/web/header.php +++ b/WebInterface/master-site/web/header.php @@ -3,7 +3,7 @@ if(session_status() !== PHP_SESSION_ACTIVE) session_start(); if(!function_exists('is_logged_in')) - include('common.php'); + include('../common.php'); ?> HORSE ISLE - Online Multiplayer Horse Game @@ -125,4 +125,4 @@ color: #440000;   -
\ No newline at end of file +