pub fn game_loop(&mut self) {
        'z: while self.is_running == true {
            if self.is_connected == false {
                if self.recon.recon_queued == true {
                    if self.recon.check() {
                        println!(
                            "{} is over the reconnect limit, killing client...",
                            self.base.email
                        );
                        self.kill_client();
                        return;
                    }
                    thread::sleep(time::Duration::from_millis(
                        self.config.thread_delay_ms * self.recon.recon_wait_multiplier,
                    ));
                }
                self.connect(self.recon.current_server.clone(), 2050);
                //cool TODO: check if sockets Option is Ok, and set is_connected = true, instead of implied
                self.is_connected = true;
                self.recon.recon_queued = false;
                //todo: increment bots connected
                self.send_hello(
                    self.recon.game_id,
                    self.recon.game_key.clone(),
                    self.recon.game_key_time,
                );
                //at this point, this thread has to reach self.receive() before netfactory starts
                //otherwise this thread will lock up
            }
            'y: while self.is_connected == true {
                if self.recon.recon_queued == true {
                    self.disconnect();
                    break 'y;
                }
                self.receive();
                //Delay so that we dont hit 100% cpu usage, this sleep basically acts as our "FPS" limiter
                // thread::sleep(time::Duration::from_millis(
                //     self.config.thread_delay_ms,
                // ));
                //if this were a normal client with a game interface, we would do our draws here
                //we could also implement some form of mailbox MPI system for multi-system botting.
                //projectile handling will be implemented here later.
            }
            //wait for factory thread to die
            self.factory_handle.take().unwrap().join().unwrap();
        }
        //client is no longer running, maybe clean up resources?
    }
/// The main loop that the client will be in. Any thread/task splitting should be done before this call.
The main loop that the client will be in. Any thread/task splitting should be done before this call.
The main loop that the client will be in . Any thread / task splitting should be done before this call .
pub fn game_loop(&mut self) {
        'z: while self.is_running == true {
            if self.is_connected == false {
                if self.recon.recon_queued == true {
                    if self.recon.check() {
                        println!(
                            "{} is over the reconnect limit, killing client...",
                            self.base.email
                        );
                        self.kill_client();
                        return;
                    }
                    thread::sleep(time::Duration::from_millis(
                        self.config.thread_delay_ms * self.recon.recon_wait_multiplier,
                    ));
                }
                self.connect(self.recon.current_server.clone(), 2050);
                //cool TODO: check if sockets Option is Ok, and set is_connected = true, instead of implied
                self.is_connected = true;
                self.recon.recon_queued = false;
                //todo: increment bots connected
                self.send_hello(
                    self.recon.game_id,
                    self.recon.game_key.clone(),
                    self.recon.game_key_time,
                );
                //at this point, this thread has to reach self.receive() before netfactory starts
                //otherwise this thread will lock up
            }
            'y: while self.is_connected == true {
                if self.recon.recon_queued == true {
                    self.disconnect();
                    break 'y;
                }
                self.receive();
                //Delay so that we dont hit 100% cpu usage, this sleep basically acts as our "FPS" limiter
                // thread::sleep(time::Duration::from_millis(
                //     self.config.thread_delay_ms,
                // ));
                //if this were a normal client with a game interface, we would do our draws here
                //we could also implement some form of mailbox MPI system for multi-system botting.
                //projectile handling will be implemented here later.
            }
            //wait for factory thread to die
            self.factory_handle.take().unwrap().join().unwrap();
        }
        //client is no longer running, maybe clean up resources?
    }
pub fn game_loop ( & mut self ) { ' z : while self . is_running == true { if self . is_connected == false { if self . recon . recon_queued == true { if self . recon . check ( ) { println ! ( " " self base email ) ; self . kill_client ( ) ; return ; } thread :: sleep ( time :: Duration :: from_millis ( self . config . thread_delay_ms * self . recon . recon_wait_multiplier , ) ) ; } self . connect ( self . recon . current_server . clone ( ) , 2050 ) ; //cool TODO: check if sockets Option is Ok, and set is_connected = true, instead of implied self . is_connected = true ; self . recon . recon_queued = false ; //todo: increment bots connected self . send_hello ( self . recon . game_id , self . recon . game_key . clone ( ) , self . recon . game_key_time , ) ; //at this point, this thread has to reach self.receive() before netfactory starts //otherwise this thread will lock up } ' y : while self . is_connected == true { if self . recon . recon_queued == true { self . disconnect ( ) ; break ' y ; } self . receive ( ) ; //Delay so that we dont hit 100% cpu usage, this sleep basically acts as our "FPS" limiter // thread::sleep(time::Duration::from_millis( //     self.config.thread_delay_ms, // )); //if this were a normal client with a game interface, we would do our draws here //we could also implement some form of mailbox MPI system for multi-system botting. //projectile handling will be implemented here later. } //wait for factory thread to die self . factory_handle . take ( ) . unwrap ( ) . join ( ) . unwrap ( ) ; } //client is no longer running, maybe clean up resources? }
The main loop that the client will be in.
The main loop that the client will be in .
&mut self
&mut self