From b762dfd4b286f2a7842d5342ac8a6863538759c9 Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Sat, 6 Feb 2021 13:35:09 +0100 Subject: [PATCH] first commit --- GraphPlayer.php | 4 +- SQL/config.php | 133 +++++++++++++++++++++++++++++++++++++++++++++++- SQL/consql.php | 32 +++++++++++- config.php | 132 ----------------------------------------------- consql.php | 31 ----------- index.php | 4 +- 6 files changed, 167 insertions(+), 169 deletions(-) mode change 120000 => 100644 SQL/config.php mode change 120000 => 100644 SQL/consql.php delete mode 100644 config.php delete mode 100644 consql.php diff --git a/GraphPlayer.php b/GraphPlayer.php index 894fbf0..fa79d93 100755 --- a/GraphPlayer.php +++ b/GraphPlayer.php @@ -2,8 +2,8 @@ //ini_set('display_errors', 'on'); -include('./consql.php'); -include_once('config.php'); +include_once('SQL/consql.php'); +include_once('SQL/config.php'); // MYSQL table // $StatServer = "StatServer_20"; // set in consql.php diff --git a/SQL/config.php b/SQL/config.php deleted file mode 120000 index 4ad2f86..0000000 --- a/SQL/config.php +++ /dev/null @@ -1 +0,0 @@ -../config.php \ No newline at end of file diff --git a/SQL/config.php b/SQL/config.php new file mode 100644 index 0000000..30a352c --- /dev/null +++ b/SQL/config.php @@ -0,0 +1,132 @@ +Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); + $Info = $Query->GetInfo( ); + $Players = $Query->GetPlayers( ); + } + catch( Exception $e ) + { + $Exception = $e; + } + + $Query->Disconnect( ); + $Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' ); + $InfoGT = $Info['GameTags']; + + + // DEBUG + /* print_r($Info); */ + + // Variables + + $HostName = $Info['HostName'] ; + $Game = $Info['ModDesc'] ; + $Version = $Info['Version'] ; + $PLayers = $Info['Players']; + $MaxPlayers = $Info['MaxPlayers'] ; + $Secure = $Info['Secure'] ; + $Map = $Info['Map']; + $Os = $Info['Os'] ; + $GamePort = $Info['GamePort'] ; + $GameID = $Info['GameID'] ; + $ping = "666"; +// $mods = "0"; + +// REGEX de la mort. + +// time server +$regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/"; +$result = preg_grep($regtimsev, explode(",", $InfoGT)); + foreach ($result as $key => $val) { $timeserver = $val; } + +// speedtime dayz +$regtimeacc = "/etm[0-9]{1,2}[.][0-9]{1}/"; +$result = preg_grep($regtimeacc, explode(",", $InfoGT)); + foreach ($result as $key => $val) { $timespeed = trim($val,"entm.0"); } + +// speedtime night +$regtimeacn = "/entm[0-9]{1,2}[.][0-9]{1}/"; +$result = preg_grep($regtimeacn, explode(",", $InfoGT)); + foreach ($result as $key => $val) { $timespeedn = trim($val,"entm.0"); } + +// HIVE +$reghive = '/[^,]...(Hive)/'; +$result = preg_grep($reghive, explode(",", $InfoGT)); + foreach ($result as $key => $val) { $hive = $val; } + +// battleye +$regbattle = "/(battleye)/"; +$result = preg_grep($regbattle, explode(",", $InfoGT)); + foreach ($result as $key => $val) { $battleye = $val; } + +// mod +$regmod = "/(mod)/"; +$result = preg_grep($regmod, explode(",", $InfoGT)); + foreach ($result as $key => $val) { $mods = $val; } + + +?> + diff --git a/SQL/consql.php b/SQL/consql.php deleted file mode 120000 index 3c7d9a3..0000000 --- a/SQL/consql.php +++ /dev/null @@ -1 +0,0 @@ -../consql.php \ No newline at end of file diff --git a/SQL/consql.php b/SQL/consql.php new file mode 100644 index 0000000..62e954a --- /dev/null +++ b/SQL/consql.php @@ -0,0 +1,31 @@ +connect_error) { + // Display the alert box + // echo ''; + echo "
...Connection failed with MYSQL
"; + // die("Connection failed: " . $con->connect_error); + } else { + // echo "Connect Successfully"; + } + + +?> diff --git a/config.php b/config.php deleted file mode 100644 index 30a352c..0000000 --- a/config.php +++ /dev/null @@ -1,132 +0,0 @@ -Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); - $Info = $Query->GetInfo( ); - $Players = $Query->GetPlayers( ); - } - catch( Exception $e ) - { - $Exception = $e; - } - - $Query->Disconnect( ); - $Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' ); - $InfoGT = $Info['GameTags']; - - - // DEBUG - /* print_r($Info); */ - - // Variables - - $HostName = $Info['HostName'] ; - $Game = $Info['ModDesc'] ; - $Version = $Info['Version'] ; - $PLayers = $Info['Players']; - $MaxPlayers = $Info['MaxPlayers'] ; - $Secure = $Info['Secure'] ; - $Map = $Info['Map']; - $Os = $Info['Os'] ; - $GamePort = $Info['GamePort'] ; - $GameID = $Info['GameID'] ; - $ping = "666"; -// $mods = "0"; - -// REGEX de la mort. - -// time server -$regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/"; -$result = preg_grep($regtimsev, explode(",", $InfoGT)); - foreach ($result as $key => $val) { $timeserver = $val; } - -// speedtime dayz -$regtimeacc = "/etm[0-9]{1,2}[.][0-9]{1}/"; -$result = preg_grep($regtimeacc, explode(",", $InfoGT)); - foreach ($result as $key => $val) { $timespeed = trim($val,"entm.0"); } - -// speedtime night -$regtimeacn = "/entm[0-9]{1,2}[.][0-9]{1}/"; -$result = preg_grep($regtimeacn, explode(",", $InfoGT)); - foreach ($result as $key => $val) { $timespeedn = trim($val,"entm.0"); } - -// HIVE -$reghive = '/[^,]...(Hive)/'; -$result = preg_grep($reghive, explode(",", $InfoGT)); - foreach ($result as $key => $val) { $hive = $val; } - -// battleye -$regbattle = "/(battleye)/"; -$result = preg_grep($regbattle, explode(",", $InfoGT)); - foreach ($result as $key => $val) { $battleye = $val; } - -// mod -$regmod = "/(mod)/"; -$result = preg_grep($regmod, explode(",", $InfoGT)); - foreach ($result as $key => $val) { $mods = $val; } - - -?> - diff --git a/consql.php b/consql.php deleted file mode 100644 index 62e954a..0000000 --- a/consql.php +++ /dev/null @@ -1,31 +0,0 @@ -connect_error) { - // Display the alert box - // echo ''; - echo "
...Connection failed with MYSQL
"; - // die("Connection failed: " . $con->connect_error); - } else { - // echo "Connect Successfully"; - } - - -?> diff --git a/index.php b/index.php index b66be1b..01851ed 100644 --- a/index.php +++ b/index.php @@ -7,8 +7,8 @@ $sec = "300"; //ini_set('display_errors', 'on'); //error_reporting(E_ALL); // Display all types of error - include_once('./consql.php'); - include_once('./config.php'); + include_once('SQL/consql.php'); + include_once('SQL/config.php'); ?>