You are browsing as a guest. Sign up (or log in) to start making projects!

7h 17m 32s logged

Monicraft - Player Statistics, Asynchronous Networking & More :python:


I’ve been working hard on some big changes to make the project, faster, more reliable and visually attractive. I’ve gone ahead and implemented one of the two final changes, the statistics screen for players. It was alot of repetitive work, but I managed to make it look good. At first I wanted to parse some of the saved stats (such as play time, deaths, etc.) manually, but I came to the conclusion that formatting the tag (minecraft:damage_dealt –> Damage Dealt) and showing them was a better idea. I found some naming logic in the tags so I could filter out time, distances and damage to format them into a readable format. All distance stats end with one_cm and are stored in centimeters (1/100 of a block). All time stats contain the substring "time" and are stored in ticks (1/20 of a second). And finally all the damage stats contain the substring "damage" and are stored as 10 times the damage for more precision (or 20 times the hearts damage).


New Features:

  • Statistics screen: This screen is accessed trough the “Stats” button in the player manager and contains 3 tabs: General, Entities and Items. General contains stats like amount of jumps, distance walked and interactions with special blocks, entities shows the kill count for every entity you’ve killed and the Items tab shows how many of each item you’ve crafted, mined, used, broken, picked up and dropped.
  • Async Networking: I’ve switched from the requests library to the httpx library to make it so queries, server statuses and normal requests all operate separately.
  • UUID caching: Monicraft will now no longer have to send a request to the API to figure out someones UUID. On the first request it caches every user and their names, which are stored in usercache.json on the server, right into RAM for faster acces and less requests.
  • Small fixes and optimizations: When starting up without any credentials, it will now scan for credentials until inputted in the settings instead of crashing. The request headers are also updated when new credentials saved. I’ve fixed a logging issue with the API class which was trying to show notifications, without being part of the actual GUI. It is now fixed by passing the app class onto the API class and giving it acces to the GUI.

Future Plans:

  • Include offline players in player manager: Last real feature I want to add.
  • Finalizing and polishing: I wanna make sure everything runs bug-free, the program doesn’t crash and also make it look good on most (I can’t make it look good on all screen sizes) screen sizes. I need to build the executables and make sure they’re working.
0
5

Comments 0

No comments yet. Be the first!