first commit
This commit is contained in:
parent
350f0757c5
commit
1f1489237b
6 changed files with 25 additions and 23 deletions
|
@ -42,6 +42,7 @@ $Os = $Info['Os'] ;
|
||||||
$GamePort = $Info['GamePort'] ;
|
$GamePort = $Info['GamePort'] ;
|
||||||
$GameID = $Info['GameID'] ;
|
$GameID = $Info['GameID'] ;
|
||||||
$ping = "666";
|
$ping = "666";
|
||||||
|
$mods = "0";
|
||||||
|
|
||||||
// if server down update sql
|
// if server down update sql
|
||||||
if (empty($Info['HostName'])) {
|
if (empty($Info['HostName'])) {
|
||||||
|
@ -54,8 +55,11 @@ $timespeed ="0";
|
||||||
$timespeedn="0";
|
$timespeedn="0";
|
||||||
$hive ="0";
|
$hive ="0";
|
||||||
$battleye ="0";
|
$battleye ="0";
|
||||||
|
$mods ="0";
|
||||||
|
$timespeed ="0";
|
||||||
|
$timespeedn="0";
|
||||||
|
|
||||||
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$Players','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$battleye','$hive','$urlserv','$Secure','$ping')";
|
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,mods,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$Players','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$mods','$battleye','$hive','$urlserv','$Secure','$ping')";
|
||||||
|
|
||||||
if (mysqli_query($con, $insql)) {
|
if (mysqli_query($con, $insql)) {
|
||||||
// echo "New record created successfully";
|
// echo "New record created successfully";
|
||||||
|
@ -63,12 +67,10 @@ $insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,time
|
||||||
echo "Error: " . $insql . "<br>" . mysqli_error($con);
|
echo "Error: " . $insql . "<br>" . mysqli_error($con);
|
||||||
}
|
}
|
||||||
|
|
||||||
//mysqli_close($con);
|
mysqli_close($con);
|
||||||
exit ;
|
//exit ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// REGEX TIME
|
// REGEX TIME
|
||||||
$regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/";
|
$regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/";
|
||||||
$result = preg_grep($regtimsev, explode(",", $InfoGT));
|
$result = preg_grep($regtimsev, explode(",", $InfoGT));
|
||||||
|
@ -82,13 +84,7 @@ $regtimeacn = "/([0-9][.][0-9]{1})/";
|
||||||
$result = preg_grep($regtimeacn, explode(",", $InfoGT));
|
$result = preg_grep($regtimeacn, explode(",", $InfoGT));
|
||||||
$timespeedn = $result[6];
|
$timespeedn = $result[6];
|
||||||
|
|
||||||
// DEBUG
|
|
||||||
$timespeed="2";
|
|
||||||
$timespeedn="4";
|
|
||||||
|
|
||||||
|
|
||||||
// HIVE
|
// HIVE
|
||||||
//$result = explode(",", $InfoGT);
|
|
||||||
$reghive = '/[^,]...(Hive)/';
|
$reghive = '/[^,]...(Hive)/';
|
||||||
$result = preg_grep($reghive, explode(",", $InfoGT));
|
$result = preg_grep($reghive, explode(",", $InfoGT));
|
||||||
$hive = $result[2];
|
$hive = $result[2];
|
||||||
|
@ -98,9 +94,12 @@ $regbattle = "/(battleye)/";
|
||||||
$result = preg_grep($regbattle, explode(",", $InfoGT));
|
$result = preg_grep($regbattle, explode(",", $InfoGT));
|
||||||
$battleye = $result[0];
|
$battleye = $result[0];
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
$timespeed="2";
|
||||||
|
$timespeedn="4";
|
||||||
|
|
||||||
// SQL insert Query.
|
// SQL insert Query.
|
||||||
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$Players','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$battleye','$hive','$urlserv','$Secure','$ping')";
|
$insql = "INSERT INTO $table (date,name,players,maxplayers,map,game,version,timeserver,timespeed,timespeedn,mods,battleye,hive,connect,secure,ping) VALUES ('$date','$HostName','$Players','$MaxPlayers','$Map','$Game','$Version','$timeserver','$timespeed','$timespeedn','$mods','$battleye','$hive','$urlserv','$Secure','$ping')";
|
||||||
|
|
||||||
// Check if errors with SQL query
|
// Check if errors with SQL query
|
||||||
if (mysqli_query($con, $insql)) {
|
if (mysqli_query($con, $insql)) {
|
||||||
|
|
|
@ -74,9 +74,9 @@ echo "<h1>Payes ta regex</h1>";
|
||||||
echo "<pre>".$InfoGT."</pre>";
|
echo "<pre>".$InfoGT."</pre>";
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
|
|
||||||
$result = explode(",", $InfoGT);
|
//$result = explode(",", $InfoGT);
|
||||||
print_r($result);
|
//print_r($result);
|
||||||
echo "<br> 2222222";
|
echo "<br> ";
|
||||||
|
|
||||||
$re = '/[^,]...(Hive)/';
|
$re = '/[^,]...(Hive)/';
|
||||||
$rt = preg_grep($re, array($InfoGT));
|
$rt = preg_grep($re, array($InfoGT));
|
||||||
|
|
|
@ -24,6 +24,7 @@ CREATE TABLE `StatServer_5` (
|
||||||
`timeserver` varchar(12) DEFAULT NULL,
|
`timeserver` varchar(12) DEFAULT NULL,
|
||||||
`timespeed` varchar(5) DEFAULT NULL,
|
`timespeed` varchar(5) DEFAULT NULL,
|
||||||
`timespeedn` varchar(5) DEFAULT NULL,
|
`timespeedn` varchar(5) DEFAULT NULL,
|
||||||
|
`mod` varchar(5) DEFAULT NULL,
|
||||||
`battleye` tinytext DEFAULT NULL,
|
`battleye` tinytext DEFAULT NULL,
|
||||||
`hive` varchar(11) DEFAULT NULL,
|
`hive` varchar(11) DEFAULT NULL,
|
||||||
`connect` varchar(32) DEFAULT NULL,
|
`connect` varchar(32) DEFAULT NULL,
|
||||||
|
@ -34,6 +35,5 @@ CREATE TABLE `StatServer_5` (
|
||||||
KEY `date` (`date`)
|
KEY `date` (`date`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- 2021-02-02 14:33:07
|
|
||||||
|
|
||||||
|
|
||||||
|
-- 2021-02-05 10:22:08
|
||||||
|
|
12
config.php
12
config.php
|
@ -4,18 +4,18 @@
|
||||||
|
|
||||||
// Need to Edit this
|
// Need to Edit this
|
||||||
|
|
||||||
/*
|
|
||||||
$ipserv = "103.58.149.102" ; // IP server game
|
$ipserv = "103.58.149.102" ; // IP server game
|
||||||
$servport = "2302" ; // Game Server Port
|
$servport = "2302" ; // Game Server Port
|
||||||
$modport = "2312" ; // Mod port omega (+10)
|
$modport = "2312" ; // Mod port omega (+10)
|
||||||
$queryport= "27016" ; // Queryport
|
$queryport= "27016" ; // Queryport
|
||||||
|
|
||||||
*/
|
/*
|
||||||
$ipserv = "82.64.214.194" ; // IP server game
|
$ipserv = "82.64.214.194" ; // IP server game
|
||||||
$servport = "3201" ; // Game Server Port
|
$servport = "3201" ; // Game Server Port
|
||||||
$modport = "3211" ; // Mod port omega (+10)
|
$modport = "3211" ; // Mod port omega (+10)
|
||||||
$queryport= "27001" ; // Queryport
|
$queryport= "27001" ; // Queryport
|
||||||
|
*/
|
||||||
|
|
||||||
$title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page
|
$title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page
|
||||||
$descript = "Your Clan/server desciption"; // Your clan/server description
|
$descript = "Your Clan/server desciption"; // Your clan/server description
|
||||||
|
@ -29,10 +29,14 @@
|
||||||
$urlserv = $ipserv.":".$servport ;
|
$urlserv = $ipserv.":".$servport ;
|
||||||
// need to fix if mod = 0
|
// need to fix if mod = 0
|
||||||
$json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server
|
$json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server
|
||||||
|
if (!$json) {
|
||||||
|
//echo "The variable is not empty";
|
||||||
$objhigher = json_decode($json); //converts to an object
|
$objhigher = json_decode($json); //converts to an object
|
||||||
$objlower = $objhigher[0]; // if the json response its multidimensional this lowers it
|
$objlower = $objhigher[0]; // if the json response its multidimensional this lowers it
|
||||||
$objlower = json_decode($json); //converts to an array of objects
|
$objlower = json_decode($json); //converts to an array of objects
|
||||||
|
} else {
|
||||||
|
$mods = "";
|
||||||
|
}
|
||||||
// librarie SQ - info serv game
|
// librarie SQ - info serv game
|
||||||
require 'SQ_/bootstrap.php';
|
require 'SQ_/bootstrap.php';
|
||||||
use xPaw\SourceQuery\SourceQuery;
|
use xPaw\SourceQuery\SourceQuery;
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
$table = "StatServer_1";
|
$table = "StatServer_1";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$StatServer = $table;
|
$StatServer = $table;
|
||||||
$con = new mysqli($servdb, $userdb, $pdb, $dbname);
|
$con = new mysqli($servdb, $userdb, $pdb, $dbname);
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,9 @@ $sec = "300";
|
||||||
$time = $time[1] + $time[0];
|
$time = $time[1] + $time[0];
|
||||||
$start = $time;
|
$start = $time;
|
||||||
|
|
||||||
|
|
||||||
if (empty($Info['HostName'])) {
|
if (empty($Info['HostName'])) {
|
||||||
$Info['HostName'] = "<h1>OFF LINE</h1>" ;
|
$Info['HostName'] = "<h1>OFF LINE</h1>" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<main class="main" style="margin-top: 10px">
|
<main class="main" style="margin-top: 10px">
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue