Fix util
This commit is contained in:
@@ -8,23 +8,23 @@ function setJsonHeader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getIPAddress() {
|
function getIPAddress() {
|
||||||
return $_SERVER['HTTP_CF_CONNECTING_IP'];
|
return $_SERVER['REMOTE_ADDR'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function newConnection($type = 1) {
|
function newConnection($type = 1) {
|
||||||
include __DIR__.'/../config/connection.php';
|
include __DIR__.'/../config/connection.php';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$conn = new mysqli(
|
return new mysqli(
|
||||||
$type == 0 ? $games_db_host : $bd_db_host,
|
$type === 0 ? $games_db_host : $bd_db_host,
|
||||||
$type == 0 ? $games_db_user : $bd_db_user,
|
$type === 0 ? $games_db_user : $bd_db_user,
|
||||||
$type == 0 ? $games_db_pass : $bd_db_pass,
|
$type === 0 ? $games_db_pass : $bd_db_pass,
|
||||||
$type == 0 ? $games_db_name : $bd_db_name,
|
$type === 0 ? $games_db_name : $bd_db_name,
|
||||||
$type == 0 ? $games_db_port : $bd_db_port
|
$type === 0 ? $games_db_port : $bd_db_port
|
||||||
);
|
);
|
||||||
} catch (mysqli_sql_exception $e) {
|
} catch (mysqli_sql_exception $e) {
|
||||||
exitWithMessage("-999");
|
exitWithMessage("-999");
|
||||||
}
|
}
|
||||||
return $conn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getClientVersion() {
|
function getClientVersion() {
|
||||||
|
|||||||
Reference in New Issue
Block a user