DayZ-Stat-Server/config.php

94 lines
2.9 KiB
PHP
Raw Normal View History

2021-01-31 13:16:02 +01:00
<?php
2021-02-01 14:30:33 +01:00
2021-02-04 20:54:45 +01:00
// ini_set("allow_url_fopen", 1);
2021-01-31 13:16:02 +01:00
2021-02-05 00:18:56 +01:00
// Need to Edit this
2021-02-05 13:16:04 +01:00
2021-02-02 23:34:59 +01:00
$ipserv = "103.58.149.102" ; // IP server game
2021-02-04 22:14:31 +01:00
$servport = "2302" ; // Game Server Port
2021-02-02 13:15:00 +01:00
$modport = "2312" ; // Mod port omega (+10)
$queryport= "27016" ; // Queryport
2021-02-04 18:00:02 +01:00
2021-02-05 13:16:04 +01:00
/*
2021-02-04 18:00:02 +01:00
$ipserv = "82.64.214.194" ; // IP server game
2021-02-04 22:14:31 +01:00
$servport = "3201" ; // Game Server Port
2021-02-04 18:00:02 +01:00
$modport = "3211" ; // Mod port omega (+10)
$queryport= "27001" ; // Queryport
2021-02-05 13:16:04 +01:00
*/
2021-02-02 23:34:59 +01:00
2021-02-01 14:38:33 +01:00
$title = "DayZ Stat SERVER Clan | by TOX" ; // Web title page
$descript = "Your Clan/server desciption"; // Your clan/server description
2021-02-05 13:56:01 +01:00
// $namemap = "chernarusplus"; // choose between: chernarusplus / livonia / namalsk/
2021-02-02 11:44:54 +01:00
$logoteam = "logoteam.png";
$imagemap = "chernarus.jpg";
2021-02-04 18:00:02 +01:00
2021-02-05 21:49:12 +01:00
2021-02-05 13:56:01 +01:00
// set the default timezone to use. Available since PHP 5.1
// https://www.php.net/manual/en/timezones.others.php
2021-02-05 21:49:12 +01:00
//date_default_timezone_set('Etc/GMT-1');
2021-02-05 13:56:01 +01:00
//$date = date('Y-m-d H:i:s');
2021-02-05 21:49:12 +01:00
2021-02-05 00:18:56 +01:00
// Don't touch below
2021-02-04 18:00:02 +01:00
2021-02-05 00:18:56 +01:00
$urlserv = $ipserv.":".$servport ;
$json = file_get_contents("http://".$ipserv.":".$modport."/"); // get info from server
2021-02-05 13:16:04 +01:00
if (!$json) {
//echo "The variable is not empty";
2021-02-05 00:18:56 +01:00
$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
2021-02-05 13:16:04 +01:00
} else {
$mods = "";
}
2021-02-05 00:18:56 +01:00
// 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'];
2021-01-31 13:16:02 +01:00
2021-02-05 13:56:01 +01:00
// 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";
2021-01-31 13:16:02 +01:00
?>