Add --username option to set offline username (#290)
This commit is contained in:
parent
50befb5a0f
commit
3e96d2e03b
|
@ -170,6 +170,10 @@ struct Opt {
|
|||
#[structopt(short = "s", long = "server")]
|
||||
server: Option<String>,
|
||||
|
||||
/// Username for offline servers
|
||||
#[structopt(short = "u", long = "username")]
|
||||
username: Option<String>,
|
||||
|
||||
/// Log decoded packets received from network
|
||||
#[structopt(short = "n", long = "network-debug")]
|
||||
network_debug: bool,
|
||||
|
@ -267,6 +271,10 @@ fn main2() {
|
|||
}
|
||||
}
|
||||
|
||||
if let Some(username) = opt.username{
|
||||
vars.set(auth::CL_USERNAME, username);
|
||||
}
|
||||
|
||||
let textures = renderer.get_textures();
|
||||
let dpi_factor = window.window().current_monitor().hidpi_factor();
|
||||
let default_protocol_version = protocol::versions::protocol_name_to_protocol_version(
|
||||
|
|
Loading…
Reference in New Issue