@@ -19,6 +19,7 @@ use std::collections::HashMap;
1919use tokio:: sync:: mpsc;
2020use tracing:: { debug, error, instrument} ;
2121
22+ use crate :: cli:: Cli ;
2223use crate :: {
2324 action:: Action ,
2425 cloud_worker:: Cloud ,
@@ -100,15 +101,17 @@ pub struct App {
100101}
101102
102103impl App {
103- pub fn new ( tick_rate : f64 , frame_rate : f64 , cloud_name : Option < String > ) -> Result < Self > {
104+ pub fn new ( args : & Cli ) -> Result < Self > {
104105 let config = Config :: new ( ) ?;
105106 let mode = Mode :: Home ;
106107 let ( action_tx, action_rx) = mpsc:: unbounded_channel ( ) ;
107108
108109 let ( cloud_worker, mut cloud_worker_receiver) = mpsc:: unbounded_channel ( ) ;
109110 let cloud_worker_app_tx = action_tx. clone ( ) ;
111+ let client_config = args. os_client_config_file . clone ( ) ;
112+ let client_secure_config = args. os_client_secure_file . clone ( ) ;
110113 tokio:: spawn ( async move {
111- let mut cloud = Cloud :: new ( ) ;
114+ let mut cloud = Cloud :: new ( client_config , client_secure_config ) ;
112115 cloud
113116 . run ( cloud_worker_app_tx, & mut cloud_worker_receiver)
114117 . await
@@ -194,8 +197,8 @@ impl App {
194197 components. insert ( Mode :: NetworkSubnets , Box :: new ( NetworkSubnets :: new ( ) ) ) ;
195198
196199 Ok ( Self {
197- tick_rate,
198- frame_rate,
200+ tick_rate : args . tick_rate ,
201+ frame_rate : args . frame_rate ,
199202 components,
200203 header : Box :: new ( Header :: new ( ) ) ,
201204 should_quit : false ,
@@ -207,7 +210,7 @@ impl App {
207210 action_rx,
208211 cloud_worker_tx : cloud_worker,
209212 last_tick_key_events : Vec :: new ( ) ,
210- cloud_name,
213+ cloud_name : args . os_cloud . clone ( ) ,
211214 cloud_connected : false ,
212215 active_popup : None ,
213216 popups : HashMap :: from ( [
0 commit comments