再次修改了一些内容

This commit is contained in:
Zihaoxu2008
2025-01-25 22:51:13 +08:00
parent bbe7adffff
commit 79727e2b78
5 changed files with 23 additions and 24 deletions

View File

@@ -239,12 +239,14 @@ impl<T: StreamType> Bot<T> {
0x1A => {// 断连包
// disconnect
self.handle_disconnect(&mut packet).await?;
status_tx.send(2).unwrap();
break;
}
0x00 => {// 版本不匹配啥的就会走这
if self.status == 0{
let text = packet.read_string()?;
println!("[{}] Failed to login: {}", self.username, utils::parse_json_component(text.as_str()));
status_tx.send(2);
break;
}
}
@@ -321,7 +323,7 @@ impl<T: StreamType> Bot<T> {
iter += 1;
}
sleep(Duration::from_millis(1));
flag = self.conn.lock().await.is_alive();
flag = self.conn.lock().await.is_alive() && status!=2;
}
println!("[{}/WORKER] Worker stopped.", self.username);
}