first commit

This commit is contained in:
Erreur32 2021-02-02 15:35:59 +01:00
parent 47fd3bab62
commit e517618160
5 changed files with 57 additions and 11 deletions

View File

@ -1 +0,0 @@
/home/dayz/Dayz/server/statserver_expansion.json

View File

@ -1 +0,0 @@
/home/dayz/Dayz/server/statserver_livonia.json

View File

@ -1,12 +1,13 @@
<?php
//ini_set('display_errors', 1);
//error_reporting(E_ALL); // Display all types of error
// Read JSON file
$readjson = file_get_contents('./statserver_expansion.json');
ini_set('display_errors', 1);
error_reporting(E_ALL); // Display all types of error
set_time_limit ( 4 ); // Max execution time is set to 4 seconds
// Read JSON file
//$readjson = file_get_contents('./statserver_expansion.json');
// Load auto loader
require_once(__DIR__ . '/src/GameQ/Autoloader.php');
// Define the protocols path
@ -16,9 +17,9 @@ $protocols_path = __DIR__ . "/src/GameQ/Protocols/";
$GameQ = new \GameQ\GameQ();
$GameQ->addServer([
'type' => 'dayz',
'host' => '82.64.214.194:3201',
'host' => '82.64.214.194:3222',
'options' => [
'query_port' => 27021,
'query_port' => 27022,
],
]);
@ -47,7 +48,8 @@ $results = $GameQ->process();
echo "<hr>";
$data = json_decode($readjson);
//$data = json_decode($readjson);
$data = json_decode($GameQ);
// class
$name = $data->{'name'};
$map = $data->{'map'};
@ -75,7 +77,7 @@ $players = $data->{'players'};
//$playersuser = substr($players,0,8);
//$players = $data->{'array_filter($players)'};
//$player = $data->{'players'};
7
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

40
table.sql Normal file
View File

@ -0,0 +1,40 @@
-- Adminer 4.7.8 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
DROP DATABASE IF EXISTS `dayzstat`;
CREATE DATABASE `dayzstat` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `dayzstat`;
DROP TABLE IF EXISTS `StatServer_1`;
CREATE TABLE `StatServer_1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` datetime DEFAULT NULL,
`name` varchar(74) NOT NULL DEFAULT 'Offline',
`numplayers` varchar(4) NOT NULL DEFAULT '0',
`timeserver` varchar(12) DEFAULT NULL,
`players` varchar(32) NOT NULL DEFAULT '0',
`map` varchar(19) DEFAULT NULL,
`game` varchar(4) DEFAULT NULL,
`maxplayers` varchar(4) DEFAULT NULL,
`requiredVersion` varchar(15) DEFAULT NULL,
`version` varchar(15) DEFAULT NULL,
`battleye` tinytext DEFAULT NULL,
`hive` varchar(11) DEFAULT NULL,
`connect` varchar(32) DEFAULT NULL,
`secure` tinytext DEFAULT NULL,
`ping` varchar(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `timeserver` (`timeserver`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 2021-02-02 14:33:07

6
table_.sql Normal file
View File

@ -0,0 +1,6 @@
INSERT INTO `StatServer_1` (`id`, `date`, `name`, `numplayers`, `timeserver`, `players`, `map`, `game`, `maxplayers`, `requiredVersion`, `version`, `battleye`, `hive`, `connect`, `secure`, `ping`) VALUES
(1, '', '', '0', '', '', '', '', '', 'null', '', '', '', '', '', '');