From 7da7eb90c6650b377397d3419b86cf3782f22eff Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Wed, 31 Dec 2025 17:15:50 -0700 Subject: [PATCH] Fix util --- incl/util.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/incl/util.php b/incl/util.php index d8f99e8..4f49566 100644 --- a/incl/util.php +++ b/incl/util.php @@ -8,23 +8,23 @@ function setJsonHeader() { } function getIPAddress() { - return $_SERVER['HTTP_CF_CONNECTING_IP']; + return $_SERVER['REMOTE_ADDR']; } function newConnection($type = 1) { include __DIR__.'/../config/connection.php'; + try { - $conn = new mysqli( - $type == 0 ? $games_db_host : $bd_db_host, - $type == 0 ? $games_db_user : $bd_db_user, - $type == 0 ? $games_db_pass : $bd_db_pass, - $type == 0 ? $games_db_name : $bd_db_name, - $type == 0 ? $games_db_port : $bd_db_port - ); + return new mysqli( + $type === 0 ? $games_db_host : $bd_db_host, + $type === 0 ? $games_db_user : $bd_db_user, + $type === 0 ? $games_db_pass : $bd_db_pass, + $type === 0 ? $games_db_name : $bd_db_name, + $type === 0 ? $games_db_port : $bd_db_port + ); } catch (mysqli_sql_exception $e) { exitWithMessage("-999"); } - return $conn; } function getClientVersion() {