pub fn connect(&mut self, ip: String, port: i32) {
        if self.recon.recon_queued == true {
            //were reconnecting, reset the ciphers
            self.game_connection.key_pair = rc4::CipherPair::new_const();
        }
        let full_ip = ip + ":" + &port.to_string();
        if self.base.use_socks {
            let (tx, rx, h) = factory::begin_networking(
                full_ip.clone(),
                self.base.socks_proxy.clone(),
                self.config.factory_delay_ms,
                self.config.factory_stack_size_kb,
            );
            self.game_connection.game_socket.tx = Some(tx);
            self.game_connection.game_socket.rx = Some(rx);
            self.factory_handle = Some(h);
        } else {
            let (tx, rx, h) = factory::begin_networking(
                full_ip.clone(),
                String::new(),
                self.config.factory_delay_ms,
                self.config.factory_stack_size_kb,
            );
            self.game_connection.game_socket.tx = Some(tx);
            self.game_connection.game_socket.rx = Some(rx);
            self.factory_handle = Some(h);
        }
        // self.sleep_thread(10); //reproduces the 100% usage bug
    }
/// Connects the client to the server with the provided IP address and sets the socket to nodelay
Connects the client to the server with the provided IP address and sets the socket to nodelay
Connects the client to the server with the provided IP address and sets the socket to nodelay
pub fn connect(&mut self, ip: String, port: i32) {
        if self.recon.recon_queued == true {
            //were reconnecting, reset the ciphers
            self.game_connection.key_pair = rc4::CipherPair::new_const();
        }
        let full_ip = ip + ":" + &port.to_string();
        if self.base.use_socks {
            let (tx, rx, h) = factory::begin_networking(
                full_ip.clone(),
                self.base.socks_proxy.clone(),
                self.config.factory_delay_ms,
                self.config.factory_stack_size_kb,
            );
            self.game_connection.game_socket.tx = Some(tx);
            self.game_connection.game_socket.rx = Some(rx);
            self.factory_handle = Some(h);
        } else {
            let (tx, rx, h) = factory::begin_networking(
                full_ip.clone(),
                String::new(),
                self.config.factory_delay_ms,
                self.config.factory_stack_size_kb,
            );
            self.game_connection.game_socket.tx = Some(tx);
            self.game_connection.game_socket.rx = Some(rx);
            self.factory_handle = Some(h);
        }
        // self.sleep_thread(10); //reproduces the 100% usage bug
    }
pub fn connect ( & mut self , ip : String , port : i32 ) { if self . recon . recon_queued == true { //were reconnecting, reset the ciphers self . game_connection . key_pair = rc4 :: CipherPair :: new_const ( ) ; } let full_ip = ip + " " + & port . to_string ( ) ; if self . base . use_socks { let ( tx , rx , h ) = factory :: begin_networking ( full_ip . clone ( ) , self . base . socks_proxy . clone ( ) , self . config . factory_delay_ms , self . config . factory_stack_size_kb , ) ; self . game_connection . game_socket . tx = Some ( tx ) ; self . game_connection . game_socket . rx = Some ( rx ) ; self . factory_handle = Some ( h ) ; } else { let ( tx , rx , h ) = factory :: begin_networking ( full_ip . clone ( ) , String :: new ( ) , self . config . factory_delay_ms , self . config . factory_stack_size_kb , ) ; self . game_connection . game_socket . tx = Some ( tx ) ; self . game_connection . game_socket . rx = Some ( rx ) ; self . factory_handle = Some ( h ) ; } // self.sleep_thread(10); //reproduces the 100% usage bug }
Connects the client to the server with the provided IP address and sets the socket to nodelay
Connects the client to the server with the provided IP address and sets the socket to nodelay
&mut self
ip
String
port
i32
&mut self
ip
String
port
i32