1.6 KiB
GrafanaPostMod
A simple mod that tracks live player counts for your BepInEx modpack.
⚠️Please Read!⚠️
This mod is for those who run bigger projects, nobody is expected to use this mod unless they like seeing cool numbers go up.
You'll need the following things in order to begin:
- An exposed server for the backend (PLEASE DO NOT EXPOSE YOUR HOME IP)
- A web domain (I suppose it's not REQUIRED if you really want to do it over IP, but never recommended)
- A Grafana instance
- A Prometheus instance
- dotnet v8.0.406
I may be willing to host backends and maybe even grant a subdomain to some modpack developers, however I cannot do this for everyone.
Building the mod
-
Modify
plugin.cson line 16. Replacehttps://stats.yourdomain.comwith the subdomain you intend on using for your backend. (Keep/api/playersthere) -
Modify
Grafana.csprojand change the Reference paths to your correct directories. You can reference the following games in order to build this project:
- Lethal Company
- Content Warning
- R.E.P.O
There may be more, but those are the ones I know off the top of my head.
- Open a terminal window in the directory of
Grafana.csprojand run:dotnet build .\Grafana.csproj
The output .dll will be in obj\Debug\netstandard2.1
Setting up the backend
Upload the backend files to a system you plan on running it on, keep in mind it needs to be public facing (I personally recommend a reverse proxy so that the IP isn't just sitting there)
-
Run
npm iin the same directory as the backend files -
Run
npm i pm2 -gthen runpm2 run ./start.sh --name PostBackendand finally runpm2 startup