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

Commit

Permalink
add Explanetion to version.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
TOwInOK committed Mar 2, 2024
1 parent 5a21758 commit 930c4e0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
44 changes: 39 additions & 5 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ impl Config {
todo!()
}

///Function download core by info in [`Config`]
async fn download_core(self) -> Result<Option<()>, DownloadErrors> {
match self.version {
//Download purpur
Versions::Purpur(ver, freez) => {
if !freez {
//We don't need to download
Expand All @@ -90,10 +92,42 @@ impl Config {
//use if error
Err(DownloadErrors::DownloadCorrapt("ff".to_string()))
}
Versions::Paper(ver, freez) => todo!(),
Versions::Spigot(ver, freez) => todo!(),
Versions::Bucket(ver, freez) => todo!(),
Versions::Vanila(ver, freez) => todo!(),
//Download paper
Versions::Paper(ver, freez) => {
if !freez {
//We don't need to download
return Ok(None);
}
//use if error
Err(DownloadErrors::DownloadCorrapt("ff".to_string()))
},
//Download Spigot
Versions::Spigot(ver, freez) => {
if !freez {
//We don't need to download
return Ok(None);
}
//use if error
Err(DownloadErrors::DownloadCorrapt("ff".to_string()))
},
//Download Bucket
Versions::Bucket(ver, freez) => {
if !freez {
//We don't need to download
return Ok(None);
}
//use if error
Err(DownloadErrors::DownloadCorrapt("ff".to_string()))
},
//Download Vanila
Versions::Vanila(ver, freez) => {
if !freez {
//We don't need to download
return Ok(None);
}
//use if error
Err(DownloadErrors::DownloadCorrapt("ff".to_string()))
},
}
}
}
}
6 changes: 6 additions & 0 deletions src/config/version.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
use serde::{Deserialize, Serialize};

///Cores include version
///# Explanetion
///
///#### Fist string is `version`
///version can be: `latest` and string-numbers like `"1.14.4"`
///#### Second value is `freez`
///when freez is true we don't update version like `"1.1.1" (#fdf2134)` to `"1.1.1" (#fdf2154)`
#[derive(Deserialize, Serialize, Debug)]
#[serde(tag = "core", content = "version")]
pub enum Versions {
Expand Down

0 comments on commit 930c4e0

Please sign in to comment.