This project has been deprecated & archived, new and improved version: ModdedMinecraftClub/Mmcc.Stats.
Player count statistics tool for Minecraft server networks - tracking and displaying which servers are played.
Available at https://poller.moddedminecraft.club/.
Data Collector | ||||
---|---|---|---|---|
Web App | - | - |
This project would not possible without TraceLD/minestat-sharp which is a fork of FragLand/minestat created by TraceLD - a member of MMCC Staff Team and co-author of poller
. The modifications in TraceLD/minestat-sharp
compared to FragLand/minestat
include changing the structure to a C# Class Library packaged as a NuGet package instead of a single C# Class packaged as a standalone file, removal of obsolete code and minor refactorings.
Before moving on to deploy the poller
you will need to install the following dependencies:
-
MySQL >=8.0 or MariaDB equivalent
-
Python >=3.7
-
.NET Core >=3.0
Further steps will assume that you have the dependencies already installed.
Both the Data Collector and the Web App require a MySQL >=8.0 or MariaDB equivalent database to operate. Follow the steps below to prepare one.
-
Run the
./prepare_database.sql
script to create the MySQL/MariaDB database and tables. -
Populate the
server
table with servers you want thepoller
to poll. In theenabled
column0
meansfalse
and1
true
.
This step can be skipped by downloading the latest pre-compiled binaries from here.
To build the data collector run the prepared ./src/data_collector/buildLinux.sh
or ./src/data_collector/buildWindows.ps1
script (depending on your OS).
-
If you've built the data collector yourself go to
./src/data_collector/Build
, otherwise go to the folder to which you've unzipped the binaries that you've downloaded from the Releases page. -
Run the
dotnet ModdedMinecraftClub.Poller.App.dll <Server> <Port> <Username> <Password>
command (replace each command line argument (Server, Port, Username, Password) with your own data).
// TODO - Universal deployment process
The deployment process described below has been put together with MMCC in mind and is Linux only, so it may not apply to your server.
-
Install the following packages:
-
uwsgi
-
uwsgi-plugin-python3
-
python3-pip
-
python3-venv
-
-
Make a new
poller-web
user/group, clone the source folder in~
, then in./src/web
, where.
is root folder of this repo run:-
python3 -m venv venv
-
source venv/bin/activate
-
pip3 install -r requirements.txt
-
-
Create
/usr/lib/systemd/system/poller-web.service
:
[Unit]
Description=MMCC poller webapp
[Service]
Type=simple
User=<user>
Group=<group>
ExecStart=/usr/bin/uwsgi --ini /path/to/poller-web.ini
[Install]
WantedBy=default.target
-
Run
sudo systemctl enable --now poller-web
-
You should now see the socket in the directory with the
ini
file. Then use the followingnginx
location config:
location / {
include uwsgi_params;
uwsgi_pass unix:/path/to/poller-web.sock;
}