File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ struct Opt {
170170 #[ structopt( short = "s" , long = "server" ) ]
171171 server : Option < String > ,
172172
173+ /// Username for offline servers
174+ #[ structopt( short = "u" , long = "username" ) ]
175+ username : Option < String > ,
176+
173177 /// Log decoded packets received from network
174178 #[ structopt( short = "n" , long = "network-debug" ) ]
175179 network_debug : bool ,
@@ -267,6 +271,10 @@ fn main2() {
267271 }
268272 }
269273
274+ if let Some ( username) = opt. username {
275+ vars. set ( auth:: CL_USERNAME , username) ;
276+ }
277+
270278 let textures = renderer. get_textures ( ) ;
271279 let dpi_factor = window. window ( ) . current_monitor ( ) . hidpi_factor ( ) ;
272280 let default_protocol_version = protocol:: versions:: protocol_name_to_protocol_version (
You can’t perform that action at this time.
0 commit comments