在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):pdinklag/MinecraftStats开源软件地址(OpenSource Url):https://github.com/pdinklag/MinecraftStats开源编程语言(OpenSource Language):Python 63.8%开源软件介绍(OpenSource Introduction):MinecraftStatsMinecraftStats is a web browser application for the statistics that Minecraft servers collect about players. The presentation is done by giving awards to players for certain achievements. For example, the player who played on the server for the longest total time receives the Addict award. Every award has a viewable ranking associated to it with medals - the award holder gets the gold medal, the second the silver medal and the third the bronze medal for the award. Each medal gives players a crown score (1 for every bronze medal, 2 for every silver, 4 for every gold medal), which is displayed in a server hall of fame. The system is highly customizable. All the awards are defined in Python modules that can be altered, added or removed to fit your needs. Additionally to simply reading Minecraft's original statistics, there are some awards that are combinations of various statistics. A live demo of MinecraftStats in action is available here: DVG Snapshot Stats Feel free to join the project Discord Setup GuideThis section describes how to set up MinecraftStats to work on your server. CompatibilityMinecraftStats is compatible only to Minecraft 1.13 or later (more precisely: snapshot 17w47a or later). I am trying to keep the statistics up to date with new Minecraft versions. However, Mojang sometimes decide to rename entity or statistic IDs, which may break some awards. I am trying my best to update accordingly, but please don't hesitate to open an issue in case you notice something is wrong! RequirementsPython 3.4 or later is required to feed MinecraftStats with your server's data. InstallationI recommend using git to check out the git clone https://github.com/pdinklag/MinecraftStats.git However, downloading the repository as a zip file and unpacking it there will work as well. The web application is accessed via Updating MinecraftStatsTo update MinecraftStats to a newer version, if you are using git, the following will do the trick: git pull Otherwise, re-download the repository and overwrite any existing files. Feeding The DataThe heart of MinecraftStats is the To call the update script, simply go into the installation directory and execute the following: python3 update.py config.json When you do this for the first time, the file called You will also receive the following message:
This is because MinecraftStats does not yet know where your Minecraft server is installed. So go ahead and enter the path to your Minecraft server under the ConfigurationThe configuration JSON file supprots the following settings:
A nice commented overview with default values can also be found in Combining Multiple ServersYou can combine multiple servers (e.g., servers connected via BungeeCord) into a single stat database by listing multiple entries in the {
"server": {
"sources": [
{
"path": "/opt/minecraft/server1",
"worldName": "world1"
},
{
"path": "/opt/minecraft/server2",
"worldName": "world2"
},
],
},
} Any number of servers can be combined this way. Note that MinecraftStats will get the server name (MOTD) and icon from the first source only. Migrating Command-Line ConfigurationsIf you have been using MinecraftStats before the configuration was changed to JSON-based, you can use the python3 makeconfig.py -s /path/to/server --min-playtime 60 > config.json Note that the way how events are started and stopped has changed. You will find the new information in the Events section. TroubleshootingYou may encounter the following messages during the update:
In case you encounter any error messages and can't find an explanation, don't hesistate to open an issue. After the update, you will have a Automatic UpdatesMinecraftStats does not include any means for automatic updates - you need to take care of this yourself. CronjobsThe most common way to do it on Linux servers is by creating a cronjob that starts the update script regularly, e.g., every 10 minutes.
Typically, a cronjob for MinecraftStats will look like this:
WindowsIf you're using Windows to run your server... figure something out! There's probably some task scheduler available that you can use. FTPIn case you use FTP to transfer the JSON files to another machine before updating, please note that MinecraftStats uses a JSON file's last modified date in order to determine a player's last play time. Therefore, in order for it to function correctly, the last modified timestamps of the files need to be retained. Database StructureThe
EventsEvents allow you to track a specific award stat for a limited amount of time. You can plan events via the
When you run Event ExampleAs an example, let's consider a Halloween-themed event called "Skeleton Hunt" that tracks how many skeletons people kill between October 30, 10 o'clock in the morning and midnight of November 1. We would add the following to the config JSON: ...
"events": [
{
"name": "skeleton_hunt_2021",
"title": "Skeleton Hunt",
"stat": "kill_skeleton",
"startTime": "2021-10-30 10:00",
"endTime": "2021-01-01 00:00"
}
],
... Customizing AwardsI assume here that you have some very basic knowledge of Python, however, you may also get away without any.
Any changes will be in effect the next time Adding New AwardsFor adding a new award, follow these steps:
The MinecraftStat ClassA The ID is simply the award's internal identifier. It is used for the database and the web application also uses it to locate the award icon ( The meta information is for display in the web application. The following units are supported:
The StatReader is responsible for calculating the displayed and ranked statistic value. Most commonly, this simply reads one single entry from a player's statistics JSON, but more complex calculations are possible (e.g., summing up various statistics like for the There are various readers, the usage of which is best explained by having a close look to the existing awards. If you require new types of calculations, dig in the Modifying and Removing AwardsIn order to modify or remove an award, find the corresponding module and modify or delete it to suit your needs. Note that some awards, e.g., all the mob kill awards, are grouped into a single python file. Development NotesThis section contains some hints for those who want to develop on MinecraftStats. Web Frontend LocalizationThe web frontend is fully localized. If you cannot find your language yet, please feel very welcome to provide a localization and create a pull request! In order to add a new language, two things have to be done:
JavaScript and CSS minimizationIn an effort to reduce client traffic, the JavaScript and CSS files of the web UI are minified. The JavaScripts are minified using terser. Refer to the License and AttributionMinecraftStats is released under the Creative Commons BY-SA 4.0 license. This means you can pretty much use and modify it freely, with the only requirements being attribution and not putting it under restrictive (e.g., commercial) licenses if modified. Concerning the attribution part, the only requirement is that you provide a visible link to this original repository in your installment. The easiest way to do this is by not removing it from the |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论