Browse Source

Move config module to client crate.

wip
Titouan Rigoudy 4 years ago
parent
commit
815a414df8
4 changed files with 8 additions and 7 deletions
  1. +1
    -1
      client/src/client.rs
  2. +2
    -0
      client/src/config.rs
  3. +5
    -5
      client/src/main.rs
  4. +0
    -1
      proto/src/lib.rs

+ 1
- 1
client/src/client.rs View File

@ -3,10 +3,10 @@ use std::net;
use crossbeam_channel;
use slab;
use solstice_proto;
use solstice_proto::config;
use solstice_proto::peer;
use solstice_proto::server;
use crate::config;
use crate::control;
use crate::login::LoginStatus;
use crate::room;


proto/src/config.rs → client/src/config.rs View File

@ -6,7 +6,9 @@ pub const PASSWORD: &'static str = "topsekrit";
pub const SERVER_HOST: &'static str = "server.slsknet.org";
pub const SERVER_PORT: u16 = 2242;
#[allow(dead_code)]
pub const LISTEN_HOST: &'static str = "0.0.0.0";
pub const LISTEN_PORT: u16 = 2243;
pub const CONTROL_HOST: &'static str = "localhost";

+ 5
- 5
client/src/main.rs View File

@ -7,11 +7,11 @@ use clap::{App, Arg};
use crossbeam_channel;
use env_logger;
use log::info;
use solstice_proto::config;
use tokio::net::TcpStream;
use tokio::sync::mpsc;
mod client;
mod config;
mod context;
mod control;
mod dispatcher;
@ -41,8 +41,8 @@ async fn run_client(
) -> anyhow::Result<()> {
let address = format!(
"{}:{}",
solstice_proto::config::SERVER_HOST,
solstice_proto::config::SERVER_PORT
config::SERVER_HOST,
config::SERVER_PORT
);
info!("Connecting to server at {}.", address);
let stream = TcpStream::connect(address)
@ -51,8 +51,8 @@ async fn run_client(
info!("Connection successful.");
let credentials = solstice_proto::server::Credentials::new(
solstice_proto::config::USERNAME.to_string(),
solstice_proto::config::PASSWORD.to_string(),
config::USERNAME.to_string(),
config::PASSWORD.to_string(),
)
.context("validating credentials")?;


+ 0
- 1
proto/src/lib.rs View File

@ -1,4 +1,3 @@
pub mod config;
mod core;
pub mod peer;
pub mod server;


Loading…
Cancel
Save