2021-02-07 13:37:20 +01:00
# ☠ [TEAM DayZ](https://dayz.echosystem.fr) (-🆃🅾🆇-)
2021-02-03 11:40:07 +01:00
2021-02-07 13:06:56 +01:00
### Presents
2021-01-31 19:09:32 +01:00
2021-02-07 13:37:20 +01:00
2021-02-07 13:35:02 +01:00
![](https://git.echosystem.fr/Erreur32/DayZ-Stat-Server/raw/master/img/DayZStats.png)
2021-01-31 13:16:02 +01:00
2021-02-06 19:49:01 +01:00
# 📈 Simple live Stat for Dayz Standalone server.
2021-02-07 00:46:12 +01:00
Inspired by the *Excelent* __Omega manager__ .
2021-02-04 22:30:40 +01:00
> *The [OmegaManager](https://cftools.de/) is a local application to run your DayZ servers. It automatically deploys, runs, watches, restarts and updates your server.*
2021-02-01 18:41:36 +01:00
2021-02-04 23:42:11 +01:00
This page will show your **DayZ server live stat** . It's working with directly on editing **config.php** file and if you have crontab and sql you can have some graph.
2021-01-31 13:16:02 +01:00
2021-02-06 19:49:01 +01:00
> [example live page](https://dayz.echosystem.fr/git-DayZ-server-stat/)
2021-02-04 23:42:11 +01:00
## Installation
2021-02-04 22:36:07 +01:00
2021-02-04 23:42:11 +01:00
### #1 Download Archive
2021-02-04 22:36:07 +01:00
2021-02-06 16:05:37 +01:00
- Download lastest archive https://git.echosystem.fr/Erreur32/DayZ-Stat-Server/archive/0.32.zip
2021-02-04 22:36:07 +01:00
2021-02-06 16:05:37 +01:00
2021-02-07 00:41:57 +01:00
#### or Use the lastest version with git
>
git clone https://git.echosystem.fr/Erreur32/DayZ-Stat-Server.git
2021-02-03 11:26:47 +01:00
2021-02-04 23:42:11 +01:00
### #2 Configuration Required
2021-01-31 13:16:02 +01:00
2021-02-06 13:51:08 +01:00
- Set the *config.php* file in *config* directory and fill your `ip` , `port` , `query` and `omega server port mod` .
2021-02-06 14:54:14 +01:00
2021-02-07 00:41:57 +01:00
#### edit config/config.php
>
$ipserv = "6.6.6.6"; // IP server game
$portserv = "2302" ; // Game Server Port
$modport = "2312" ; // Mod port omega (+10)
$queryport= "27016"; // Queryport
2021-02-01 18:48:19 +01:00
2021-02-04 22:36:07 +01:00
- Omega manager (to check list mod only, but higly suggered !)
2021-02-01 18:41:36 +01:00
2021-02-04 23:42:11 +01:00
### #3 Create SQL `dayzstat` database and insert SQL/table.sql .
- mysql database (to store status server for graph)
Create `dayzstat` database first + user privilege. Checkout Schema database in SQL/table.sql
2021-02-06 16:05:37 +01:00
2021-02-07 00:41:57 +01:00
#### edit config/consql.php
>
> -- Adminer 4.7.8 MySQL dump
>
> SET NAMES utf8;
> SET foreign_key_checks = 0;
> SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
>
> SET NAMES utf8mb4;
>
> CREATE TABLE `StatServer_5` (
> `id` int(11) NOT NULL AUTO_INCREMENT,
> `date` datetime DEFAULT NULL ON UPDATE current_timestamp(),
> `name` varchar(74) NOT NULL DEFAULT 'Offline',
> `players` varchar(32) NOT NULL DEFAULT '0',
> `maxplayers` varchar(4) DEFAULT NULL,
> `map` varchar(19) DEFAULT NULL,
> `game` varchar(4) DEFAULT NULL,
> `version` varchar(15) DEFAULT NULL,
> `timeserver` varchar(12) DEFAULT NULL,
> `timespeed` varchar(5) DEFAULT NULL,
> `timespeedn` varchar(5) DEFAULT NULL,
> `mod` varchar(5) DEFAULT NULL,
> `battleye` tinytext DEFAULT NULL,
> `hive` varchar(11) DEFAULT NULL,
> `connect` varchar(32) DEFAULT NULL,
> `secure` tinytext DEFAULT NULL,
> `ping` varchar(3) DEFAULT '0',
> PRIMARY KEY (`id`),
> KEY `timeserver` (`timeserver`),
> KEY `date` (`date`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
>
>
> -- 2021-02-05 10:22:08
2021-02-04 23:42:11 +01:00
2021-02-06 13:51:08 +01:00
- **2 Differents way for your crontab** with Shell or php (recommended).
2021-02-04 23:42:11 +01:00
### #4 Crontab to fill Database.
2021-02-01 18:41:36 +01:00
2021-02-07 00:46:12 +01:00
> #### For Shell (SQL insert + json)
> */5 * * * * /usr/sbin/sh /pathto/config/statserver_json.sh &>/dev/null
2021-02-04 23:42:11 +01:00
2021-02-05 23:27:57 +01:00
OR (recommended)
2021-02-01 18:41:36 +01:00
2021-02-07 00:46:12 +01:00
> #### For php (SQL insert)
> */5 * * * * /usr/local/bin/php -f /yourpath.../config/dayz2json_parser_sql.php &>/dev/null
2021-02-07 13:17:15 +01:00
>
2021-02-01 14:45:18 +01:00
2021-02-07 13:17:15 +01:00
tips change __ & >/dev/null__ to __2>&1__ to know what is going on, maybe spam your mail log.
2021-02-04 23:02:00 +01:00
2021-02-07 13:17:15 +01:00
Check your time zone here. https://www.php.net/manual/en/timezones.others.php and adapt in dayz2json_parser_sql.php.
2021-02-04 18:10:15 +01:00
2021-01-31 13:16:02 +01:00
2021-02-04 23:42:11 +01:00
## Et Voilà !
ENJOY :)
2021-02-03 11:26:47 +01:00
2021-02-04 22:14:31 +01:00
2021-02-03 11:26:47 +01:00
### TODO
2021-02-05 23:27:57 +01:00
- Need to finish SQL part for stat USER NAME ;)
2021-02-04 22:30:40 +01:00
- Admin section with usefull info from your log server.
2021-02-03 11:26:47 +01:00
2021-02-01 18:48:19 +01:00
### Library used:
2021-01-31 13:16:02 +01:00
2021-02-07 00:41:57 +01:00
>
2021-02-04 23:42:11 +01:00
> [PHP-Source-Query](https://github.com/xPaw/PHP-Source-Query) - PHP library to query servers that implement Steam query protocol (also known as Source Engine Query protocol)
2021-02-06 14:54:14 +01:00
>
2021-02-07 00:41:57 +01:00
> [Morris](https://morrisjs.github.io/morris.js/) - PHP library to generate graph.
2021-02-01 18:41:36 +01:00
2021-02-01 18:48:19 +01:00
2021-01-31 13:36:35 +01:00
2021-02-01 18:50:33 +01:00
### sample:
2021-01-31 13:44:49 +01:00
2021-02-07 00:41:57 +01:00
> [example live page](https://dayz.echosystem.fr/git-DayZ-server-stat/)
2021-01-31 13:43:54 +01:00
2021-02-07 15:39:22 +01:00
![https://git.echosystem.fr/Erreur32/DayZ-Stat-Server/raw/master/asset/Screenshot_2021-02.png ](https://git.echosystem.fr/Erreur32/DayZ-Stat-Server/raw/master/asset/Screenshot_2021-02.png )
2021-02-06 19:49:01 +01:00
# Author : Erreur32
2021-01-31 13:16:02 +01:00
2021-02-07 13:35:02 +01:00
![https://dayz.echosystem.fr ](https://git.echosystem.fr/Erreur32/DayZ-Stat-Server/raw/master/img/DayZStats.png )
2021-01-31 13:16:02 +01:00
Website: [dayz.echosystem.fr ](https://dayz.echosystem.fr )
2021-02-06 19:49:01 +01:00