mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add server for game data (implement login sequence)
This commit is contained in:
@@ -24,10 +24,17 @@ async fn main() -> std::io::Result<()> {
|
||||
|
||||
let listener = net::TcpListener::bind(std::net::SocketAddr::new(ip_addr, args.port)).await?;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
loop {
|
||||
let (socket, address) = listener.accept().await?;
|
||||
tokio::spawn(process_socket(socket, address, NonZero::new(args.retries), redirect_static, room_name_static));
|
||||
}
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let (socket, address) = listener.accept().await?;
|
||||
process_socket(socket, address, NonZero::new(args.retries), redirect_static, room_name_static).await;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
async fn process_socket(mut socket: net::TcpStream, address: std::net::SocketAddr, retries: Option<NonZero<usize>>, game_server_url: &str, game_server_name: &str) {
|
||||
@@ -50,6 +57,7 @@ async fn process_socket(mut socket: net::TcpStream, address: std::net::SocketAdd
|
||||
Packet::Packet(packet) => log::warn!("Not handling packet {:?}", packet),
|
||||
}
|
||||
}
|
||||
log::debug!("Goodbye connection from address {}", address);
|
||||
}
|
||||
|
||||
async fn handle_ping(ping: Ping, buf: &mut Vec<u8>, socket: &mut net::TcpStream) {
|
||||
|
||||
Reference in New Issue
Block a user