ProjectZomboidReporter-Ingester

ProjectZomboidReporter-Ingester

Docker app from Natcoso9955's Repository

Overview

This is the ingester which grabs statiscs from your Project Zomboid server files and uploads them to the SQL database for the API to access. NOTE: if you havnt had a player connect to your server yet, you will get an error. If you are having issues with the database tables not being autocreated, connect to the database with adminer (or another program of your choice) and create the tables and structure with the following: USE `Zombo`; SET NAMES utf8mb4; CREATE TABLE `Game` ( `id` int NOT NULL AUTO_INCREMENT, `dayofmonth` int NOT NULL, `month` int NOT NULL, `daysSinceStart` int NOT NULL, `name` text NOT NULL, `maxPlayers` int NOT NULL, `startDay` int NOT NULL, `startMonth` int NOT NULL, `startYear` int NOT NULL, `year` int NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; CREATE TABLE `Players` ( `id` int NOT NULL AUTO_INCREMENT, `username` text NOT NULL, `charname` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `x` float NOT NULL, `y` float NOT NULL, `data` blob NOT NULL, `lastOnline` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

Discord

Zomboid-Server with -Stats-Reporter

a package that grabs information from a running project zomboid server & posts to a database to be displayed on a webpage or with a discord bot.

This package is for people that want to host their own zomboid server with a web front end. The front end is still in progress, but the reporting system that feeds data to it reads project zomboid server files and outputs them to a database every 5 minutes.

Currently output are:

  • Current Date in server
  • Days since the apocalypse began(Days Survived)
  • Player data-username+character name, & last online time for each player.
  • Config data: server name, description, etc.

Frontend

This is a simple stand-in front end to display data that was collected.

Discord

This is a small bot that will report the current date in the server. Currently, you have to create your own bot to use this code. See Setting up a bot. You only need to follow the parts on the discord site to create a bot and get the token, then paste the token into the docker compose file.

Setup Notes

run chmod 777 -R ./z on the server folder created by docker-compose so that it can be written to by services.

Reporter wont complete successfully until someone has been in game and map_t.bin has been created. map_t.bin seems to take some time for the server to create. Might be waiting for the full save time(i think 5 mins). It took about that much time playing the game fresh for it to appear.

Docker Compose

Here is a quick overview of the services in the compose file:

Frontend

The frontend is a small ReactJS page that reads from the database and displays the list of players and some game setting data.

Backend(API)

This is a small nodejs script that reads from the database for the frontend & the discord bot.

Discord Bot (Optional)

This is a discord bot that can sit in your discord server and respond with the In-Game date of your server whenever someone says "!date". You must provide it with your own Bot Token.

NGinX

This proxy combines the Frontend & the Backend into one site, where webaddress.com/api accesses the backend and webaddress.com is the frontend.

Reporter

The reporter is a php script that runs on a timer - roughly every 5 mins - and scrapes data from the Project Zomboid save files to then send to the database. So far the following are read:

SQL

This is the database that the reporter writes to, and the backend reads from.

Adminer (Optional)

This is a web interface for people to read the database. You dont need it, but if you want to see what is actually being reported, you can login to this and view the current database.

Project Zomboid

This is the Zomboid server itself.

Install ProjectZomboidReporter-Ingester on Unraid in a few clicks.

Find ProjectZomboidReporter-Ingester in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for ProjectZomboidReporter-Ingester Review the template variables and paths Click Install

Requirements

Project Zomboid

Categories

Download Statistics

654
Total Downloads

Related apps

Explore more like this

Explore all

Details

Repository
chrisashtear/zomboid-reporter
Last Updated2022-12-11
First Seen2022-03-04

Runtime arguments

Network
bridge
Shell
sh
Privileged
false
Extra Params
--restart=unless-stopped

Template configuration

ZOMBOID_SERVER_NAMEVariable

Container Variable: ZOMBOID_SERVER_NAME

Default
servertest
Value
Game_Server
Project Zomboid Server FilesPathro

Container Path: /var/www/html/sv

Target
/var/www/html/sv
Default
/mnt/user/appdata/ProjectZomboid/Zomboid/
Value
/mnt/user/appdata/ProjectZomboid/Zomboid/
SQL_HOSTVariable

Container Variable: SQL_HOST

Default
serverip:port
SQL_DATABASEVariable

Container Variable: SQL_DATABASE

Default
Zombo
Value
Zombo
SQL_USERVariable

Container Variable: SQL_USER

Value
SQL_USER
SQL_PASSVariable

Container Variable: SQL_PASSWORD

Value
SQL_PASS