diff options
Diffstat (limited to 'src-vue')
-rw-r--r-- | src-vue/src/plugins/store.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 57406dec..edeb13df 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -38,6 +38,9 @@ export interface FlightCoreStore { northstar_is_running: boolean, origin_is_running: boolean, + player_count: number, + server_count: number, + // user custom settings mods_per_page: number, } @@ -65,6 +68,9 @@ export const store = createStore<FlightCoreStore>({ northstar_is_running: false, origin_is_running: false, + player_count: -1, + server_count: -1, + mods_per_page: 20, } }, @@ -382,6 +388,16 @@ async function _initializeApp(state: any) { // Check installed Northstar version if found await _get_northstar_version_number(state); } + + await invoke<[number, number]>("get_server_player_count") + .then((message) => { + state.player_count = message[0]; + state.server_count = message[1]; + }) + .catch((error) => { + console.warn("Failed getting player/server count"); + console.warn(error); + }); } async function _checkForFlightCoreUpdates(state: FlightCoreStore) { |