A Go-based API backend to constantly poll player statistics. In theory, compatible with any modded statistics (such as items) as well. Expects to be run directly on a file system, but can be Dockerized.
Cannot currently access through FTP.
All configuration is done through the config.json
file found in the root of the project.
{
"server_list": [
{
"server_path": "../../example-mc",
"world_name": "world"
}
],
"api": {
"default_response_limit": 5,
"max_response_limit": 100,
"default_world": "world",
"port": ":3000"
},
"polling": {
"polling_speed": 5,
"invertBlacklist": false,
"blacklist": {
"operators": false,
"banned": false,
"list": []
},
"fetch_mojang_usernames": true
}
}
-
server_list
:server_path
: The complete file path to where your Minecraft server directory is located.world_name
: The name of the Minecraft world whose statistics you want to scan.
-
api
:default_response_limit
: The default amount of statistics entries the API will return iflimit
is not specified in the query.max_response_limit
: The maximum amount of statistics entries the API will return.default_world
: The default Minecraft world that the API should return ifworld
is not specified in the query. You may leave this blank if you don't want this behavior.port
: The port the API will listen on.
-
polling
:enabled
: Controls whether polling will occur. Set to false if you wish to just serve existing statistics from the database.polling_speed
: How often (in minutes) the program should check player statistics files for changes. Recommend keeping this relatively high, as the database will store every change made to a statistic as a new row.invert_blacklist
: Turn the blacklist into a whitelist.blacklist
: UUIDs whose statistics stop being scanned into the database. Note: This will NOT remove player data already scanned inside the database.operators
: Stop logging stats from operators.banned
: Stop logging stats from banned players.list
: Arbitrary list of blacklisted UUIDs
fetch_mojang_usernames
: Allow go-mine-stat to fetch players' usernames from Mojang's API if not found in local files.
Under server_list
, you can add as many servers or worlds as you want by adding more JSON objects.
"server_list": [
{
"server_path": "../../example-mc",
"world_name": "world"
},
{
"server_path": "../../paper-mc",
"world_name": "survival"
}
]
IMPORTANT: Make sure to change the name of your Minecraft world file to a unique name, as the database stores statistics for each world using the world name. If you fail to do this, your players' statistics may get mixed together.
The API can be reached at http://localhost:3000
, which is currently not configurable yet.
// TODO: write when I feel like it