Lodestone-Team / lodestone_core

The backend for Lodestone, A free, open source server hosting tool for Minecraft and other multiplayers
https://www.lodestone.cc/
GNU Affero General Public License v3.0
59 stars 7 forks source link

Add DependencyManager #148

Open CheatCod opened 1 year ago

CheatCod commented 1 year ago

Description

Runtime dependencies such as jre are stored under the bin directory. This is done so that multiple instances can share a dependency.

Currently, each instance directly checks for the file under the bin directory and downloads it if it's not there. This is quite error-prone and does not work well with Lodestone Atom.

The DependencyManager will be responsible for managing dependencies including registration, providing paths and deletion.

The methods are outlined as follows:

register() takes in a string id, a path to the dependency, and a map from name to paths

get() takes in a string id and returns the map from names to paths

DependencyManager should store its state to a json file under bin, and is able to restore from the file

Steps to reproduce (optional)