- add: virtual workspace
- add: start of packet-service
This commit is contained in:
15
packet-service/src/router.rs
Normal file
15
packet-service/src/router.rs
Normal 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(())
|
||||
}
|
||||
Reference in New Issue
Block a user