mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
* add configuration state
* start updating to 23w31a
* implement a bit more of 23w31a
* chunk batching
* start adding configuration state
* ioasfhjgsd
* almost works
* configuration state mostly implemented
* handle other packets in configuration state and fix keepalive
* cleanup, fix warnings
* 23w32a
* fix some doctests
* 23w33a
* 23w35a
* 1.20.2-pre2
* fix system conflicts
* 1.20.2-pre4
* make tests compile
* tests pass
* 1.20.2-rc2
* 1.20.2
* Revert "1.20.2"
This reverts commit dd152fd265
.
* didn't mean to commit that code
---------
Co-authored-by: mat <git@matdoes.dev>
29 lines
766 B
Rust
Executable file
29 lines
766 B
Rust
Executable file
use azalea_buf::McBuf;
|
|
use azalea_protocol_macros::ServerboundLoginPacket;
|
|
use uuid::Uuid;
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, McBuf, ServerboundLoginPacket)]
|
|
pub struct ServerboundHelloPacket {
|
|
pub name: String,
|
|
pub profile_id: Uuid,
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use std::io::Cursor;
|
|
|
|
use super::*;
|
|
use azalea_buf::{McBufReadable, McBufWritable};
|
|
|
|
#[test]
|
|
fn test_read_write() {
|
|
let packet = ServerboundHelloPacket {
|
|
name: "test".to_string(),
|
|
profile_id: Uuid::nil(),
|
|
};
|
|
let mut buf: Vec<u8> = Vec::new();
|
|
packet.write_into(&mut buf).unwrap();
|
|
let packet2 = ServerboundHelloPacket::read_from(&mut Cursor::new(&buf)).unwrap();
|
|
assert_eq!(packet, packet2);
|
|
}
|
|
}
|