Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…troller

merger + fix
  • Loading branch information
TOwInOK committed Apr 4, 2024
2 parents cc7ae0d + 3b989df commit 871a605
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
14 changes: 14 additions & 0 deletions config.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "1.20.4"
build = "2165"
path = "core/purpur.jar"

<<<<<<< HEAD
[plugins.chunky]
version = "iwsbfPGg"
path = "plugins/chunky.jar"
Expand All @@ -15,3 +16,16 @@ path = "plugins/simple-voice-chat.jar"
[plugins.itemswapper]
version = "UKVc6pCj"
path = "plugins/itemswapper.jar"
=======
[plugins.simple-voice-chat]
version = "WvPmSPnl"
path = "plugins/simple-voice-chat.jar"

[plugins.itemswapper]
version = "UKVc6pCj"
path = "plugins/itemswapper.jar"

[plugins.chunky]
version = "iwsbfPGg"
path = "plugins/chunky.jar"
>>>>>>> 3b989df40d7b47f4ec089cca7bd3753d57fe090e
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ key = "SUPEREKLy"
path_to_core = "core"
# path_to_mods = ""
path_to_plugins = "plugins"
path_to_configs = "config.lock"
path_to_lock = "config.lock"
20 changes: 10 additions & 10 deletions src/downloader/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod hash;
mod models;

use crate::config::core::Provider;
use crate::config::core::{Core, Provider};
use crate::config::plugins::{Plugin, Sources};
use crate::config::Config;
use crate::downloader::models::cores::folia::Folia;
Expand Down Expand Up @@ -44,25 +44,25 @@ impl<'config, 'lock> Downloader<'config, 'lock> {
/////Core section

///Check core and add it into list for download.
async fn get_core_link(&self) -> Result<(String, ChooseHash, String), DownloadErrors> {
async fn get_core_link(core: &Core) -> Result<(String, ChooseHash, String), DownloadErrors> {
info!("Start to match provider of core");
match self.config.core.provider {
Provider::Vanilla => Vanilla::get_link(&self.config.core).await,
Provider::Paper => Paper::get_link(&self.config.core).await,
Provider::Folia => Folia::get_link(&self.config.core).await,
Provider::Purpur => Purpur::get_link(&self.config.core).await,
match core.provider {
Provider::Vanilla => Vanilla::get_link(core).await,
Provider::Paper => Paper::get_link(core).await,
Provider::Folia => Folia::get_link(core).await,
Provider::Purpur => Purpur::get_link(core).await,
Provider::Fabric => todo!(),
Provider::Forge => todo!(),
Provider::NeoForge => todo!(),
Provider::Waterfall => Waterfall::get_link(&self.config.core).await,
Provider::Velocity => Velocity::get_link(&self.config.core).await,
Provider::Waterfall => Waterfall::get_link(core).await,
Provider::Velocity => Velocity::get_link(core).await,
}
}

/// Make reqwest to check version and download core.
async fn core_reqwest(&mut self) -> Result<(), DownloadErrors> {
//Find version to download
let (link, hash, version) = self.get_core_link().await?;
let (link, hash, version) = Self::get_core_link(&self.config.core).await?;
let core_name = self.config.core.provider.get_name().await;
debug!("Find {} link: {}, hash: {}", core_name, &link, &hash);
info!("Start to download {}!", core_name);
Expand Down

0 comments on commit 871a605

Please sign in to comment.