- add: virtual workspace

- add: start of packet-service
This commit is contained in:
2024-11-26 13:16:20 -05:00
parent 815cb210dc
commit 47899d47cd
5 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
use crate::packet::Packet;
// use crate::handlers::{chat, movement};
use std::error::Error;
pub async fn route_packet(data: &[u8]) -> Result<(), Box<dyn Error>> {
let packet = Packet::parse(data)?;
match packet.packet_type {
// 1 => chat::handle_chat(packet).await?,
// 2 => movement::handle_movement(packet).await?,
_ => return Err("Unknown packet type".into()),
}
Ok(())
}