diff options
| author | mat <github@matdoes.dev> | 2022-01-01 23:55:19 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-01-01 23:55:19 -0600 |
| commit | a1afbb6031527c1db5831fc8e916bc0ecce633b4 (patch) | |
| tree | 56fbccf52645cc2eefd231506ffe8ed71018dc01 /azalea-protocol/src/packets/status | |
| parent | e81b85dd5bdd6d42ee84f24ed4a142f6141f170e (diff) | |
| download | azalea-drasl-a1afbb6031527c1db5831fc8e916bc0ecce633b4.tar.xz | |
start adding packet macros
Diffstat (limited to 'azalea-protocol/src/packets/status')
3 files changed, 5 insertions, 3 deletions
diff --git a/azalea-protocol/src/packets/status/clientbound_status_response_packet.rs b/azalea-protocol/src/packets/status/clientbound_status_response_packet.rs index 38270ad1..58f5b701 100644 --- a/azalea-protocol/src/packets/status/clientbound_status_response_packet.rs +++ b/azalea-protocol/src/packets/status/clientbound_status_response_packet.rs @@ -39,7 +39,9 @@ impl ClientboundStatusResponsePacket { StatusPacket::ClientboundStatusResponsePacket(Box::new(self)) } - pub fn write(&self, _buf: &mut Vec<u8>) {} + pub fn write(&self, _buf: &mut Vec<u8>) -> Result<(), std::io::Error> { + Ok(()) + } pub async fn read<T: tokio::io::AsyncRead + std::marker::Unpin + std::marker::Send>( buf: &mut T, diff --git a/azalea-protocol/src/packets/status/mod.rs b/azalea-protocol/src/packets/status/mod.rs index 6383bae8..31fedfb9 100644 --- a/azalea-protocol/src/packets/status/mod.rs +++ b/azalea-protocol/src/packets/status/mod.rs @@ -29,7 +29,7 @@ impl ProtocolPacket for StatusPacket { } } - fn write(&self, buf: &mut Vec<u8>) { + fn write(&self, buf: &mut Vec<u8>) -> Result<(), std::io::Error> { match self { StatusPacket::ServerboundStatusRequestPacket(packet) => packet.write(buf), StatusPacket::ClientboundStatusResponsePacket(packet) => packet.write(buf), diff --git a/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs b/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs index 3a25ac42..af98f7cb 100644 --- a/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs +++ b/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs @@ -10,7 +10,7 @@ impl ServerboundStatusRequestPacket { StatusPacket::ServerboundStatusRequestPacket(self) } - pub fn write(&self, _buf: &mut Vec<u8>) { + pub fn write(&self, _buf: &mut Vec<u8>) -> Result<(), std::io::Error> { panic!("ServerboundStatusRequestPacket::write not implemented") } |
