first commit
This commit is contained in:
parent
c8844b03eb
commit
b6c2eb5b45
|
@ -22,7 +22,7 @@ include_once('config.php');
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<h3>☠ Players on <?php echo $namemap ;?></h3>
|
||||
<h3>☠ Players on <small style='color: grey;'> <?php echo $Info['HostName']; ?></small></h3>
|
||||
|
||||
<div id="graph32"></div>
|
||||
|
||||
|
|
|
@ -90,6 +90,31 @@ if (mysqli_query($con, $insql)) {
|
|||
echo "Error: " . $insql . "<br>" . mysqli_error($con);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if ($con->connect_error) {
|
||||
numplayers="0"
|
||||
players="0"
|
||||
ping="0"
|
||||
|
||||
// die("Connection failed: " . $con->connect_error);
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo "Connect Successfully";
|
||||
}
|
||||
|
||||
insert_mysql_down() {
|
||||
numplayers="0"
|
||||
players="0"
|
||||
ping="0"
|
||||
mysql --host=$DB_SERV --user=$DB_USER --password=$DB_PASSWD --database=$DB_NAME << EOF
|
||||
SET NAMES utf8;
|
||||
insert into $TABLE (\`date\`,\`name\`,\`game\`,\`map\`,\`version\`,\`requiredVersion\`,\`numplayers\`,\`players\`,\`maxplayers\`,\`ping\`,\`timeserver\`,\`hive\`,\`battleye\`,\`connect\`,\`secure\`) VALUES
|
||||
("$datesql","OFFLINE","$game","$map","$version","$requiredVersion","$numplayers","$players","$maxplayers","$ping","$timeserver","$hive","$battleye","$connect","$secure");
|
||||
}
|
||||
*/
|
||||
|
||||
mysqli_close($con);
|
||||
|
||||
|
||||
|
|
45
config.php
45
config.php
|
@ -2,7 +2,8 @@
|
|||
|
||||
// ini_set("allow_url_fopen", 1);
|
||||
|
||||
// Need to Edit this
|
||||
// Need to Edit this
|
||||
|
||||
/*
|
||||
$ipserv = "103.58.149.102" ; // IP server game
|
||||
$servport = "2302" ; // Game Server Port
|
||||
|
@ -10,7 +11,6 @@
|
|||
$queryport= "27016" ; // Queryport
|
||||
|
||||
*/
|
||||
|
||||
$ipserv = "82.64.214.194" ; // IP server game
|
||||
$servport = "3201" ; // Game Server Port
|
||||
$modport = "3211" ; // Mod port omega (+10)
|
||||
|
@ -19,15 +19,48 @@
|
|||
|
||||
$title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page
|
||||
$descript = "Your Clan/server desciption"; // Your clan/server description
|
||||
$namemap = "chernarusplus"; // choose between: chernarusplus / livonia / namalsk/
|
||||
// $namemap = "chernarusplus"; // choose between: chernarusplus / livonia / namalsk/
|
||||
$logoteam = "logoteam.png";
|
||||
$imagemap = "chernarus.jpg";
|
||||
|
||||
|
||||
|
||||
// Don't touch below
|
||||
|
||||
$urlserv = $ipserv.":".$servport ;
|
||||
// Don't touch below (or you know what you do)
|
||||
$urlserv = $ipserv.":".$servport ;
|
||||
// need to fix if mod = 0
|
||||
$json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server
|
||||
$objhigher = json_decode($json); //converts to an object
|
||||
$objlower = $objhigher[0]; // if the json response its multidimensional this lowers it
|
||||
$objlower = json_decode($json); //converts to an array of objects
|
||||
|
||||
// librarie SQ - info serv game
|
||||
require 'SQ_/bootstrap.php';
|
||||
use xPaw\SourceQuery\SourceQuery;
|
||||
define( 'SQ_SERVER_ADDR', "${ipserv}" ); // IP server
|
||||
define( 'SQ_SERVER_PORT', "${queryport}" ); // YOUR QUERY PORT
|
||||
define( 'SQ_TIMEOUT', 3 );
|
||||
define( 'SQ_ENGINE', SourceQuery::SOURCE );
|
||||
|
||||
$Timer = MicroTime( true );
|
||||
$Query = new SourceQuery( );
|
||||
$Info = Array( );
|
||||
$Players = Array( );
|
||||
|
||||
try
|
||||
{
|
||||
$Query->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'];
|
||||
|
||||
?>
|
||||
|
||||
|
|
|
@ -10,17 +10,16 @@
|
|||
$dbname = "database";
|
||||
$table = "StatServer_1";
|
||||
|
||||
|
||||
$StatServer = $table;
|
||||
$con = new mysqli($servdb, $userdb, $pdb, $dbname);
|
||||
|
||||
if ($con->connect_error) {
|
||||
if ($con->connect_error) {
|
||||
// Display the alert box
|
||||
// echo '<script>alert("...Connection failed with MYSQL")</script>';
|
||||
echo "<center><font color=red> ...Connection failed with MYSQL </font></center>";
|
||||
// die("Connection failed: " . $con->connect_error);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// echo "Connect Successfully";
|
||||
}
|
||||
|
||||
|
|
53
index.php
53
index.php
|
@ -10,46 +10,6 @@ $sec = "300";
|
|||
include_once('./consql.php');
|
||||
include_once('./config.php');
|
||||
|
||||
// Don't touch below (or you know what you do)
|
||||
|
||||
$urlserv = $ipserv.":".$servport ;
|
||||
// need to fix if mod = 0
|
||||
$json = file_get_contents("http://".$ipserv.":".$modport."/");
|
||||
$objhigher=json_decode($json); //converts to an object
|
||||
$objlower = $objhigher[0]; // if the json response its multidimensional this lowers it
|
||||
$objlower=json_decode($json); //converts to an array of objects
|
||||
|
||||
// librarie SQ - info serv game
|
||||
require 'SQ_/bootstrap.php';
|
||||
use xPaw\SourceQuery\SourceQuery;
|
||||
|
||||
define( 'SQ_SERVER_ADDR', "${ipserv}" ); // IP server
|
||||
define( 'SQ_SERVER_PORT', "${queryport}" ); // YOUR QUERY PORT
|
||||
define( 'SQ_TIMEOUT', 3 );
|
||||
define( 'SQ_ENGINE', SourceQuery::SOURCE );
|
||||
|
||||
$Timer = MicroTime( true );
|
||||
$Query = new SourceQuery( );
|
||||
|
||||
$Info = Array( );
|
||||
$Players = Array( );
|
||||
|
||||
try
|
||||
{
|
||||
$Query->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'];
|
||||
?>
|
||||
|
||||
|
||||
|
@ -197,9 +157,8 @@ $sec = "300";
|
|||
|
||||
<?php echo $Info['HostName'] ; ?>
|
||||
<!--<i class="flag-icon h5 flag-icon-fr"></i>-->
|
||||
|
||||
</h3>
|
||||
<h5><span style="color:grey;"><?php echo " $namemap" ?> </span></h5>
|
||||
</h3>
|
||||
<h5><span style="color:grey;"><?php echo $Info['Map']; ?> </span></h5>
|
||||
<span class="label label-<?php echo $Timer > 1.0 ? 'danger' : 'success'; ?>"><?php echo $Timer; ?>s</span>
|
||||
|
||||
</div>
|
||||
|
@ -581,7 +540,7 @@ $sec = "300";
|
|||
|
||||
<div class="col-lg-12 col-sm-16">
|
||||
<div class="card">
|
||||
<div class="card-header">Player last 24 hours</div>
|
||||
<div class="card-header">Player count last 12 hours</div>
|
||||
<div class="card-body">
|
||||
<?php include('./GraphPlayer.php'); ?>
|
||||
</div>
|
||||
|
@ -737,9 +696,9 @@ $sec = "300";
|
|||
|
||||
|
||||
<footer class="app-footer">
|
||||
<div style="text-align:center;"> <span style="text-align:center;"> © 2020 (-ToX-) - <a href="https://git.echosystem.fr/Erreur32/DayZ-Stat-Server">Dayz-server-stats</a> by <a href="">Erreur32</a> </span>
|
||||
</div>
|
||||
<div class="ml-auto"> <a href="server.json">JSON</a>
|
||||
<div style="text-align:center;"> <span style="text-align:center;"> 🆃🅾🆇 © 2020 - <a href="https://git.echosystem.fr/Erreur32/DayZ-Stat-Server">Dayz-server-stats</a> by <a href="">Erreur32</a> </span>
|
||||
</div>
|
||||
<div class="ml-auto"> <a href="server.json">JSON</a> |
|
||||
<?php
|
||||
$time = microtime();
|
||||
$time = explode(' ', $time);
|
||||
|
|
Loading…
Reference in New Issue