aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/lib.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-01-13 17:00:31 +0100
committerGitHub <noreply@github.com>2023-01-13 17:00:31 +0100
commit5baa6a22a18970fc294710f42afcea2e5da2200d (patch)
tree3e09f5d54c2b4ba4233ba3eab4feb476449b70c0 /src-tauri/src/lib.rs
parenteb6726fb016c468d39a674cf7707f2438093db1a (diff)
downloadFlightCore-5baa6a22a18970fc294710f42afcea2e5da2200d.tar.gz
FlightCore-5baa6a22a18970fc294710f42afcea2e5da2200d.zip
feat: Add backend code for getting playercount (#135)
* feat: Initial backend code to get the playercount from the Northstar master server together with servercount * fix: Push correct backend code * feat: Load playercount on application load and show on PlayView * refactor: Store global const in separate file Moved user agent there for now * refactor: User user agent from global const * refactor: Move masterserver URL into global const * refactor: Remove temporary variable * fix: Do proper typing for playercount return value * feat: Change text if unable to load playercount So instead of showing some wrong value, we just say that we were unable to load it. * fix: Remove leftover print statement * refactor: Move struct to library source file * fix: Remove break element * fix: Remove frontend display of playercount This allows for separate PR for adding backend code early. * refactor: serverlist endpoint var to global const
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r--src-tauri/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 2df1e243..67f42f85 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -39,6 +39,12 @@ pub struct NorthstarMod {
pub directory: String,
}
+#[derive(Serialize, Deserialize, Debug, Clone)]
+pub struct NorthstarServer {
+ #[serde(rename = "playerCount")]
+ pub player_count: i32,
+}
+
/// Check version number of a mod
pub fn check_mod_version_number(path_to_mod_folder: String) -> Result<String, anyhow::Error> {
// println!("{}", format!("{}/mod.json", path_to_mod_folder));