Compare commits

..

No commits in common. "fa99261efcf47cf25ec68a0933e1662b4fbc1499" and "21e1d8431f41b950d0945c8a047edf96829ee069" have entirely different histories.

3 changed files with 1 additions and 20 deletions

View file

@ -125,7 +125,6 @@
Group = cfg.group; Group = cfg.group;
ExecStart = ExecStart =
"${cfg.package}/bin/quiclime"; "${cfg.package}/bin/quiclime";
Restart = "on-failure";
}; };
environment = { environment = {

View file

@ -16,7 +16,7 @@ use tokio::{
}; };
use crate::{ use crate::{
netty::{WriteExtNetty, ReadExtNetty}, netty::WriteExtNetty,
proto::{ClientboundControlMessage, ServerboundControlMessage}, proto::{ClientboundControlMessage, ServerboundControlMessage},
}; };
@ -279,18 +279,6 @@ async fn politely_disconnect(
.await?; .await?;
connection.write_varint(buf.len() as i32).await?; connection.write_varint(buf.len() as i32).await?;
connection.write_all(&buf).await?; connection.write_all(&buf).await?;
let packet = netty::read_packet(&mut connection).await?;
let mut packet = packet.as_slice();
let id = packet.read_varint()?;
if id != 1 {
return Err(anyhow!("Packet isn't a Ping Request(0x01), but {:#04x}", id));
}
let payload = packet.read_long()?;
let mut buf = Vec::with_capacity(1 + 8);
buf.write_varint(1).await?;
buf.write_u64(payload).await?;
connection.write_varint(buf.len() as i32).await?;
connection.write_all(&buf).await?;
} }
netty::HandshakeType::Login => { netty::HandshakeType::Login => {
let _ = netty::read_packet(&mut connection).await?; let _ = netty::read_packet(&mut connection).await?;

View file

@ -39,12 +39,6 @@ pub trait ReadExtNetty: Read {
Ok(u16::from_be_bytes(buf)) Ok(u16::from_be_bytes(buf))
} }
fn read_long(&mut self) -> Result<u64, NettyReadError> {
let mut buf = [0u8; 8];
self.read_exact(&mut buf)?;
Ok(u64::from_be_bytes(buf))
}
fn read_string(&mut self) -> Result<String, NettyReadError> { fn read_string(&mut self) -> Result<String, NettyReadError> {
let len = self.read_varint()?; let len = self.read_varint()?;
let mut buf = vec![0u8; len as usize]; let mut buf = vec![0u8; len as usize];