|
|
@ -5,6 +5,7 @@ use clap::{App, Arg}; |
|
|
use crossbeam_channel;
|
|
|
use crossbeam_channel;
|
|
|
use env_logger;
|
|
|
use env_logger;
|
|
|
use log::{error, info};
|
|
|
use log::{error, info};
|
|
|
|
|
|
use solstice_proto::server::{Client, ServerRequest};
|
|
|
use tokio::net::TcpStream;
|
|
|
use tokio::net::TcpStream;
|
|
|
use tokio::sync::mpsc;
|
|
|
use tokio::sync::mpsc;
|
|
|
|
|
|
|
|
|
@ -37,7 +38,7 @@ fn old_main(config: Config) { |
|
|
|
|
|
|
|
|
async fn run_client(
|
|
|
async fn run_client(
|
|
|
config: Config,
|
|
|
config: Config,
|
|
|
request_rx: mpsc::Receiver<solstice_proto::ServerRequest>,
|
|
|
|
|
|
|
|
|
request_rx: mpsc::Receiver<ServerRequest>,
|
|
|
dispatcher_tx: mpsc::Sender<dispatcher::Message>,
|
|
|
dispatcher_tx: mpsc::Sender<dispatcher::Message>,
|
|
|
) -> anyhow::Result<()> {
|
|
|
) -> anyhow::Result<()> {
|
|
|
info!("Connecting to server at {}.", config.server_address);
|
|
|
info!("Connecting to server at {}.", config.server_address);
|
|
|
@ -47,7 +48,7 @@ async fn run_client( |
|
|
info!("Connection successful.");
|
|
|
info!("Connection successful.");
|
|
|
|
|
|
|
|
|
info!("Logging in to server.");
|
|
|
info!("Logging in to server.");
|
|
|
let (_info, mut worker) = solstice_proto::server::Client::new(stream)
|
|
|
|
|
|
|
|
|
let (_info, mut worker) = Client::new(stream)
|
|
|
.login(config.credentials)
|
|
|
.login(config.credentials)
|
|
|
.await
|
|
|
.await
|
|
|
.context("logging in")?;
|
|
|
.context("logging in")?;
|
|
|
|