- add: handle channel list request

- add: handle server select request
- add: handle character list request stub
- add: start health check function for consul
This commit is contained in:
2024-12-13 04:40:07 -05:00
parent 1220d7a031
commit 38ea2ddb71
9 changed files with 133 additions and 49 deletions

View File

@@ -1,12 +1,12 @@
use crate::packet::{Packet};
use crate::handlers::{auth};
use crate::auth_client::AuthClient;
use crate::handlers::*;
use crate::packet::Packet;
use crate::packet_type::PacketType;
use std::error::Error;
use std::sync::Arc;
use tokio::net::TcpStream;
use tokio::sync::Mutex;
use tracing::{debug, warn};
use crate::auth_client::AuthClient;
pub async fn route_packet(stream: &mut TcpStream, packet: Packet, auth_client: Arc<Mutex<AuthClient>>) -> Result<(), Box<dyn Error + Send + Sync>> {
debug!("Routing packet: {:?}", packet);
@@ -19,6 +19,9 @@ pub async fn route_packet(stream: &mut TcpStream, packet: Packet, auth_client: A
PacketType::PakcsSrvSelectReq => auth::handle_server_select_req(stream, packet).await,
PacketType::PakcsChannelListReq => auth::handle_channel_list_req(stream, packet).await,
// Character Stuff
PacketType::PakcsCharListReq => character::handle_char_list_req(stream, packet).await,
// 1 => chat::handle_chat(packet).await?,
// 2 => movement::handle_movement(packet).await?,
_ => {