fn quit_event(&mut self, _ctx: &mut Context) -> bool {
        let remote_addr: SocketAddr = env::args()
            .nth(1)
            .unwrap_or("127.0.0.1:12464".into())
            .parse()
            .unwrap();
        let local_addr: SocketAddr = if remote_addr.is_ipv4() {
            "0.0.0.0:0"
        } else {
            "[::]:0"
        }.parse()
        .unwrap();
        let socket = UdpSocket::bind(&local_addr).unwrap();

        let _ = socket
            .send_dgram(
                format!("{{\"action\": \"disconnect\", \"id\": {}}}", self.id),
                &remote_addr,
            ).wait();
        false
    }
/// Send a disconnect signal to server to remove player
Send a disconnect signal to server to remove player
Send a disconnect signal to server to remove player
fn quit_event(&mut self, _ctx: &mut Context) -> bool {
        let remote_addr: SocketAddr = env::args()
            .nth(1)
            .unwrap_or("127.0.0.1:12464".into())
            .parse()
            .unwrap();
        let local_addr: SocketAddr = if remote_addr.is_ipv4() {
            "0.0.0.0:0"
        } else {
            "[::]:0"
        }.parse()
        .unwrap();
        let socket = UdpSocket::bind(&local_addr).unwrap();
        let _ = socket
            .send_dgram(
                format!("{{\"action\": \"disconnect\", \"id\": {}}}", self.id),
                &remote_addr,
            ).wait();
        false
    }
fn quit_event ( & mut self , _ctx : & mut Context ) -> bool { let remote_addr : SocketAddr = env :: args ( ) . nth ( 1 ) . unwrap_or ( " " . into ( ) ) . parse ( ) . unwrap ( ) ; let local_addr : SocketAddr = if remote_addr . is_ipv4 ( ) { " " } else { " " } . parse ( ) . unwrap ( ) ; let socket = UdpSocket :: bind ( & local_addr ) . unwrap ( ) ; let _ = socket . send_dgram ( format ! ( " \" \" \" \" \" \" " self id ) , & remote_addr , ) . wait ( ) ; false }
Send a disconnect signal to server to remove player
Send a disconnect signal to server to remove player
&mut self
_ctx
&mut Context